mozg
mozg turns documentation into knowledge brains your agent queries over MCP instead of loading whole files into context. What makes it different: every brain sits an exam. Its goal becomes ~30 control questions, re-sat after every ingest — so 'trained 92%' is measured, not claimed, and the failing questions are listed publicly. Brains learn from use: searches that return nothing become exam questio
README
<div align="center">
<img src="public/brand/devto-cover.jpg" alt="mozg — a brain assembled from notes, stamped with a passing grade" width="720" />
mozg.
Exam-scored knowledge brains for AI coding agents. Paste one docs URL → get a searchable brain your agent queries over MCP — with a measured score and a public list of what it does not know.
Start here · Catalogue · Why not a context file · Self-host guide · Roadmap
</div>
Your agent answers from memory, and memory has a date on it. Context files rot silently, cost tokens on every session, and can never tell you what they actually cover. mozg is built on one mechanism applied everywhere:
Knowledge must be measured.
<p align="center"> <img src="public/brand/demo.svg" alt="Terminal: connecting mozg to Claude Code, then an agent answering an Expo question from the brain with a cited source and exam score" width="820" /> </p>
The loop
flowchart LR
A[one docs URL] --> B[crawler<br/>github tree · llms.txt · sitemap]
B --> C[atomic notes<br/>+ embeddings]
C --> D{{the exam<br/>~30 questions from the goal}}
D -->|score + failed questions| E[focused re-read<br/>chases the gaps]
E --> C
F[agents querying over MCP] -->|zero-hit searches| D
F -->|corrections| G[owner review] --> C
- The exam is the product. The brain's goal becomes control questions, re-sat after every ingest. Trained 92% is a fact, not a claim — and the failures are listed publicly, so agents are told the gaps before they search. Anti-bluff questions verify it refuses what it doesn't know.
- Zero-context search. Retrieval is server-side (hybrid + reranker). A brain can hold 3,000 notes; an answer costs the three it needed.
- The collective mind. A search that returns nothing becomes an exam question. Corrections agents file become owner-reviewed notes. Nothing is ever deleted — every version is kept, and the diff between sittings shows on the brain's page.
- learn. Any brain doubles as a spaced-repetition course for humans at learn.mozg.sh — read → recall → quiz, streaks, a certificate at 80%, and a scoreboard against your own agent.
- Injection-hardened. Published notes are scanned for credential leaks, PII and prompt-injection language; third-party notes arrive framed as data, not instructions; AI training crawlers are refused in robots.txt.
Run your own, in one command
git clone https://github.com/egorfedorov/mozg.git && cd mozg
cp .env.selfhost.example .env # fill ANTHROPIC_API_KEY + BETTER_AUTH_SECRET
docker compose -f docker-compose.selfhost.yml up
Postgres with pgvector, the embedder, the app and the worker come up together; the schema migrates itself before the app starts. Open http://localhost:3300, create an account, paste a docs URL.
First boot downloads ~2.2 GB of embedding weights into a volume — that is the slow part, and it happens once. Full operational detail, including production deploys behind nginx, lives in docs/SELFHOST.md.
Cloud, or your own metal
| mozg.sh cloud | self-host (this repo) | |
|---|---|---|
| Read, connect, study | free | yours |
| Official catalogue | free, curated, kept current | seed it yourself (scripts/catalogue.ts) |
| Build brains | free trial brain, then plans or bring your own API key | your keys, no limits |
| Marketplace | outside authors sell, 95% to them | n/a |
| Ops | ours | docs/SELFHOST.md |
The deal is honest: building brains spends model tokens. On the cloud you
either pay a plan (we spend), set your own API key in settings (you spend),
or teach through a Claude Code subscription with the plugin's /mozg:train.
Stack
Next.js 16 · Postgres 14 + pgvector (HNSW) · pg-boss (queue in Postgres) · better-auth · bge-m3 embeddings + bge-reranker (self-hosted FastAPI) · Playwright render service for JS-shell docs sites · esbuild-bundled worker. 178 tests, CI on every push.
Contributing
Bug reports with reproduction beat everything; brain_feedback reports from
real use beat those. Small PRs welcome — see CONTRIBUTING.md.
New catalogue packs are data entries, not code.
License
AGPL-3.0. Run it, change it, self-host it; host it for others and your changes stay open. The hosted cloud at mozg.sh sells convenience and inference — never locks.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。