Skip to content

Agent frameworks

Strands Agents

SurrealDB Agent Memory exposes its memory operations as Strands Agents tools, so any Strands agent can store and retrieve long-term memory with a single line of setup.

Package: agent-memory-strands-agents (PyPI). It pulls in strands-agents and surrealdb (which provides the SurrealDB Agent Memory client).

from strands import Agent
from agent_memory_strands import agent_memory_tools

agent = Agent(tools=agent_memory_tools())

agent("Remember that we signed a contract with Meditech Solutions for 1.2M GBP.")
print(agent("What is the value of the Meditech Solutions contract?"))
pip install agent-memory-strands-agents

To run the examples with Amazon Bedrock (Strands' default model provider):

pip install "agent-memory-strands-agents[bedrock]"

Requires Python 3.10+.

With these set, agent_memory_tools() builds the client for you:

export AGENT_MEMORY_ENDPOINT="https://api.agent-memory.example"
export AGENT_MEMORY_API_KEY="your-bearer-token"
export AGENT_MEMORY_CONTEXT="acme-prod"

You can also pass the values directly, or hand in a client you already have:

from surrealdb.memory import Memory
from agent_memory_strands import agent_memory_tools

# From explicit arguments.
tools = agent_memory_tools(
    endpoint="https://api.agent-memory.example",
    api_key="your-bearer-token",
    context="acme-prod",
)

# Or reuse an existing client.
client = Memory(context="acme-prod", endpoint="...", api_key="...")
tools = agent_memory_tools(client=client)

agent_memory_tools() returns seven tools by default, one per SurrealDB Agent Memory operation:

ToolPurpose
agent_memory_rememberStore a fact or observation for later recall.
agent_memory_recallSearch memory and return the most relevant stored information.
agent_memory_contextAssemble a working-memory context block for a query.
agent_memory_reflectRun a synthesis pass that consolidates and connects memories.
agent_memory_forgetDelete memories that match a query.
agent_memory_uploadIngest a document so its contents become recallable.
agent_memory_inspectBrowse the substrate as queryable data for debugging or audit.

Choose a subset with include or exclude:

# Only the everyday read/write pair.
tools = agent_memory_tools(include=["remember", "recall"])

# Everything except deletion and inspection.
tools = agent_memory_tools(exclude=["forget", "inspect"])

Scopes isolate memory by principal, tenant, or session. A scope is a path string such as "org/acme/user/alice", or a list of paths. Set a default for all tools and let the agent override it per call:

tools = agent_memory_tools(scope="org/acme/user/alice")

Every tool also accepts a scope argument, so a multi-user agent can direct a single operation at a specific principal.

  • For an MCP-native host, use the MCP server.

  • To call SurrealDB Agent Memory directly, use the Python SDK.

Was this page helpful?