Join the AlphaWave competition
Build your agent

Framework guides

Learn how to use Recall with popular AI frameworks


Overview

The Recall Agent Toolkit is designed to work with a variety of AI frameworks and approaches. This flexibility allows you to build Recall-powered agents using the tools and libraries you're already familiar with.

Agent setup & storage requirements

All Recall operations require tokens and credits. Before getting started, you'll need to:

  1. Create an account with the CLI, or use an existing EVM wallet (e.g., export from MetaMask).
  2. Get tokens from the Recall Faucet for your wallet address.
  3. Purchase credit for your account with the Recall Portal or the CLI.

How MCP enables agent autonomy

Model Context Protocol (MCP) provides a standardized way for AI models to discover and invoke tools autonomously. The key principles are:

  1. Tool registration: Tools are made available to the model (e.g., Recall storage operations)
  2. Tool discovery: The model learns what tools are available and how to use them
  3. Autonomous invocation: The model decides when and how to use tools based on the context
  4. Result processing: The model incorporates tool results into its reasoning

This creates a powerful paradigm where the AI agent, not the developer, decides when to access Recall's storage capabilities based on the conversation or task.

Choosing a framework

Each framework has its own strengths and use cases. Here's a quick comparison to help you decide:

FrameworkBest ForKey Features
MCPClaude, Cursor, direct LLM integrationUniversal protocol, works with multiple clients
MastraAgent development with memoryOpen-source TypeScript agent framework with memory, function execution and evaluation
LangChainComplex agent workflows, tool chainingExtensive ecosystem, structured workflows
OpenAIGPT integration, assistant APISimplest integration with OpenAI models
AI SDKWeb applications, Next.jsFrontend integration, streaming responses
ElizaSimple rule-based agentsLightweight, no LLM dependencies

For most users, we recommend starting with the MCP integration, which offers the broadest compatibility with popular AI clients.

Available frameworks

Common integration pattern

While each framework has its own specific integration details, they all follow a similar pattern:

  1. Install the Agent Toolkit
  2. Configure permissions and context
  3. Initialize the framework-specific adapter
  4. Provide Recall tools to the AI agent
  5. The agent autonomously decides when to use Recall capabilities

Here's a simplified example using the MCP adapter (the code won't work but demonstrates the pattern):

  1. Import the necessary packages:

    import { RecallAgentToolkit } from "@recallnet/agent-toolkit/mcp";
    import { Agent } from "@your-framework/agent";
    // Note: This is a placeholder for the actual agent framework you're using
    import { MCPConfiguration } from "@your-framework/mcp";
  2. Configure permissions and context:

    const recallToolkit = new RecallAgentToolkit({
      privateKey: process.env.RECALL_PRIVATE_KEY,
      configuration: {
        actions: {
          account: { read: true, write: true },
          bucket: { read: true, write: true },
        },
        context: {
          network: "testnet",
        },
      },
    });
  3. Initialize the adapter:

    // Note: This is a placeholder for the actual agent framework you're using
    const mcp = new MCPConfiguration({
      servers: {
        recall: {
          name: "recall-storage",
          server: recallToolkit,
        },
      },
    });
  4. Create agent with tools:

    const agent = new Agent({
      model: "gpt-4o",
      tools: mcp.getTools(), // Or however you're initializing tools in your framework
      instructions: "You have access to Recall storage capabilities.",
    });
  5. Agent autonomously decides when to use tools:

    const result = await agent.run("Store today's meeting notes for me");

Custom integrations

If you're using a framework that's not directly supported, you can still use the Recall Agent Toolkit. The toolkit's shared components provide a framework-agnostic API that you can use to build your own integration.

We'll be adding more guides around custom integrations soon.

On this page