Skip to content

Integrations

Agent Memory integrations

SurrealDB Agent Memory connects to agents through HTTP, MCP, official SDKs, and harness adapters that mirror conversation turns into POST /api/v1/{context_id}/facts/batch, using the same provenance and trust model as the server.

The REST surface is described by an OpenAPI specification. The Python, TypeScript, Swift, and Kotlin clients track that spec so request and response shapes stay aligned with the server.

The server serves native MCP at /mcp on the api port, with the same Authorization: Bearer auth as REST. Prefer this when the client already speaks MCP. Point the client at your instance's /mcp endpoint, or install it with install-mcp:

npx install-mcp https://<your-context-host>/mcp \
  --client cursor \
  --header "Authorization: Bearer <your-api-key>" --oauth no

→ MCP server install · Per-client guides: Claude · Cursor · VS Code · JetBrains · JetBrains Air · Zed · Windsurf · Codex · Antigravity · OpenCode

The figure below shows how an MCP client reaches the memory tools, and where the grant check sits.

Memory as tools over MCP. The model chooses a tool mid-conversation and the MCP client, such as Claude, Cursor or Codex, sends it to /mcp with an Authorization Bearer key, the same authentication as REST. The key resolves to a principal and its grants, and each tool needs the verb its REST equivalent needs, such as memory:forget for forget. Allowed calls reach the Agent Memory tools recall, remember, forget, context, reflect, upload and inspect. A call whose verb is not granted returns an isError result carrying the REST status, and reads outside the grant region return nothing.Memory as tools over MCP. The model chooses a tool mid-conversation and the MCP client, such as Claude, Cursor or Codex, sends it to /mcp with an Authorization Bearer key, the same authentication as REST. The key resolves to a principal and its grants, and each tool needs the verb its REST equivalent needs, such as memory:forget for forget. Allowed calls reach the Agent Memory tools recall, remember, forget, context, reflect, upload and inspect. A call whose verb is not granted returns an isError result carrying the REST status, and reads outside the grant region return nothing.

Call SurrealDB Agent Memory directly from application code.

LanguagePackage
Dartsurrealdb from the surrealdb.dart git repository (import memory.dart)
Elixir:surrealdb from the surrealdb.elixir git repository (SurrealDB.Memory)
Gomemory package in surrealdb.go
Haskellsurrealdb-memory
JavaScript / TypeScript@surrealdb/memory
Kotlinbundled in com.surrealdb:kotlin
Pythonsurrealdb-memory, installed with the surrealdb[memory] extra
SwiftAgentMemory product in surrealdb.swift

→ Dart · Elixir · Go · Haskell · JavaScript & TypeScript · Kotlin · Python · Swift

These integrations add memory to the popular TypeScript AI SDKs by wrapping recall and storage around your model calls.

The figure below shows that middleware loop, which the agent framework adapters also use for their automatic per-turn memory.

Memory as middleware. A user message goes to a before-the-model step that fetches recall or context for the message plus the user's profile from Agent Memory, scoped to the caller's key. The memory is injected as a system message into your model call. An after-the-model step stores the user turn and the reply in Agent Memory, and the reply goes to the user. The model never sees a memory tool, and a fail-open adapter calls the model without memory if Agent Memory cannot be reached.Memory as middleware. A user message goes to a before-the-model step that fetches recall or context for the message plus the user's profile from Agent Memory, scoped to the caller's key. The memory is injected as a system message into your model call. An after-the-model step stores the user turn and the reply in Agent Memory, and the reply goes to the user. The model never sees a memory tool, and a fail-open adapter calls the model without memory if Agent Memory cannot be reached.

  • Cloudflare Workers AI: the client inside a Worker, alongside Workers AI models.

  • TanStack AI: the @surrealdb/memory client in TanStack Start server routes.

  • Vercel AI SDK: @surrealdb/agent-memory-vercel-ai, via wrapLanguageModel middleware and a tool set.

→ Cloudflare Workers AI · TanStack AI · Vercel AI SDK

Harness adapters expose SurrealDB Agent Memory as agent tools and add automatic per-turn memory, without changing your prompts. The Python adapters are not published on PyPI. Install each one from its GitHub repository, for example pip install "git+https://github.com/surrealdb/agent-memory-crew-ai".

FrameworkPackageLanguage
CrewAIagent-memory-crew-aiPython
Eve@surrealdb/agent-memory-eveTypeScript
Google ADKagent-memory-google-adkPython
Hermes Agentagent-memory-hermesPython
LangChain / LangGraph@surrealdb/langchain, @surrealdb/langgraphTypeScript
Mastra@surrealdb/mastra-aiTypeScript
OpenAI Agents SDKagent-memory-openai-agents-sdkPython
OpenClaw@surrealdb/agent-memory-openclawTypeScript
Pydantic AIagent-memory-pydantic-aiPython
Strands Agentsagent-memory-strands-agentsPython

→ CrewAI · Eve · Google ADK · Hermes Agent · LangChain · Mastra · OpenAI Agents SDK · OpenClaw · Pydantic AI · Strands Agents

Frameworks without a dedicated package integrate directly through the SDK.

→ Agno · AutoGen · Camel AI · LlamaIndex

Give voice agents memory that persists across calls.

→ ElevenLabs · LiveKit · Gradium

  • n8n: the @surrealdb/n8n-nodes-surrealdb community node, plus SurrealDB Agent Memory over the REST API.

  • Zo Computer: a Zo skill that calls the SurrealDB Agent Memory SDK for recall and storage.

→ n8n · Zo Computer

Run SurrealDB Agent Memory for memory while an observability platform traces and evaluates the agent.

→ AgentOps · Respan

Call the API over HTTP from any language. Routes live under /api/v1/{context_id}/… on your context host.

→ REST integration guide · Full reference

  • Embedded in-process library: use REST or an SDK against a deployed instance (Embedded quickstart).

  • Filesystem view: browsing a context as though it were a filesystem through MCP resources is planned. The MCP server does not provide it yet.

Was this page helpful?