r/Python • u/apacheCH • Mar 26 '26
Showcase altRAG: zero-dependency pointer-based alternative to vector DB RAG for LLM coding agents
What My Project Does
altRAG scans your Markdown/YAML skill files and builds a TSV skeleton (.skt) mapping every section to its exact line number and byte offset. Your AI coding agent reads the skeleton (~2KB), finds the section it needs, and reads only those lines. No embeddings, no chunking, no database.
pip install altrag
altrag setuphat's it. Works with Claude Code, Cursor, Copilot, Windsurf, Cline, Codex — anything that reads files.
Target Audience
Developers using AI coding agents who have structured knowledge/skill files in their repos. Production-ready — zero runtime dependencies, tested on Python 3.10–3.13 × Linux/macOS/Windows, CI via GitHub Actions, auto-publish to PyPI via trusted publisher. MIT licensed.
Comparison
Vector DB RAG (LangChain, LlamaIndex, etc.) embeds your docs into vectors, stores them in a database, and runs similarity search at query time. That makes sense for unstructured data where you don't know what you're looking for.
altRAG is for structured docs where you already know where things are — you just need a pointer to the exact line. No infrastructure, no embeddings, no chunking. A 2KB TSV file replaces the entire retrieval pipeline. Plan mode benefits the most — bloat-free context creates almost surgical plans.
1
u/ultrathink-art Mar 27 '26
Works well when your knowledge files have stable, predictable structure — pointer-based retrieval breaks down as soon as section names drift or content gets more freeform. For agent instruction files and API docs it's probably the right tradeoff; for evolving specs or accumulated session notes, you'd fight the skeleton more than use it.
1
u/apacheCH Mar 27 '26
Yup, exactly the way I'd think about it. Vector techniques still get the edge in unstructured files. IMO, retrieval from unstructured documents will be solved when each of our computers start running a small and accurate model right out of the box.
1
Mar 27 '26
[removed] — view removed comment
1
u/apacheCH Mar 27 '26
So basically a probe and RL loop for agents. Nifty! How is the system learning though? Is it distillation loops that enrich context and compact things as new mental models are formed or some form of data standardization? Either way, what I'm curious to learn is how you're approaching context-management.
2
u/Critical-Tomato7976 Mar 27 '26
This is clever tbh. Vector RAG setups get so bloated for structured docs where you literally know where everything is. Quick question though - does altrag setup need to rerun every time the source files change or is there some incremental thing going on