mcpField
V
Vayl

Vayl

Local
vayl.gitbook.ioMemory & Knowledge2Updated 1w ago

About Vayl

Vayl is a memory layer for AI agents that reconciles changing facts instead of treating every stored value as current. It keeps an audit history and can require human approval for sensitive changes, with local SQLite storage by default.

Key features

  1. 01Reconciles updated and retracted facts
  2. 02Retains history with an audit chain
  3. 03Approval queue for designated changes
  4. 04Action checks for disputed or stale facts
  5. 05SQLite by default; Postgres for teams

Use cases

  1. 01Keep customer account status current
  2. 02Require confirmation for medication changes
  3. 03Check facts before an agent takes action

MCP support

Vayl runs as an MCP server that MCP clients can connect to for memory tools. For shared team memory, vayl-server can be called over MCP or REST.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"ac12644-vayl": {
"command": "uvx",
"args": [
"vayl-mcp"
],
"env": {
"OPENAI_API_KEY": "<OPENAI_API_KEY>",
"VAYL_DB": "<VAYL_DB>"
}
}
}
}
Run commanduvx vayl-mcp
Environment variables to set
OPENAI_API_KEYSecretOpenAI key for extraction and embeddings. Leave unset to use a local Ollama model.
VAYL_DBAbsolute path of the SQLite memory database.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypivayl-mcp0.10.0

Tools

32

Saved tool list · updated 1w ago

ParameterTypeRequiredDescription
textstringYes
run_idstringNo
sourcestringNo
user_idstringNo
agent_idstringNo
metadataanyNo

Details

From the project README

Vayl

The reconciling memory layer for AI agents.

PyPI Python License OpenSSF Scorecard Docs

When a fact changes, most agent memory keeps both versions and lets the model guess which is current. Vayl replaces the old value, keeps it in history, and can hold high-stakes changes until a person approves them. It runs locally on SQLite and works with any MCP client: Claude Code, Cursor, Claude Desktop, or your own agent.

A real run with a fictional patient: warfarin is recorded, then replaced by apixaban. The change waits in pending_changes until a clinician confirms it. Recall then answers apixaban now, warfarin before, and refuses amoxicillin because of the recorded penicillin allergy.

A real run with gpt-6-luna and the clinical preset. The patient is fictional. Script: assets/demo/clinical_demo.py

Features

  • Reconciles changes. A new value supersedes the old one, and "we stopped X" retracts X. A retired fact is never returned as current.
  • Keeps history. Ask what is true now or what was true before. Every change goes on a signed, tamper-evident audit chain.
  • Human approval where it matters. Mark slots such as medications as confirm-required, and changes wait in a queue. check_before_act blocks an action that depends on a disputed, stale or just-changed fact.
  • Small and local. SQLite by default, Postgres for teams. One model call to store a fact and one to answer. Any OpenAI-compatible model, Anthropic, Groq or a local Ollama model.
  • Built-in presets for clinical, support, finance, sales, coding and assistant memory.

Install

pip install vayl-mcp

Add it to Claude Code:

claude mcp add vayl -e LLM_PROVIDER=openai -e OPENAI_API_KEY=sk-... -e VAYL_DB=$HOME/.vayl/vayl.db -- vayl-mcp

For Cursor, Claude Desktop and other clients, see the quickstart. Run vayl-demo to try reconciliation with no API key.

Use it from code

from vayl import Vayl

with Vayl(user_id="cust_5521") as m:
    m.remember("Acme's invoice bounced. Account suspended until payment clears.")
    print(m.recall("Is Acme's account in good standing?"))
    # No. Acme's account is suspended until payment clears.

Integrations

Agent frameworks. Backends plug into the framework's own memory, so facts are stored and recalled on every turn. Tool adapters give the agent memory tools to call.

FrameworkInstallUse
Google ADKpip install 'vayl-mcp[adk]'from vayl.integrations.adk import VaylMemoryService (memory backend)
LlamaIndexpip install 'vayl-mcp[llamaindex]'from vayl.integrations.llamaindex import VaylMemory (memory block)
AutoGenpip install 'vayl-mcp[autogen]'from vayl.integrations.autogen import VaylMemory (memory backend)
LangGraph / LangChainpip install 'vayl-mcp[langgraph]'from vayl.integrations.langgraph import VaylMemory (tools)
OpenAI Agents SDKpip install 'vayl-mcp[openai-agents]'from vayl.integrations.openai_agents import VaylMemory (tools)
CrewAIpip install 'vayl-mcp[crewai]'from vayl.integrations.crewai import VaylMemory (tools)
Pydantic AIpip install vayl-mcp 'pydantic-ai-slim[openai,mcp]'MCPToolset over MCP, no adapter
Agnopip install vayl-mcp agno openaiMCPTools over MCP, no adapter
Vercel AI SDKnpm i @vayl.dev/client ai zodimport { vaylTools } from "@vayl.dev/client/vercel"
Mastranpm i @vayl.dev/client @mastra/core zodimport { vaylTools } from "@vayl.dev/client/mastra"

Examples for each are in Agent frameworks.

MCP clients. Install vayl-mcp, then add it to your client: Claude Code · Cursor · VS Code · Windsurf · Zed · Cline · Continue · Codex CLI · Gemini CLI. For a shared team memory, run vayl-server and call it over MCP or REST.

Documentation

QuickstartInstall and connect a client
How Vayl worksExtraction, reconciliation and retrieval
Tutorial: a hospital medication assistantClinical preset, critical facts and approval
Tutorial: a customer-support assistantAccount state and safety checks
MCP toolsAll 30+ tools
Deploying vayl-serverTeam server, auth, Docker, Postgres
BenchmarksStale-value and retraction results against Mem0 and Graphiti

Contributing

See CONTRIBUTING.md. The unit tests run offline, with no API key. Good starting points are labeled good first issue.

Security

Data is encrypted at rest by default, and Vayl sends nothing anywhere except to the model endpoints you configure. Vayl is not certified for clinical use and has not been audited by a third party. Report vulnerabilities as described in SECURITY.md.

License

Apache-2.0

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.