XysqAgent— a turn-based wrapper that handles memory retrieval and capture automatically on everychat()call- Tool calling integrations — expose xysq operations as LLM tools (function-calling), letting the model decide when to capture and recall
XysqAgent
XysqAgent wraps any LiteLLM-compatible model. On every chat() call it:
- Runs the configured context strategy to fetch relevant memories
- Injects retrieved context into the system prompt
- Calls the LLM
- Optionally captures the exchange
XysqAgent in a new session will have access to everything captured by previous sessions.
Context strategies
A context strategy controls what memory context is injected into each turn’s system prompt.Custom strategy
Implement theContextStrategy protocol — any callable with this signature:
XysqAgent parameters
Tool calling integrations
Tool calling lets the LLM decide when to invoke memory operations — you pass the tool definitions to your LLM call, execute any tool calls the model returns, and feed results back.LiteLLM
Anthropic
Available tools
Both integrations expose the same five tools to the LLM:
To file an external source (link, quote, code snippet), the model calls
xysq_capture with source tags, the same as any other memory.
Examples
Related
Memory operations
Full reference for capture, surface, and synthesize
Team Vaults
Scope agent memory to a shared team vault