Documentation

Anona Memory is a managed memory layer for AI agents. Store facts in isolated memory spaces, recall them semantically across sessions, and synthesize insights: via REST API, the Python SDK, or MCP.

How it works

Anona exposes three core operations. Each maps to an API endpoint, an SDK method, and an MCP tool:

OperationWhat it doesRESTMCP tool
RetainStore facts, preferences, and session contextPOST /v1/memoriesremember
RecallSemantic search over stored memoriesPOST /v1/searchrecall
ReflectSynthesize patterns and insights from a spacePOST /v1/insightsget_insights

Memory spaces

A memory space is an isolated collection of memories scoped to your organization. Use separate spaces per app, user cohort, or agent. Spaces are tenant-isolated: API keys only access spaces your account is a member of.

Create spaces in the dashboard or via POST /v1/spaces. Every retain, recall, and reflect call requires a space_id.

Integration options

  • Python SDK: direct control over retain, recall, and reflect. Best for custom agents and backends.
  • LiteLLM callback: two-line setup; memories are retrieved before each LLM call and stored after responses.
  • MCP: give coding agents (Claude Code, Cursor) native remember / recall tools without writing integration code.
  • Manual injection: call search, build your own system prompt, use any LLM provider.

Authentication

All API requests use a Bearer token. Create keys in the dashboard. Keys are shown once at creation : store them securely.

Authorization: Bearer anona_live_…

Base URL

Production API: http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com

When self-hosting locally, point the SDK at your gateway (typically http://localhost:3001). The dashboard quickstart auto-fills your org's credentials when you are logged in.

New to Anona? Create a free account, generate an API key, and follow the step-by-step quickstart below.

Create account →

Quickstart

Add persistent memory to your AI agent in about five minutes.

Already signed in? The dashboard quickstart pre-fills your API key and space ID from your account.
1

Install the SDK

Install from the public SDK repository. PyPI publishing is coming soon.

bash
pip install "git+https://github.com/anonalabs/Anona-Memory-SDK.git"

For automatic LiteLLM injection, also install pip install litellm.

2

Get your API key and space ID

Sign up (free tier available), then:

  1. Create an API key on the API Keys page.
  2. Create a memory space on the Memory Spaces page.
API Keyanona_live_YOUR_KEY
Space IDyour-space-id
Base URLhttp://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com
3

Add memory to your LLM calls

Option A: LiteLLM callback (recommended). Two lines: every LLM call automatically recalls relevant memories and stores the exchange afterward.

python
import litellm
from anona.integrations.litellm import AnonaMemory

mem = AnonaMemory(
    api_key="anona_live_YOUR_KEY",
    space_id="your-space-id",
    base_url="http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com",
)
mem.enable()  # registers callback with litellm

response = litellm.completion(
    model="gemini/gemini-2.5-flash",
    messages=[{"role": "user", "content": "What should I focus on today?"}],
)
print(response.choices[0].message.content)

Option B: Direct SDK: full control over what you store and when you recall.

python
from anona import AnonaClient

client = AnonaClient(
    api_key="anona_live_YOUR_KEY",
    base_url="http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com",
)

# Retain: store a memory
client.add_memory(
    space_id="your-space-id",
    content="User prefers concise Python answers.",
)

# Recall: semantic search
results = client.search(
    space_id="your-space-id",
    query="what does the user prefer?",
    limit=5,
)
for r in results:
    print(r["content"])

# Reflect: synthesize insights
summary = client.insights(
    space_id="your-space-id",
    query="Summarise what you know about this user",
)
print(summary)

client.close()
4

Manual injection (any LLM / framework)

Not using LiteLLM? Retrieve memories yourself and inject them before calling any LLM provider.

python
from anona import AnonaClient

client = AnonaClient(api_key="anona_live_YOUR_KEY", base_url="http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com")

user_message = "What should I work on today?"

memories = client.search(space_id="your-space-id", query=user_message, limit=5)
memory_block = "\n".join(f"{i+1}. {r['content']}" for i, r in enumerate(memories))

messages = []
if memory_block:
    messages.append({
        "role": "system",
        "content": f"# Relevant Memories\n{memory_block}",
    })
messages.append({"role": "user", "content": user_message})

# Send to OpenAI, Anthropic, Gemini, etc.
# response = your_llm_client.chat(messages)

# Optionally retain the exchange
# client.add_memory(space_id="your-space-id", content=f"User: {user_message}\nAssistant: {response}")

What's next


REST API

Customer-facing HTTP API for memory operations. All endpoints require Bearer authentication and are billed per operation against your plan quota.

Base URL: http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com
Version: v1

Authentication

Include your API key on every request:

http
Authorization: Bearer anona_live_YOUR_KEY
PrefixEnvironment
anona_live_*Production: counts against quota
anona_test_*Sandbox: safe for development

Errors

Errors return a consistent JSON shape:

json
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "You have exceeded the rate limit. Retry after 30 seconds."
  }
}
CodeHTTPDescription
UNAUTHORIZED401Missing or invalid API key
FORBIDDEN403Key cannot access this space
NOT_FOUND404Resource does not exist
QUOTA_EXCEEDED402Plan quota exhausted
RATE_LIMITED429Too many requests: check Retry-After
INVALID_REQUEST422Validation failed

Rate limits

Every response includes rate-limit headers:

  • X-RateLimit-Limit: max requests per window
  • X-RateLimit-Remaining: requests left
  • X-RateLimit-Reset: window reset (Unix timestamp)

Memories & spaces

GET/v1/spaces/

List memory spaces accessible to your API key.

bash
curl -s http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/v1/spaces/ \
  -H "Authorization: Bearer anona_live_YOUR_KEY"
POST/v1/spaces

Create a new memory space.

json
{
  "name": "my-agent",
  "description": "Production agent memory"
}
POST/v1/memories

Retain: store a memory. Anona extracts entities and indexes content for semantic recall.

bash
curl -s -X POST http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/v1/memories \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "space_id": "your-space-id",
    "content": "User prefers Python and morning standups.",
    "metadata": { "source": "onboarding" }
  }'

Returns 201 Created with memory_id.

POST/v1/insights

Reflect: synthesize insights from the entity graph and memories in a space.

bash
curl -s -X POST http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/v1/insights \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "space_id": "your-space-id",
    "query": "What do we know about this project?"
  }'
GET/v1/spaces/{space_id}/memories

List memories in a space (paginated).

DELETE/v1/spaces/{space_id}/memories/{memory_id}

Delete a single memory. Returns 204 No Content.

GET/v1/spaces/{space_id}

Get a single space's metadata.

DELETE/v1/spaces/{space_id}

Permanently delete a space and all its memories. Irreversible.

POST/v1/chat/completions

OpenAI-compatible chat completions with memory auto-injected: recalls relevant memories before the call and retains the exchange after, without a separate LiteLLM callback.

bash
curl -s -X POST http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/v1/chat/completions \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini/gemini-2.5-flash",
    "space_id": "your-space-id",
    "messages": [{"role": "user", "content": "What should I focus on today?"}]
  }'

Space members

Spaces with no member rows are treated as org-wide (any member of your org can access them). Adding a member row switches the space to enforced, invite-only access.

GET/v1/spaces/{space_id}/members

List members with access to a space.

POST/v1/spaces/{space_id}/members

Add an org member to a space.

json
{
  "member_id": "mem_..."
}
DELETE/v1/spaces/{space_id}/members/{target_member_id}

Remove a member's access to a space.

Organization members

GET/v1/members/me

Get the member record for the authenticated caller.

GET/v1/members

List all members of your organization.

POST/v1/members/invite

Invite a new member to your organization by email.

json
{
  "email": "teammate@company.com",
  "role": "member"
}
DELETE/v1/members/{member_id}

Remove a member from your organization.

Organization & projects

GET/v1/orgs/me

Get your organization's profile, plan, and settings.

GET/v1/projects

List projects in your organization.

POST/v1/projects

Create a project.

json
{
  "name": "production"
}

API keys

GET/v1/api-keys

List API keys for your organization. Secrets are never returned after creation.

POST/v1/api-keys

Create a new API key. The full secret is returned once, in this response only : store it immediately.

DELETE/v1/api-keys/{key_id}

Revoke an API key. Takes effect immediately.

Usage & billing

GET/v1/usage

Summary of operations and credits consumed against your plan quota.

GET/v1/usage/breakdown

Usage broken down by operation type and time bucket.

GET/v1/billing

Current plan, quota limits, and billing status.

POST/v1/billing/upgrade

Change plan tier directly (non-Stripe-checkout upgrade path).

POST/v1/billing/checkout

Create a Stripe Checkout session for subscribing to a paid plan.

POST/v1/billing/portal

Create a Stripe Billing Portal session for managing payment methods and invoices.

POST/v1/billing/cancel

Cancel your subscription at the end of the current billing period.

Python SDK

The SDK wraps these endpoints (see quickstart for install and usage). Method mapping:

SDK methodAPI
add_memory()POST /v1/memories
search()POST /v1/search
insights()POST /v1/insights
list_spaces()GET /v1/spaces/

MCP Integration

Give Claude Desktop, Claude Code, or Cursor direct access to your memory spaces via the Model Context Protocol.

Logged into the dashboard? The MCP setup page lets you paste your API key and copies ready-to-use config snippets.

Tools

The Anona MCP server exposes four tools:

ToolArgumentsDescription
remembercontent, space_idStore a fact for future sessions.
recallquery, space_id, limit?Search memories relevant to a question.
list_spaces-List memory spaces this key can access.
get_insightsquery, space_idSynthesize what the space knows about a topic.

Tool errors (denied space, quota exceeded) return as MCP isError content, not HTTP errors: so the transport stays intact.

1

Get an API key

Create a key on the API Keys page. Keys are scoped to your organization and can only access spaces you are a member of.

2

Choose hosted or local

Hosted (recommended)

Point your MCP client at http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/mcp. No local install: works with HTTP-capable clients. Authenticate with your Bearer API key.

json
{
  "mcpServers": {
    "anona": {
      "url": "http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/mcp",
      "headers": {
        "Authorization": "Bearer anona_live_YOUR_KEY"
      }
    }
  }
}

Claude Desktop: add to claude_desktop_config.json and restart. Cursor: add to ~/.cursor/mcp.json and reload.

Local (stdio)

Run the MCP server on your machine via uvx. Useful when your client only supports stdio transport.

json
{
  "mcpServers": {
    "anona": {
      "command": "uvx",
      "args": ["--from", "anona[mcp] @ git+https://github.com/anonalabs/Anona-Memory-SDK.git", "anona-mcp"],
      "env": {
        "ANONA_API_KEY": "anona_live_YOUR_KEY",
        "ANONA_SPACE_ID": "your-space-id"
      }
    }
  }
}
3

Verify it works

MCP tools load at session start: restart your client after adding the server. Then ask your agent to remember something, or call the API directly:

bash
curl -s http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/mcp \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "remember",
      "arguments": {
        "content": "User ships on Fridays.",
        "space_id": "your-space-id"
      }
    }
  }'

Protocol details

  • Transport: Streamable HTTP, stateless JSON mode at POST /mcp
  • Auth: Authorization: Bearer anona_live_…
  • Billing: each tool call counts as an API operation against your plan

OAuth 2.1 (beta)

As an alternative to a static Bearer key, the gateway supports full OAuth 2.1 with PKCE for MCP clients that discover and authorize dynamically. Currently opt-in server-side and off by default: use the API key flow above unless your deployment has this enabled.

StepEndpoint
DiscoveryGET /.well-known/oauth-protected-resource
DiscoveryGET /.well-known/oauth-authorization-server
Dynamic client registrationPOST /oauth/register
Login + consent (PKCE)GET / POST /oauth/authorize
Token exchange (code or refresh)POST /oauth/token
RevokePOST /oauth/revoke
List connected appsGET /v1/oauth/connections
Disconnect an appDELETE /v1/oauth/connections/{client_id}

Access tokens are short-lived signed JWTs; authorization codes and refresh tokens are stored hashed. Refresh tokens rotate on use.

Questions or integration help? Email support@anonalabs.com.

Create account →