Skip to main content
xysq plugs into the loop you already have. You keep your model, your messages, your control flow; xysq is two tools the model can call — pull context before it answers, push context after — bound to one vault. This works with any LiteLLM-compatible model (GPT, Claude, Gemini, Mistral, …) and with the Anthropic SDK directly.

LiteLLM tools

XysqLiteLLMTools gives you OpenAI-compatible tool definitions and an executor. You run the loop; the model decides when to remember and recall.
The model sees two tools: The vault_id is bound when you construct XysqLiteLLMTools — the model decides when to remember and recall, never which vault.

Anthropic SDK

Same idea, in Anthropic tool_use format:

XysqAgent — the batteries-included wrapper

If you don’t want to run the loop yourself, XysqAgent wraps a LiteLLM model. The conversation itself lives in a server-side thread — not in the Python process — so history survives restarts and is shared across instances, and every turn is promoted into the vault’s long-term memory automatically. On each chat() it stores your message, pulls relevant long-term context, rebuilds the window from the server, calls the model, and stores the reply:
recall=False skips the long-term pull, recall_limit caps injected context, history_turns sizes the conversation window (the current message plus up to N−1 prior turns). clear_history() ends the conversation: it flushes to long-term memory first, then resets the working window.

Vaults

The vault API the tools are built on: create, push, pull, delete

Getting started

Install the SDK and push your first vault