Context7
Up-to-date docs for AI agents
作者提供的说明(英文原文)
Local-first AI memory engine — 4-tier memory, people graph, Bayesian beliefs. Encrypted, 62µs.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"cortex": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/gambletan/cortex:v1.8.0"
]
}
}
}在终端中运行这条命令
claude mcp add cortex -- docker run -i --rm ghcr.io/gambletan/cortex:v1.8.0粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"cortex": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/gambletan/cortex:v1.8.0"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"cortex": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/gambletan/cortex:v1.8.0"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日
注册名称已通过 GitHub 账户 gambletan 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(1.8.0)于8个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Docker。
同一分类中有:Context7, Codebase Memory, Exa
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
[🧠 Try Cortex in your browser](https://gambletan.github.io/cortex/) — zero install, 124KB WASM, runs entirely client-side.
If Cortex helps your AI remember, [give it a ⭐](https://github.com/gambletan/cortex/stargazers) — it takes 1 second and helps others discover the project.
中文 | 日本語 | 한국어
_Private. Free. Local. — a memory engine for personal AI agents._
Your AI's memory archive lives on your device. Pure Rust. 3.8MB binary. The local engine needs no hosted service and collects zero telemetry. Optional encrypted sync uses your own cloud storage; optional Muse sharing sends only the excerpts you approve to Cortex Cloud and Meta. (On-device semantic search downloads a ~30MB model once on first use, then runs fully offline — or go 100% offline with CORTEX_NO_EMBEDDINGS=1. See Security & Privacy.)
What you get
https://cortex.alvinsclub.ai serves only your approved export, with daily disclosure limits and revocation. The server and Meta can read shared excerpts. Setup and privacy limits →See it remember across sessions — ~30 seconds:
brew install gambletan/tap/cortex-mcp-server # or: cargo build --release -p cortex-mcp-server
claude mcp add cortex-memory -- cortex-mcp-server ~/.cortex/memory.db
Tell Claude *"remember I deploy on Fly.io and always run tests before pushing."* Open a brand-new session and ask *"how do I deploy this project?"* — it answers from memory, 100% on your machine.
⭐ If that's useful, [give it a star](https://github.com/gambletan/cortex/stargazers) — it helps others find a memory engine that respects their privacy.
LLMs start blank every session — they forget your name, your preferences, yesterday's conversation, last week's decision. The usual fixes are flat text files (no ranking, no decay), keyword grep, or cloud APIs that add 200–500ms, charge you, and ship your personal data to someone else's server. Cortex gives your AI structured, self-evolving long-term memory that persists across sessions and channels — all local, all yours. Your memories are not a cloud provider's training data, a startup's monetization asset, or a surveillance target.
| Cortex | Mem0 | OpenAI Memory | |
|---|---|---|---|
| Privacy | Local archive; optional Muse export to cloud | Cloud API (your data on their servers) | OpenAI servers |
| Latency | 156µs ingest, 568µs search | ~200-500ms | ~300-800ms |
| Cost | Free, forever | $99+/mo (Pro) | ChatGPT Plus ($20/mo) |
| Memory tiers | 4 (Working/Episodic/Semantic/Procedural) | 1 (flat) | 1 (flat) |
| Bayesian beliefs | Self-correcting with evidence | No | No |
| People graph | Cross-channel identity resolution | Paid tier only | No |
| Conversation compression | Automatic session summarization | No | No |
| Relationship inference | Pattern-based (EN + CN) | No | No |
| Temporal retrieval | Intent-aware ("recently" / "first time") | No | No |
| Contradiction detection | Automatic with confidence scores | No | No |
| Consolidation | Episodic → Semantic auto-promotion | No | No |
| Context injection | Token-budgeted LLM-ready output | Manual | Automatic but opaque |
| Import/Export | Full JSON backup & restore | API only | No export |
| Self-hosted | Native binary, Docker, MCP | Cloud only | Cloud only |
| Binary size | 3.8 MB | npm package | N/A |
| Dependencies | 0 runtime services (single binary) | Node.js + cloud | N/A |
| Open source | MIT | Partial | No |
| Encryption | AES-256-GCM encrypted sync (opt-in) | No | No |
| Key rotation | Versioned envelopes, forward secrecy | No | No |
| Privacy levels | Private (default, never syncs) / Shared / Public — per-memory opt-in, demote retracts from other devices | No | No |
| Tool authorization | Deny-by-default capability policy on the MCP surface | No | No |
| Zero telemetry | No analytics, no phone-home, verifiable | Unknown | No |
| Cost | Free forever, unlimited | $99+/mo (Pro) | $20/mo (Plus) |
| Chinese NLP | Native (inference, retrieval, relationships) | No | Limited |
| Namespace isolation | Per-user/context memory separation | No | No |
| Plugin system | Compile-time hooks for ingest/retrieve/consolidation | No | No |
| MCP tools | 30 tools for Claude/LLM integration | 3rd party | N/A |
| Operation | Cortex | Mem0 (cloud) | File-based |
|---|---|---|---|
| Ingest | 156µs | ~200ms | ~1ms |
| Search (top-10) | 568µs | ~300ms | ~10ms |
| Context generation | 621µs | ~500ms | manual |
| Belief update | 66µs | N/A | N/A |
| People graph | 51µs | paid tier | N/A |
| Structured facts | 45µs | N/A | N/A |
| 1K memories search | 1.6ms | ~500ms | ~50ms |
528x faster than Mem0 cloud. With features neither Mem0 nor OpenAI Memory offer.
Note: Benchmarks include proactive inference (auto-extracting facts, preferences, relationships) on every ingest. Raw ingest without inference is ~15µs. Numbers from
cargo benchon M-series Mac.
Academic-grade long-term conversation memory evaluation — 10 conversations, 1540 QA pairs across 4 categories.
| System | Single-hop | Multi-hop | Open-domain | Temporal | Overall |
|---|---|---|---|---|---|
| Backboard | 89.4% | 75.0% | 91.2% | 91.9% | 90.0% |
| MemMachine v0.2 | — | — | — | — | 84.9% |
| Cortex | 72.5% | 59.5% | 88.8% | 74.1% | 73.7% |
| Mem0-Graph | 65.7% | 47.2% | 75.7% | 58.1% | 68.4% |
| Mem0 | 67.1% | 51.2% | 72.9% | 55.5% | 66.9% |
| OpenAI Memory | — | — | — | — | 52.9% |
Key findings:
Cortex outperforms Mem0 on all 4 categories — while running 100% locally, end-to-end encrypted, at $0 cost.
Setup: Claude Sonnet 4 (QA + judge), nomic-embed-text (embeddings via Ollama), top-30 retrieval. Reproducible with that setup:
python3 bench/locomo_bench.py(needsANTHROPIC_API_KEY+ a local Ollama withnomic-embed-text). Numbers measured on the v1.7 engine; the v2.2 retrieval beam fix (paraphrase recall 40%→90% at 5K, seedocs/scale-test-2026-06-13.md) has not yet been re-run on LoCoMo, so these are reported as the last verified figures, not a v2.2 claim.
Cortex implements a 4-tier memory model inspired by human cognition:
+---------------------+
| Working Memory | Current session context +---------------------+ | +---------------------+ | Episodic Memory | Raw experiences: conversations, events, observations +---------------------+ | consolidation (decay, promotion, pattern extraction) +---------------------+ | Semantic Memory | Distilled facts, preferences, relationships +---------------------+ | +---------------------+ | Procedural Memory | Learned routines, user-specific workflows +---------------------+
Working holds the current session scratch pad. Episodic stores raw experiences with timestamps and source metadata. The Consolidation Engine periodically promotes recurring patterns into Semantic facts and decays stale episodes. Procedural captures learned workflows and routines.
For a hosted Bot with existing PostgreSQL memory and account permissions, Cortex is an optional derived retrieval backend behind its MemoryManager. PostgreSQL remains the authority for confirmed values, scope, provenance, revisions and withdrawal; ContextProjector remains the single model-context composer, and Workflow keeps execution and approvals. Search hits must pass current authoritative validation before entering model context. A controlled projection store must not import personal archives or enable sync, automatic inference or consolidation by default.
The controlled API contract documents the implemented ControlledStore Python interface, snapshot/replay lifecycle and error codes. The implementation plan separates Cortex-side acceptance from host-owned PostgreSQL and Bot integration. Package publication and Bot deployment are separate steps; existing personal-agent interfaces remain available.
Cross-channel identity resolution. The same person messaging you on Telegram, emailing you, and showing up in calendar events gets unified into a single identity node. Interactions, relationship strength, and communication patterns are tracked per-person.
Self-correcting understanding of the world. Beliefs are formed from evidence, updated with each new observation, and can be contradicted. Confidence scores reflect actual certainty rather than recency bias.
cortex.observe_belief("user_prefers_morning_meetings", true, 0.8)?;
cortex.observe_belief("user_prefers_morning_meetings", false, 0.6)?; // Confidence adjusts automatically via Bayesian update
Episodic-to-semantic promotion, decay of stale memories, and pattern extraction. Runs as a background cycle that keeps the memory store lean and queryable. Returns a report of what was promoted, decayed, and merged.
Queries combine five signals for relevance ranking:
Generates LLM-ready context strings from memory state. Pass a token budget, optional channel/person filters, and get back a structured text block your LLM can consume directly.
SQLite for persistence, in-memory vector index for fast similarity search. Single-file database, no external services required. Designed for edge deployment -- runs on a laptop, a R
只显示了开头部分;其余内容请在仓库中阅读