Agent frameworks

Strands Agents

Spectron memory as tools for the Strands Agents SDK.

Spectron 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: spectron-strands (PyPI). It pulls in strands-agents and surrealdb (which provides the Spectron client).

from strands import Agent
from spectron_strands import spectron_tools

agent = Agent(tools=spectron_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 spectron-strands

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

pip install "spectron-strands[bedrock]"

Requires Python 3.10+.

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

export SPECTRON_ENDPOINT="https://api.spectron.example"
export SPECTRON_API_KEY="your-bearer-token"
export SPECTRON_CONTEXT="acme-prod"

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

from surrealdb import Spectron
from spectron_strands import spectron_tools

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

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

spectron_tools() returns seven tools by default, one per Spectron operation:

ToolPurpose
spectron_rememberStore a fact or observation for later recall.
spectron_recallSearch memory and return the most relevant stored information.
spectron_contextAssemble a working-memory context block for a query.
spectron_reflectRun a synthesis pass that consolidates and connects memories.
spectron_forgetDelete memories that match a query.
spectron_uploadIngest a document so its contents become recallable.
spectron_inspectBrowse the substrate as queryable data for debugging or audit.

Choose a subset with include or exclude:

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

# Everything except deletion and inspection.
tools = spectron_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 = spectron_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.

Was this page helpful?