GitHub

Quick Start

Add persistent memory to your AI agent in 5 minutes.

Prerequisites

Installation

Install the Functor SDK with pip:

pip install functor-sdk

Or with uv for faster installation:

uv pip install functor-sdk

Basic Usage

Step 1: Initialize the Client

Create a FunctorClient with your API key:

from functor_sdk import FunctorClient
client = FunctorClient(
api_key="your-api-key",
base_url="http://localhost:8000" # Your Functor backend
)

Step 2: Discover Available Tools

Use the ToolRegistry to discover all available memory tools:

from functor_sdk.tools import ToolRegistry
# Discover all tools from the memory namespace
registry = ToolRegistry()
tools = registry.discover(client.memory)
# See what tools are available
print(f"Found {len(tools)} tools")
for name, tool in list(tools.items())[:5]:
print(f" - {name}: {tool.description}")

Output:

Found 71 tools
- functor_episodic_create: Create a new episodic memory entry
- functor_episodic_search: Search episodic memories by query
- functor_episodic_get: Get a specific episode by ID
- functor_semantic_add_fact: Add a semantic fact to knowledge graph
- functor_procedural_create: Create a new procedure

Step 3: Call Tools

Use FunctorToolContext to execute tools:

from functor_sdk.tools import FunctorToolContext
import asyncio
async def main():
ctx = FunctorToolContext(client)
# Store an episode
result = await ctx.call("functor_episodic_create", {
"session_id": "session-123",
"event_type": "user_message",
"content": "User asked about Python best practices",
"metadata": {"topic": "programming"}
})
print(f"Created episode: {result}")
# Search memories
results = await ctx.call("functor_episodic_search", {
"query": "Python programming",
"limit": 5
})
print(f"Found {len(results)} matching episodes")
asyncio.run(main())

Framework-Specific Quick Starts

Choose your framework to see framework-specific examples:

Tool Naming Convention

All tools follow a consistent naming pattern:

functor_{namespace}_{method}
Examples:
functor_episodic_create → client.memory.episodic.create_async()
functor_semantic_add_fact → client.memory.semantic.add_fact_async()
functor_procedural_execute → client.memory.procedural.execute_async()

Available Namespaces

NamespaceToolsDescription
episodic8Temporal interaction events
semantic7Knowledge facts
procedural6Workflow procedures
short_term5Session buffers
long_term6Persistent archives
pruning5Memory lifecycle
personalization6User preferences
observability5Metrics and logging
multi_tenant7Tenant isolation
rollout6Planning simulations

Next Steps

See the Tool Reference for the complete list of all 71 tools with parameters and examples.