exocortex

exocortex

Provides retrieval and graph tools for agents to search, backlink, and navigate a markdown-based knowledge vault, enabling hybrid search and serendipitous discovery.

Category
访问服务器

README

exocortex

An external cognitive layer: a shared long-term memory for you and your agents, built on a plain-markdown vault you own outright.

Design in one line: markdown in git is the source of truth; the index, hybrid search, graph, agents, and 3D visualization are all derived layers you can delete and rebuild. No lock-in, no black box, no single SaaS to trust.

See docs/ARCHITECTURE.md for the full reasoning. Quickstart below.

Provenance: this is the real system I run daily, extracted as-is — my private vault (a few hundred notes) is swapped for a 4-note demo vault, and personal endpoints are example.com placeholders. Everything else — CLI, MCP server, the bird agents, the gardener, hooks, eval harness — is exactly the code that tends my memory every night.

The fleet — every moving part at a glance

The system is one vault plus a handful of small, single-purpose programs. Nothing here is magic; each one is a script or a hook you can read.

Part What it does When it runs Where it lives
Vault markdown source of truth (notes, wikilinks, relations) always vault/
exo CLI index, search, garden, collide, status on demand src/exo/
exocortex MCP retrieval/graph tools for agents per agent session exo-mcp
Viewer 3D graph + web UI (single-user SSO) live exocortex.example.com
Reconciler index Synced/OutOfSync + auto-reindex on commit/merge .githooks/, exo status
Gardener nightly vault upkeep (orphans, links, summaries) → garden: commits cron daily 03:00 scripts/garden-run.sh
Wanderer task-less serendipity walk — collides trusted vault notes cron Sun 07:00 scripts/wander-run.sh
Magpie GitHub-stars watch — collides untrusted external text cron Sat 06:00 scripts/magpie-run.sh
Bluejay serendipity news-reader — allowlisted RSS, summaries only (never article bodies), hunts the distant connection cron weekly scripts/bluejay-run.sh
Jackdaw people-radar — contributors of starred repos sorted into 4 typed lanes; drafts only, sending is always a human act cron monthly scripts/jackdaw-run.sh
WIP sweep snapshot dirty human tree → wip/<host> (never lose work) cron every 20 min ~/.local/bin/exo-wip-sweep.sh
Recall hook search the vault on the first prompt of a CC session UserPromptSubmit ~/.claude/hooks/exo-recall.sh
Session-start hook fetch/warn/pull this tree, nag about wip/* SessionStart (in this repo) ~/.claude/hooks/exo-session-start.sh
n8n receivers one-line run report per agent webhook on each run automation/, n8n.example.com

The one rule that ties it together — trust boundaries by destination: gardener and wanderer read already-trusted notes and write to vault/ and push to main. The three corvids — Magpie, Bluejay, Jackdaw — ingest attacker-influenceable text (stranger-written repo descriptions, RSS summaries, contributor profiles), so they write only to quarantine/ (never indexed, never auto-linked) and you promote finds by hand. Their collide/classify phase holds the untrusted text in context with no Bash, no git, no network, no MCP — read the vault, write one quarantine file, nothing else — and the wrapper discards any change outside that path. "Nothing sparked" is a successful run; the birds never manufacture a find to look productive. The WIP sweep writes unfinished human work to wip/<host> branches — recoverable, but it reaches main only by your hand. Robot checkouts (exocortex-{garden,wander,magpie}) hard-reset every run, so they self-heal and never strand work.

What you get

  • Vault (vault/) — typed markdown notes, wikilinks, typed relations.
  • Hybrid retrieval — BM25 + local vectors + graph expansion, with matched_on explainability. One SQLite file; no extra servers.
  • Two MCP servers for agents:
    • Basic Memory — note CRUD (adopted, not reinvented).
    • exocortex (this repo) — hybrid_search, get_backlinks, get_neighbors, list_orphans, list_hubs, garden_report, reindex, vault_status, collide.
  • Collision engine — exo collide samples distant note pairs (graph hops, lexical disjointness, age gap) and asks one question: does anything connect? Serendipity as a query — retrieval answers, collide interrupts. Most pairs yield nothing by design; genuine hits land in vault/00-inbox/claude-sparks.md.
  • Reconciler — GitOps for the index: exo status reports Synced/OutOfSync (exit 0/1) by hashing vault files against the index, and .githooks/ (post-commit + post-merge) reindexes automatically. "Files win" is enforced by a machine, not remembered by agents.
  • Autonomous gardener — exo garden deterministically finds orphans, stale summaries, and missing links; Claude acts on them as small, reviewable garden: git commits (it decides + writes, the detection is plain SQL/graph). Runs unattended nightly on the homelab — see "Nightly self-gardening" below.
  • Visualization — Obsidian 2D + 3D Graph plugin, plus a standalone 3d-force-graph web viewer (viz/graph3d/) deployable to the homelab.
  • Automation — scripts/garden-run.sh (the nightly gardener) + an n8n webhook that records each run.
  • Homelab deploy — Dockerfile + k3s manifests (Traefik IngressRoute) + Argo CD app.

Install (local)

git clone <this> exocortex && cd exocortex
./scripts/setup.sh            # installs, git-inits, builds the index
# optional local embeddings via Ollama:
ollama pull nomic-embed-text  # then EXO_EMBED_BACKEND=ollama (default)

No Ollama? Set EXO_EMBED_BACKEND=none — lexical + graph search still work fully.

MCP wiring (Claude Code / Desktop)

{
  "mcpServers": {
    "basic_memory": { "command": "uvx", "args": ["basic-memory", "mcp"] },
    "exocortex":    { "command": "exo-mcp" }
  }
}

Point Basic Memory at vault/. Load CLAUDE.md as the agent's operating contract.

Quickstart

exo index                      # (re)build the index from markdown
exo search "hybrid retrieval"  # explainable hybrid search
exo backlinks hybrid-retrieval
exo hubs                       # most-connected notes (MOC candidates)
exo garden                     # maintenance report for an agent to act on
(cd viz/graph3d && python3 -m http.server 8080)   # 3D brain at :8080

Layout

vault/      the knowledge base (open this in Obsidian)
src/exo/    the cognition layer (indexer, retrieval, graph, gardener, MCP, CLI)
viz/        standalone 3D viewer
automation/ n8n workflows
deploy/     Dockerfile + k3s + Argo CD for tc-homelab
docs/       ARCHITECTURE · ONTOLOGY · WORKFLOWS · ROADMAP
CLAUDE.md   agent operating contract

Nightly self-gardening (homelab)

The vault weeds itself. A node-side cron runs scripts/garden-run.sh nightly:

reset a disposable checkout → exo index → exo garden (deterministic report)
  → claude -p applies only high-confidence edits (≤10 notes), writes a dated
    audit note to vault/00-inbox/, skips anything uncertain
  → exo index → one `garden: <date> …` commit → push
  → POST a run summary to an n8n webhook (run history / notifications)

Design choices that keep it safe: a dedicated checkout (never touches your working tree), a per-night edit cap, hermetic Claude (no MCP, restricted tools), and — crucially — every change is one garden: commit you can read with git log -p and undo with git revert. Detection is deterministic; the model only decides and writes. (The trigger is node-cron rather than n8n-over-SSH because Cilium blocks pod→host — see the blog write-up.)

Why this and not X

  • vs Obsidian-alone: Obsidian can't give agents structured read/write or hybrid retrieval. Here it's the viewer; the store is portable markdown.
  • vs embeddings-only RAG: opaque and can't write back. This is transparent (every match explains itself) and bidirectional (agents author notes).
  • vs a graph DB (Neo4j): unnecessary infra. The graph lives in wikilinks; SQLite materializes it. Add a graph DB only if/when queries outgrow this.
  • vs cloud knowledge SaaS: lock-in. Here, git clone is your backup and any markdown tool is your fallback.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选