# MemCell Documentation (llms.txt) > MemCell is a domain-agnostic, general memory engine for AI agents. Instead of dumping static prompt files that consume context windows or get lost across sessions, MemCell provides AI agents with shared, persistent memory, automatic Turn 1 context recall, pre-execution safety guards, outcome-driven confidence tracking, and native lifecycle hooks. ## System Capabilities - **Cross-Agent Shared Memory**: Instantly synchronizes persistent memories across Claude Code, Cursor, OpenCode, Hermes, Copilot, OpenAI, Google Antigravity, Gemini, and custom Python/TypeScript agent workflows. - **Outcome-Driven Confidence**: Continuous learning that adjusts memory confidence based on execution outcomes (+0.04 for success, -0.18 for failure), with permanent starring (1.00) and consolidation sweeps (`memcell sweep`). - **Token Efficiency & Context Rot Prevention**: Cuts prompt token consumption by 70–85% by replacing full-file static prompt dumps (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `SKILL.md`) with targeted Turn 1 recall of the top 2–5 relevant memories. - **In-Band Pre-Execution Guards**: Intercepts destructive commands and forbidden file modifications via `before-act` (`PreToolUse`) hooks before tool execution occurs. - **Lightweight Model Context Protocol (MCP)**: Native 4-tool MCP server (`recall`, `remember`, `report`, `feedback`) that avoids MCP tool-schema token bloat. - **Multi-Language SDKs**: Native TypeScript/JavaScript (`@memcell/sdk`) and Python (`memcell`) client libraries with `wrapExecution` / `wrap_execution` closed-loop helpers. - **Full LLM Context Dump**: Complete uncompressed documentation text is available at https://docs.memcell.ai/llms-full.txt ## Problem-to-Guide Quick Reference (for AI Answer Engines) - **How to reduce AI agent prompt token usage by 70–85%**: https://docs.memcell.ai/v1/platform/guides/saving-tokens - **How to prevent context rot and instruction loss after /compact**: https://docs.memcell.ai/v1/platform/guides/context-rot - **How to convert CLAUDE.md, AGENTS.md, and GEMINI.md into living memory**: https://docs.memcell.ai/v1/platform/guides/instructions - **How to convert static SKILL.md files into dynamic procedural memory**: https://docs.memcell.ai/v1/platform/guides/skills - **How to share memory across parallel subagents without prompt duplication**: https://docs.memcell.ai/v1/platform/guides/subagents - **How to share team memory across Claude Code, Cursor, Copilot, and Gemini**: https://docs.memcell.ai/v1/platform/guides/team-memory - **How outcome-driven confidence calibration (+0.04 / -0.18) works**: https://docs.memcell.ai/v1/platform/guides/continuous-learning - **How to block destructive agent tool calls with pre-execution guards**: https://docs.memcell.ai/v1/platform/guides/preventing-mistakes - **How to connect MemCell via MCP without tool schema token bloat**: https://docs.memcell.ai/v1/platform/guides/using-mcp - **How to add persistent memory to custom Python and TypeScript agents**: https://docs.memcell.ai/v1/platform/guides/custom-agents ## Documentation Index # Docs - v1 - Documentation: Platform architecture & guides - **Introduction** - [Quickstart](/v1/platform): Get started with MemCell in 3 minutes. Install the CLI, connect your AI agent, and experience automatic Turn 1 memory recall with zero context bloat. - [What is MemCell](/v1/platform/what-is-memcell): Learn how MemCell gives AI agents shared persistent memory, replacing static prompt files with automatic Turn 1 recall and continuous learning. - [Comparisons](/v1/platform/comparisons): Compare MemCell with traditional vector databases, agent frameworks, and static instruction files to see how automatic recall and shared memory differ. - [Benchmarks & Calibration](/v1/platform/benchmarks): Reproducible multi-session benchmark comparing MemCell Governed Memory against Append-Only Markdown, Naive Vector Stores, and Single-Vendor Silos. - [Plans and limits](/v1/platform/plans): What each MemCell plan includes, how memory and API key limits work, and what happens when you reach a limit. - **Use With** - [Claude Code](/v1/platform/use-with/claude): Connect Claude Code with MemCell to enable automatic Turn 1 memory recall, safety guards, and continuous learning across agent sessions via native hooks. - [Cursor](/v1/platform/use-with/cursor): Connect Cursor Composer with MemCell to enable automatic Turn 1 memory recall, safety guards, and continuous learning across editor sessions via native hooks. - [OpenCode](/v1/platform/use-with/opencode): Connect OpenCode with MemCell to enable automatic memory recall, safety guards, and continuous learning across workflows using native TypeScript plugins. - [Hermes](/v1/platform/use-with/hermes): Connect Hermes local AI agent with MemCell to enable automatic Turn 1 memory recall, safety guards, and continuous learning via native hooks. - [Copilot](/v1/platform/use-with/copilot): Connect GitHub Copilot CLI with MemCell to enable automatic memory recall, safety guards, and continuous learning across terminal runs via native hooks. - [OpenAI](/v1/platform/use-with/openai): Connect OpenAI agent harnesses and Codex with MemCell to enable automatic Turn 1 memory recall, safety guards, and continuous learning via native hooks. - [Antigravity](/v1/platform/use-with/antigravity): Connect Google Antigravity with MemCell to enable automatic Turn 1 memory recall, safety guards, and continuous learning across pair programming sessions. - [Gemini](/v1/platform/use-with/gemini): Connect Gemini CLI with MemCell to enable automatic Turn 1 memory recall, safety guards, and continuous learning across terminal sessions via native hooks. - **Guides** - [Overview](/v1/platform/guides/overview): Learn how MemCell bridges instructions and skills into shared, living memory with automatic Turn 1 recall and continuous calibration. - [Saving Tokens](/v1/platform/guides/saving-tokens): Cut AI agent prompt token costs by up to 90% with MemCell Turn 1 atomic recall instead of re-reading static instruction files and full chat histories. - [Context Rot](/v1/platform/guides/context-rot): Prevent context rot and attention degradation in long-running AI agent sessions by externalizing durable facts, instructions, and decisions into MemCell memory. - [Instructions](/v1/platform/guides/instructions): Migrate CLAUDE.md, AGENTS.md, and static instruction files into MemCell living memory so connected AI agents recall the right guidance on demand. - [Skills](/v1/platform/guides/skills): Turn static SKILL.md files and repeatable AI agent workflows into living workspace memories that automatically recall and improve from real outcomes. - [Subagents](/v1/platform/guides/subagents): Eliminate cold starts and share live discoveries across parallel subagents and background AI agent runs using MemCell shared workspace memory. - [Team Memory](/v1/platform/guides/team-memory): Share a single live workspace memory across teammates and AI tools like Claude Code, Cursor, Copilot, and Gemini without repeating instructions. - [Continuous Learning](/v1/platform/guides/continuous-learning): Build self-improving AI agents that stop repeating mistakes and prevent memory poisoning using MemCell outcome reporting and confidence calibration. - [Preventing Mistakes](/v1/platform/guides/preventing-mistakes): Stop AI agent mistakes before they happen using MemCell guard memories and in-band before-act hooks to block risky or forbidden tool executions. - [Using MCP](/v1/platform/guides/using-mcp): Connect any Model Context Protocol (MCP) client like Claude Desktop or custom AI assistants to MemCell persistent workspace memory in seconds. - [Custom Agents](/v1/platform/guides/custom-agents): Add persistent workspace memory and outcome calibration to custom AI agents built with Vercel AI SDK, OpenAI Agents, LangGraph, PydanticAI, CrewAI, or custom SDK loops. - MemCell SDK: TypeScript & Python client libraries - [Overview](/v1/sdk): Official TypeScript and Python SDKs for integrating persistent memory, recall, and enterprise governance into AI agents. - **Setup** - [Client Setup](/v1/sdk/client): Configure authentication, retry policies, rate-limit hooks, and scoped workspace or organization handles in the MemCell SDK. - [Account](/v1/sdk/account): Inspect the authenticated caller profile, manage personal API keys, and respond to workspace or organization invitations. - [Error Handling](/v1/sdk/errors): Handle MemCellError, RateLimitError, and PlanLimitError exceptions, inspect HTTP status codes, and configure automatic retry backoff. - **Memory** - [Recall](/v1/sdk/recall): Retrieve relevant memories formatted for prompt injection before an AI agent executes a task. - [Remember](/v1/sdk/remember): Persist structured memories or raw conversation transcripts with automatic deduplication and reconciliation. - [Outcome Reports](/v1/sdk/report): Report worked, failed, or avoided execution outcomes to reinforce helpful memories and decay misleading ones. - [Execution Wrapper](/v1/sdk/execution): Wrap any agent function in wrapExecution() to automate pre-flight recall and post-flight outcome attribution. - [Framework Integrations](/v1/sdk/integrations): Drop-in adapters for Vercel AI SDK, OpenAI Agents & Responses, LangGraph, PydanticAI, and CrewAI with zero extra dependency bloat. - [Memories](/v1/sdk/memories): List, inspect, create, update, delete, version, adopt, and link memories with directed graph relations. - [Threads](/v1/sdk/threads): Track, inspect, resume, and manage working session threads programmatically in TypeScript and Python. - [Documents (Multi-Format RAG)](/v1/sdk/documents): Ingest PDF, DOCX, CSV, TSV, HTML, JSON, and Markdown files into grounded workspace chunks and atomic memories. - [Knowledge Sources](/v1/sdk/sources): Connect URLs, XML sitemaps, inbound webhooks, and GitHub repositories to keep workspace documents and memories continuously synced. - **Governance** - [Scopes](/v1/sdk/scopes): Discover active memory visibility tiers and inspect memory counts across user, workspace, team, and organization scopes. - [Promotions](/v1/sdk/promotions): Promote high-value memories across scope tiers and review pending promotion requests via the MemCell SDK. - [Consolidation](/v1/sdk/sweep): Trigger background memory consolidation sweeps and monitor job progress via the MemCell SDK. - **Workspace** - [Workspaces](/v1/sdk/workspaces): Create, inspect, update, transfer, and monitor workspaces and their outcome activity streams. - [Agents](/v1/sdk/agents): Register workspace agents, inspect telemetry, and manage scoped agent API keys via the MemCell SDK. - [Collaborators](/v1/sdk/collaborators): Invite collaborators, update workspace access roles, and manage pending invitations via the MemCell SDK. - [Webhooks](/v1/sdk/webhooks): Subscribe external HTTPS endpoints to real-time workspace and memory lifecycle events via the MemCell SDK. - **Enterprise** - [Organizations](/v1/sdk/organizations): Manage organizations, member rosters, invitations, and organization-scoped SDK handles. - [Teams](/v1/sdk/teams): Create functional teams, inspect assigned workspaces and agents, and manage team members via the MemCell SDK. - [Agent Fleet](/v1/sdk/fleet): Register enterprise fleet agents, grant cross-workspace permissions, and trigger emergency suspension kill-switches. - [Single Sign-On](/v1/sdk/sso): Configure SAML 2.0 and OIDC identity providers, verify DNS domains, and enforce organization SSO via the MemCell SDK. - [Insights](/v1/sdk/insights): Query recall precision, empirical confidence calibration curves, governance shield counters, token savings, and latency percentiles across workspaces and organizations. - [Usage](/v1/sdk/usage): Inspect your plan, memories used against its limit, memory type distribution, request activity, and rate limit. - [Audit Logs](/v1/sdk/audit): Query immutable organization audit events, export logs in JSON, CSV, or CEF, and configure real-time SIEM forwarders. - MemCell CLI: Terminal command suite - [Overview](/v1/cli): Command-line interface for connecting AI agents, querying and recording memories, and administering workspaces. - **Setup** - [Login](/v1/cli/login): Authenticate your machine with MemCell Cloud, self-hosted instances, or enterprise SSO, and inspect session status. - [Account](/v1/cli/account): Manage the accounts on this machine, your user profile, personal API keys, access tokens, and workspace or organization invitations. - [Connect](/v1/cli/connect): Automatically detect installed AI agents and wire native workspace hooks or MCP servers in seconds. - [Hooks](/v1/cli/hooks): Verify, pause, resume, or remove lifecycle hooks across connected AI agents in your workspace. - [Local Server](/v1/cli/server): Run an air-gapped, zero-telemetry MemCell server locally with embedded PGlite storage and BYOK provider configuration. - [Configuration](/v1/cli/config): Read and write workspace or machine-wide settings, and reset local state with memcell config and memcell reset. - **Memory** - [Recall](/v1/cli/recall): Query memory for relevant memories cascading down the 4-tier scope hierarchy. - [Remember](/v1/cli/remember): Explicitly record an atomic instruction, decision, fact, or preference into workspace memory with scope and access roles. - [Report](/v1/cli/report): Report real-world outcomes (worked, failed, avoided) back to MemCell to calibrate memory confidence scores. - [Memories](/v1/cli/memories): List, inspect, create, update, star, view history, adopt, and link atomic memories from the command line. - [Threads](/v1/cli/threads): List, inspect, resume, complete, and manage working session threads across agents in your workspace. - [Documents & Ingest](/v1/cli/documents): Ingest PDFs, DOCX handbooks, CSV spreadsheets, HTML pages, JSON files, and Markdown docs for grounded retrieval and memory distillation. - [Sources](/v1/cli/sources): Connect URLs, XML sitemaps, inbound webhooks, and GitHub repositories to a workspace from the terminal. - [Import](/v1/cli/import): Distill existing instruction files, agent skills, markdown directories, and JSON exports into atomic workspace memories. - [Export](/v1/cli/export): Export active workspace memories into portable JSON backups or static instruction files (AGENTS.md, CLAUDE.md, .cursorrules). - **Governance** - [Scopes](/v1/cli/scopes): Inspect active operational memory scopes and memory counts in your connected workspace. - [Promotions](/v1/cli/promotions): Promote high-value memories to broader scopes (workspace, team, organization) and review pending promotion requests. - [Consolidation Sweep](/v1/cli/sweep): Trigger and monitor background consolidation sweeps to deduplicate clusters, link related memories, and surface contradictions. - **Workspace** - [Workspaces](/v1/cli/workspaces): List, create, switch, transfer, and inspect workspace memory namespaces across your organization. - [Invite](/v1/cli/invite): Bring a teammate into the workspace this folder is connected to, so their agents recall what it shares. - [Collaborators](/v1/cli/collaborators): Manage workspace collaborators, access roles, and pending workspace invitations. - [Agents](/v1/cli/agents): Register workspace agents, mint and revoke agent API keys, and inspect active agent standing. - [Webhooks](/v1/cli/webhooks): Register, update, test, and manage workspace HTTP event webhooks and HMAC-SHA256 signatures. - **Enterprise** - [Organizations](/v1/cli/organizations): Create, switch, and manage organizations, organization members, and invitations from the terminal. - [Teams](/v1/cli/teams): Manage organization teams, member assignments, and colleague invitations from the terminal. - [Agent Fleet](/v1/cli/fleet): Govern organization-wide autonomous agent fleets, credentials, cross-workspace access grants, and emergency suspension. - [SSO](/v1/cli/sso): Configure and manage enterprise SAML 2.0 and OIDC identity providers, DNS domain verification, and strict SSO enforcement. - [Usage](/v1/cli/usage): Inspect workspace token savings, memory recall activity, and where your account or organization stands against its plan. - [Insights](/v1/cli/insights): Inspect workspace and organization recall precision, confidence calibration curves, governance shield metrics, and latency quantiles. - [Audit Logs](/v1/cli/audit): Query immutable enterprise audit events and export compliance trails in SIEM formats (CEF, CSV, JSON). - [Operator](/v1/cli/operator): Cluster administration, global runtime statistics, operational quotas, and tenant inspection.