Skip to main content
AMFS integrates with Strands Agents as a plugin, giving your agents persistent, versioned memory with automatic causal tracing — deeper than tool-only integrations.

Installation

pip install amfs-strands strands-agents

The AMFSPlugin registers memory tools on your agent and automatically tracks every tool call into causal chains:
from strands import Agent
from amfs import AgentMemory
from amfs_strands import AMFSPlugin

mem = AgentMemory(agent_id="research-agent")
agent = Agent(
    system_prompt="You are a research assistant with persistent memory.",
    plugins=[AMFSPlugin(mem)],
)

agent("Research the latest AI papers and remember key findings")

Tools registered by the plugin

ToolWhat it does
amfs_readRetrieve memory entries by path and key
amfs_writeStore values with confidence levels
amfs_searchQuery entries with text and filters
amfs_recallAgent-scoped reads of the agent’s own entries
amfs_listDisplay all entries under a path
amfs_record_contextTrack external context in causal chains

Tools-Only Setup

If you prefer a single-tool approach without the full plugin:
from strands import Agent
from amfs_strands import amfs_memory

agent = Agent(tools=[amfs_memory])
Supports store, retrieve, search, and list actions. Set the AMFS_AGENT_ID environment variable to identify the agent:
export AMFS_AGENT_ID="my-agent"

Key Features

Versioning — AMFS tracks how agent knowledge evolves through copy-on-write versions. Every write creates a new version; older versions remain queryable. Provenance — AMFS records which agent wrote each entry, in which session, and when. Entries from different agents in a shared memory space are always attributable. Automatic Causal Tracing — The plugin automatically records non-AMFS tool calls into causal chains. No extra instrumentation needed. Outcome Tracking — Record success or failure after an action to adjust the confidence score on related memory entries:
mem.record_outcome(success=True, entry_path="research/papers")
Decision Traces — Use explain() to view the complete causal chain behind any memory entry:
mem.explain("research/papers/attention-is-all-you-need")

SaaS Connection

Set your connection environment variables — the plugin picks them up automatically:
export AMFS_HTTP_URL="https://amfs-login.sense-lab.ai"
export AMFS_API_KEY="amfs_sk_your_key_here"
Or configure explicitly in code:
from amfs_adapter_http import HttpAdapter

adapter = HttpAdapter(
    base_url="https://amfs-login.sense-lab.ai",
    api_key="amfs_sk_your_key_here",
)
mem = AgentMemory(agent_id="my-agent", adapter=adapter)

Multi-Agent Setup

Use separate agent_id values for each agent. AMFS handles provenance automatically — all agents can share the same memory space while keeping their writes attributable:
researcher = AgentMemory(agent_id="researcher")
writer = AgentMemory(agent_id="writer")

Disable Auto-Tracing

If you want the plugin’s memory tools without automatic causal tracing of other tool calls:
plugin = AMFSPlugin(mem, auto_trace=False)

What’s next

Framework Integrations

Use AMFS with CrewAI, LangGraph, LangChain, and AutoGen.

Core Concepts

Understand versioning, provenance, and causal graphs in AMFS.