> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Strands Agents

SurrealDB Agent Memory as tools for the Strands Agents SDK.

SurrealDB Agent Memory exposes its memory operations as [Strands Agents](https://strandsagents.com) 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).

```python
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?"))
```

## Installation

```bash
pip install agent-memory-strands-agents
```

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

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

Requires Python 3.10+.

## Environment

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

**Bash**

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

**PowerShell**

```powershell
$env:AGENT_MEMORY_ENDPOINT = "https://api.agent-memory.example"
$env:AGENT_MEMORY_API_KEY = "your-bearer-token"
$env:AGENT_MEMORY_CONTEXT = "acme-prod"
```

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

```python
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)
```

## Tools

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

| Tool | Purpose |
| --- | --- |
| `agent_memory_remember` | Store a fact or observation for later recall. |
| `agent_memory_recall` | Search memory and return the most relevant stored information. |
| `agent_memory_context` | Assemble a working-memory context block for a query. |
| `agent_memory_reflect` | Run a synthesis pass that consolidates and connects memories. |
| `agent_memory_forget` | Delete memories that match a query. |
| `agent_memory_upload` | Ingest a document so its contents become recallable. |
| `agent_memory_inspect` | Browse the substrate as queryable data for debugging or audit. |

Choose a subset with `include` or `exclude`:

```python
# 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

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:

```python
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.

## When to use MCP or the SDK instead

- For an MCP-native host, use the [MCP server](/docs/agent-memory/integrations/mcp-server/install.md).
- To call SurrealDB Agent Memory directly, use the [Python SDK](/docs/agent-memory/integrations/sdks/python.md).
