ctxforge — compile raw knowledge into agent-ready context
The context-layer fix. Instead of wiring raw documents straight into an agent's context window (slow, noisy, pattern-matched guesswork), ctxforge compiles a source directory into a structured wiki: per-document summaries, keyword lists, TF-IDF concept clusters with backlinks, a health-check linter, and a small search engine an agent can query over a CLI.
Why
- Context is the bottleneck, not the model. Karpathy: "a large fraction of my recent token throughput goes into manipulating knowledge" — raw sources compiled into a wiki with summaries, backlinks, and concept articles, queried through a CLI.
- Vector retrieval breaks on vocabulary mismatch ("why did the deploy fail"
vs
get_pipeline_run_logs). TF-IDF keyword retrieval over compiled summaries keeps agents on-target without an embedding service or vector DB. - Health checks catch decay: stale sources, missing summaries, orphan docs — the wiki is treated as a product with an update cadence, not a setup step.
Usage
./ctxforge compile ~/notes -o ~/wiki # build wiki (extractive, $0, offline)
./ctxforge compile ~/notes -o ~/wiki --llm # LLM-enriched summaries (optional)
./ctxforge search ~/wiki "reservoir pressure decline" # ranked results
./ctxforge health ~/wiki # stale / orphan / missing-summary lint
CTXFORGE_AGENT_JSON=1 ./ctxforge search ~/wiki "deploy failed" # JSON for agents
LLM enrichment is optional and model-agnostic (any OpenAI-compatible endpoint):
export OLLAMA_URL=http://localhost:11434/v1/chat/completions # local
export CTXFORGE_LLM_URL=https://api.openai.com/v1/chat/completions
export CTXFORGE_LLM_KEY=sk-...
export CTXFORGE_LLM_MODEL=llama3.1
Output
wiki/
index.json # machine-readable: docs, summaries, keywords, concepts, idf
docs/<slug>.md # one per source: summary + keywords + backlinks
concepts/concept-N.md # TF-IDF clusters with defining terms + source links
Search returns ranked paths + summaries; with CTXFORGE_AGENT_JSON=1 it emits
a single JSON line an agent can consume directly.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ctxforge_ai-0.1.0.tar.gz.
File metadata
- Download URL: ctxforge_ai-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d942deb1482f407f83c3681c35534d4fe572f143ed9acb09c31358f2aca8d206
|
|
| MD5 |
ba922723b0be5c1d65d43b82187e2d67
|
|
| BLAKE2b-256 |
8249ce45ad50ceed34b0edeb81ee7174300873443d28026761c605f56320f768
|
File details
Details for the file ctxforge_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ctxforge_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e2815ee11814b08570ffa498846a66e1c9cf7ed964659fcda7546cb003ce531
|
|
| MD5 |
797751b190c98b44dab3d85a4e21acc8
|
|
| BLAKE2b-256 |
d10b4071501d4d25202ad8139341534a8d42d206f6a2dc6f5f69f1e51029307b
|