Skip to main content

Python SDK

Official Python client for Anona Memory.

Installation

Requires Python 3.9+.

Quick Start


Client Initialization

The client doesn’t read an environment variable automatically - pass api_key explicitly:
Use it as a context manager to ensure connections close cleanly:

Methods

add_memory(space_id, content, metadata=None) -> dict

search(space_id, query, limit=10) -> list[dict]

Returns the results list directly (empty list on no match).

insights(space_id, query) -> str | None

Returns the synthesized answer string, or None.

list_spaces() -> list[dict]


Async Support

Every method has an async_ counterpart backed by a separate httpx.AsyncClient:
Use async with AnonaClient(...) as client: for automatic cleanup.

Error Handling


MCP Server

The SDK also ships an MCP server for connecting Anona Memory to Claude Code, Claude Desktop, and other MCP clients - see the MCP guide for setup and usage.

Next Steps

MCP

Connect to Claude Code and other MCP clients

API Reference

Full REST API documentation