🧠 AgentOS Cortex — Knowledge Compiler
Your AI's Long-Term Memory
Cortex turns disposable AI research into a persistent, compounding knowledge base. No vector databases. No RAG pipelines. Just structured Markdown compiled and maintained by your LLM.
Cortex = An LLM-compiled wiki layer that sits between your raw research sources and your agents. Every document, insight, and decision is transformed into human-readable, interlinked Markdown — making your AI's knowledge base inspectable, editable, and self-healing.
100
– 10K docs sweet spot
0
Embeddings needed
Self-
healing
healing
LLM linting
01
Why RAG Falls Short at Personal Scale
the problem
❌ RAG — Vector Retrieval
Chunk documents into fixed-size fragments
Embed each chunk into high-dimensional vectors
Store in a vector database (Qdrant, Pinecone, Weaviate)
At query time: embed the question, find nearest-neighbor chunks
Hope the retrieved chunks are actually relevant
✗ Opaque embeddings — you can't inspect what was retrieved or why
✗ Retrieval noise — nearest neighbor ≠ most relevant
✗ Static index — adding new docs requires re-embedding
✗ Chunking destroys context — a paragraph without its surrounding doc loses meaning
✗ Black box — no way to audit, edit, or fix what the system "knows"
✅ Cortex — LLM Wiki
Dump raw materials into
raw/ directory
LLM reads raw content, writes structured encyclopedia articles
Articles live as plain .md files with backlinks and index files
At query time: LLM reads relevant articles directly — no vector lookup
Results feed back into the wiki, compounding over time
✓ Fully inspectable — open any .md file and read it
✓ Explicit backlinks — every connection is deliberate
✓ Editable — fix or extend any article directly
✓ Self-healing — LLM linting finds and fixes inconsistencies
✓ Zero infrastructure — local files + any LLM
The Scale Insight: RAG is designed for millions of documents where humans can't read everything. At 100–10,000 high-signal documents — personal research, business intelligence, market analysis — an LLM can read and synthesize everything. Skip the embedding pipeline. Compile a wiki instead.
02
The Cortex Architecture
compile pipeline
🌐 Sources
Perplexity · Vane · Obsidian Web Clipper · Business Docs · Research Papers
↓
📁 raw/ directory
Unprocessed source material — .md, .pdf, .txt, web clips
↓
🧠 LLM Compiler
Reads raw/ → writes structured wiki articles, backlinks, index files
↓
🗂️ cortex/wiki/ directory
.md files · backlinks · category index · master index.md
↙ ↓ ↘
🔍 Query Interface
LLM reads wiki directly — no vector search
📊 Obsidian
Human viewing · graph visualization · backlink explorer
♻️ Lint & Heal
Periodic LLM health checks · gap-filling · consistency
03
RAG vs Cortex — Full Comparison
7 dimensions
| Dimension | RAG (Vector Embeddings) | Cortex (LLM Wiki) |
|---|---|---|
| Storage | Opaque vector embeddings — unreadable binary blobs | Human-readable .md files — open in any text editor |
| Retrieval | Semantic similarity via nearest-neighbor search | Explicit backlinks + index files — no guessing |
| Traceability | Low — black box, can't audit what was retrieved | High — every claim links to a specific source file |
| Maintenance | Static index requires full re-embedding to update | Self-healing via periodic LLM linting passes |
| Scale Sweet Spot | Millions of documents (enterprise, web-scale) | 100–10,000 high-signal documents (personal/team) |
| Editability | Cannot edit embeddings — must re-index from scratch | Edit any .md file directly — changes instant |
| Infrastructure | Vector DB (Qdrant/Pinecone) + embedding pipeline + hosting | Local .md files + any LLM — zero servers needed |
04
The Compile Pipeline — Step by Step
5 stages
01
Data Ingest — Filling raw/
Raw materials from all intelligence sources land in the
raw/ directory. No processing yet — just collection.- Perplexity research outputs exported as Markdown
- Vane private company analysis and intelligence reports
- Web articles captured via Obsidian Web Clipper (one-click .md conversion)
- Business documents, earnings calls, regulatory filings
- Research papers and whitepapers (.pdf converted to .md)
- Meeting notes, decision logs, personal observations
Perplexity
Vane
Obsidian Clipper
PDF → md
02
LLM Compilation — The Core Innovation
The LLM reads all raw material and writes a structured, encyclopedia-style wiki. This is not summarization — it is knowledge synthesis and organization.
- Generates article-length summaries of all source material
- Identifies key concepts and writes dedicated encyclopedia-style articles for each
- Creates explicit [[backlinks]] between related articles (Obsidian-compatible syntax)
- Builds and maintains category index files (e.g.
markets/index.md) - Builds and maintains a master
index.mdlinking all articles - Categorizes content into the directory structure automatically
- Assigns confidence scores and flags unverified claims
Core Innovation
Claude / GPT-4o
wiki compilation
03
Active Linting — Self-Healing Health Checks
On a scheduled cadence (daily or weekly), the LLM runs health-check passes over the entire wiki to maintain integrity and discover new connections.
- Detects contradictions between articles (e.g. two articles claiming different market share figures)
- Imputes missing data by triggering web searches via Perplexity or Vane
- Discovers new connections between previously unlinked concepts — adds backlinks
- Suggests new articles to write based on gaps in coverage
- Updates stale articles when newer source material is added to raw/
- Incrementally improves confidence scores and data integrity over time
Scheduled
Perplexity
Incremental
04
Query — Ask the Wiki Directly
Complex questions answered by pointing the LLM at relevant wiki articles. No embedding lookup — the LLM reads the actual articles, with full context and backlinks preserved.
- LLM reads the master index.md to find relevant articles
- Loads the specific .md articles into context window
- Answers the question with explicit article citations
- Can traverse backlinks to pull in related context automatically
- At 100–10K articles, the entire wiki fits within or near modern context windows
No vector DB
Full context
Cited answers
05
Output Loop — Every Exploration Compounds
Results from queries, agent tasks, and new research are filed back into the wiki. Each run makes the next run more informed.
- Query answers filed as new articles or appended to existing ones
- Agent task outputs (Manus executions) compiled into decisions/ and projects/
- New raw/ files trigger incremental recompilation of affected articles
- Over time: a continuously improving, compounding knowledge base
Compounding
Feedback loop
Manus outputs
05
Cortex in AgentOS — Integration Points
cross-layer connections
L4 Intelligence → Cortex
Perplexity Cloud Research
→ feeds raw/
Every Perplexity deep research session exports to
raw/. The LLM compiler ingests it on the next compile pass, adding the research to the wiki as structured articles rather than one-time outputs.L4 Intelligence → Cortex
Vane Private Analysis
→ feeds raw/
Vane's private company and market intelligence — unavailable to public search — lands in
raw/ and gets compiled into the competitors/ and markets/ sections of the wiki.L6 Memory → Cortex boundary
Qdrant vs Cortex Division
↔ complementary
Qdrant handles ephemeral session memory — what happened in this conversation, this task, this hour. Cortex handles persistent knowledge — what we know about markets, competitors, products, decisions across all time.
L3 Planner → Cortex
Manus Pre-Task Lookup
→ reads wiki before acting
Before Manus starts any significant task, it queries Cortex first: "What do we already know about this?" Prevents redundant research and surfaces relevant prior decisions, competitors, and context automatically.
L5 Execution → Cortex
Task Output Filing
→ writes to wiki
Completed Manus task outputs — analysis, decisions, code reviews, business assessments — are compiled back into Cortex. Every execution adds to institutional memory instead of disappearing into chat history.
L7 Culture → Cortex
Prompt Library & Decisions
→ stored in prompts/ + decisions/
Reusable prompts, standard operating procedures, and business decisions with full rationale are stored in Cortex. The AI Shop's accumulated judgment is persisted, not just in people's heads.
06
Recommended Vault Structure
AI Shop configuration
The Obsidian vault doubles as both your Cortex directory and human-readable knowledge base. The structure below is optimized for a product business doing active market research and competitive intelligence.
cortex/
├── raw/ ← Perplexity exports, Vane reports, web clips — unprocessed
├── wiki/ ← LLM-compiled articles (the knowledge base)
│ ├── markets/ ← Market sizing, trends, sector analysis articles
│ ├── competitors/← One article per competitor, auto-updated on new raw/
│ ├── financials/← Earnings summaries, valuation models, sector benchmarks
│ ├── products/ ← Product knowledge, feature comparisons, positioning
│ └── strategy/ ← Strategic decisions with full context and rationale
├── projects/ ← Per-product knowledge and project history
├── prompts/ ← Reusable prompt library, SOP templates
├── decisions/ ← Business decisions with rationale, date, and context
└── index.md ← Master index, auto-maintained by LLM compiler
COMPILE TARGET
wiki/ is the output of the compiler. Never manually edit wiki/ articles — let the LLM own them. Edit raw/ instead.
HUMAN EDITABLE
decisions/ and prompts/ are human-authored. The LLM indexes and links them, but doesn't overwrite them.
OBSIDIAN LAYER
Open the entire cortex/ directory as an Obsidian vault. Graph view shows the knowledge network visually.
🔬 The Karpathy Insight — April 2026
"A large fraction of my recent token throughput goes less into manipulating code, and more into manipulating knowledge."
— Andrej Karpathy, "LLM Knowledge Bases" (April 2026)
Karpathy's insight is that the LLM's role is shifting from code assistant to knowledge compiler. His personal implementation: roughly 100 articles, ~400K words of accumulated research — all LLM-compiled, maintained, and queryable. Not a vector database. A wiki.
LLMs as Compilers
Use the LLM's reasoning ability to organize knowledge, not just retrieve it. Compilation produces something better than its inputs.
Knowledge over Code
As AI handles more code, the limiting resource becomes organized, high-quality knowledge that agents can reason over.
~100 Articles Scale
Karpathy's personal wiki at ~100 articles / ~400K words is fully manageable by a single LLM call. No infrastructure needed.
Compounding Returns
Unlike RAG indexes that are static, a compiled wiki improves with each linting pass. The knowledge base compounds with use.
08
Implementation Roadmap
6 build steps
Step 01
Initialize Obsidian Vault
Create the cortex/ directory structure above. Open it as an Obsidian vault. Enable the Graph View and Backlinks plugins. This is both your Cortex working directory and your human-readable knowledge interface.
Step 02
Configure Obsidian Web Clipper
Install the Obsidian Web Clipper browser extension. Configure it to save directly to
cortex/raw/ with auto-generated frontmatter (source URL, date, tags). One-click capture of any web content to Markdown.Step 03
Build compile.py CLI
Python script that reads all files in raw/, sends them to the LLM with a compilation prompt, and writes the resulting wiki articles to wiki/. Include incremental mode (only recompile articles affected by new raw/ files) and a force-full flag.
Step 04
Build lint.py CLI
Scheduled health check script. Reads all wiki/ articles, sends to LLM with a linting prompt, receives a structured report of: contradictions found, gaps identified, new backlinks suggested, articles to write. Optionally auto-applies non-destructive fixes.
Step 05
Build query.py CLI
Interactive query interface. Reads index.md to identify relevant articles for the question, loads those articles into context, queries the LLM with the loaded context + question, returns cited answer. Optionally files the answer back into wiki/.
Step 06
Integrate with Manus Orchestrator
Register compile, lint, and query as available tools in the Manus orchestrator. Manus can then: pre-task lookup ("what do we know about X?"), post-task filing ("file this result to wiki/"), and trigger lint passes when the wiki grows stale.
→
Related Pages