Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xysq.ai/llms.txt

Use this file to discover all available pages before exploring further.

The xysq Python SDK gives you direct API access to your memory and knowledge vaults — no MCP server required. Capture memories, surface relevant context, index knowledge sources, and build agents that remember across sessions.

Installation

pip install git+https://github.com/xysq-ai/sdk_python_xysq.git
Install optional extras for LiteLLM or Anthropic integrations:
pip install 'xysq[agent] @ git+https://github.com/xysq-ai/sdk_python_xysq.git'
pip install 'xysq[claude] @ git+https://github.com/xysq-ai/sdk_python_xysq.git'
pip install 'xysq[all] @ git+https://github.com/xysq-ai/sdk_python_xysq.git'
Requires Python 3.11+

Get an API key

Get your API key at app.xysq.ai/connect. It starts with xysq_. Add it to a .env file in your project:
XYSQ_API_KEY=xysq_...
Or pass it directly when constructing the client:
from xysq import Xysq

client = Xysq(api_key="xysq_...")

Your first memory

from dotenv import load_dotenv
from xysq import Xysq

load_dotenv()

with Xysq() as client:
    # Store a memory
    client.memory.capture(
        content="User prefers type hints in all Python code",
        tags=["coding-style", "python"],
    )

    # Retrieve relevant memories
    memories = client.memory.surface("Python coding preferences")
    for m in memories:
        print(m.text)

    # Ask a question answered from memory
    result = client.memory.synthesize("What are the user's coding preferences?")
    print(result.answer)

Core concepts

The SDK exposes two namespaces on every client:
NamespacePurpose
client.memoryEpisodic memory — captures, recalls, and synthesis
client.knowledgeStructural knowledge — indexed sources (links, code, quotes)
The three core memory operations:
MethodWhat it does
capture(content)Store a memory permanently
surface(query)Retrieve the most relevant memories for a query
synthesize(query)Answer a natural language question from your memory bank
Once knowledge sources are indexed, they are automatically included in memory.surface() and memory.synthesize() results.

Source code

The SDK is open source on GitHub: xysq-ai/sdk_python_xysq Includes examples, community contributions, and the full source. Issues and PRs welcome.

What to explore next

Memory operations

Full reference for capture, surface, synthesize, list, delete, and status

Knowledge Base

Index links, code snippets, and quotes into your persistent knowledge base

Team Vaults

Share memory and knowledge across your entire team

XysqAgent & Integrations

Memory-aware agent wrapper with configurable context strategies and tool calling