Pointer-based skill retrieval for LLM agents. Alternative to vector DB RAG.
Project description
altRAG
Pointer-based skill retrieval for LLM agents.
The alternative to vector DB RAG.
pip install altrag
RAG embeds your docs into vectors, does fuzzy similarity search, and returns chunks that may or may not be what you need. It costs tokens, adds latency, requires a vector DB, and you can't debug why it retrieved what it did.
altRAG builds a deterministic pointer table. Every heading in your skill files gets mapped to its exact line number and byte offset. The agent reads the lightweight skeleton during planning (~100 tokens), then reads only the exact section it needs. No embeddings. No vector DB. No similarity thresholds. Surgical, deterministic, debuggable.
Quick start
pip install altrag
altrag setup
That's it. Two commands. altrag setup:
- Finds your skill files (
docs/,skills/,knowledge/, or any.md/.yaml) - Scans them into a pointer skeleton (
.skt) - Generates an interactive tree viewer (
HUMAN.html) - Adds the retrieval directive to your agent's config file
- Installs a git pre-commit hook to keep the skeleton fresh
- Updates
.gitignore
How it works
Your docs: The skeleton (.skt):
docs/ @ docs/k8s-deploy.md
k8s-deploy.md (195 lines) 1 0 4662 1 195 Kubernetes Deployment Guide
api-reference.md (200 lines) 2 1163 1565 42 70 Deployment Strategies
3 2110 613 82 28 Canary Deployment
...
Agent needs canary deployment info? Reads the skeleton, finds Canary Deployment at line 82, 28 lines, reads exactly that. Not the full 195-line file. Not 5 fuzzy chunks. 28 lines.
RAG vs altRAG
| RAG | altRAG | |
|---|---|---|
| Setup | Vector DB + embedding model + chunking config | pip install altrag |
| Indexing | Embed all docs, store vectors, tune chunk size | altrag scan docs/ |
| Query | Similarity search, top-k, hope for relevance | Read skeleton, follow pointer |
| Retrieved context | 2,000 - 10,000 tokens of maybe-relevant chunks | 100 token skeleton + exact section |
| Determinism | Probabilistic | Deterministic |
| Debuggability | "Why did it retrieve that?" | Open HUMAN.html, see the tree |
| Dependencies | Vector DB, embedding model, SDK | None |
Works with every agent
altrag setup auto-detects and configures whichever agent you use:
| Agent | Config |
|---|---|
| Claude Code | CLAUDE.md |
| Cursor | .cursorrules |
| Windsurf | .windsurfrules |
| Cline | .clinerules |
| GitHub Copilot | .github/copilot-instructions.md |
| OpenAI Codex | codex.md / AGENTS.md |
| Replit Agent | replit.md |
No vendor lock-in. The .skt format is a plain TSV. Any agent that can read files can use it.
Commands
altrag setup # does everything — scan, configure, hook
altrag scan <path> -o out.skt # scan and output skeleton
altrag tree <path> # open interactive tree viewer
altrag init [dir] # scaffold a skills directory
Auto-update
The skeleton stays fresh through two mechanisms:
- Agent directive — the config tells the agent to re-scan after modifying skill files
- Git hook —
altrag setupinstalls a pre-commit hook that automatically re-scans when skill files change
Interactive tree viewer
altrag tree generates a self-contained HTML file showing your skill architecture as a vertical tree diagram. Click to expand/collapse. Search. Filter by file. Dark/light theme. No server needed — just a local HTML file.
Architecture
skill files (.md, .yaml)
|
altrag scan <- extracts heading structure with byte/line pointers
|
pointer skeleton (.skt) <- compact TSV, ~100 tokens for a full skill repo
|
LLM agent <- reads skeleton during planning
| reads exact sections during execution
surgical retrieval <- 28 lines instead of 5000
License
MIT
Project details
Release history Release notifications | RSS feed
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 altrag-0.1.1.tar.gz.
File metadata
- Download URL: altrag-0.1.1.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14c1c2a30ab5c0b3d2b91dee734f0fc5dd24b79ea9cf78c6e647fd669fb2fd19
|
|
| MD5 |
a305dd55c5b44e7b0a0050c46ca9925f
|
|
| BLAKE2b-256 |
9b17f13459a8b8c5171227f26103f4a4f430127bc22ae161121da3d18b7d04b5
|
Provenance
The following attestation bundles were made for altrag-0.1.1.tar.gz:
Publisher:
publish.yml on antiresonant/altRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
altrag-0.1.1.tar.gz -
Subject digest:
14c1c2a30ab5c0b3d2b91dee734f0fc5dd24b79ea9cf78c6e647fd669fb2fd19 - Sigstore transparency entry: 1186238138
- Sigstore integration time:
-
Permalink:
antiresonant/altRAG@107962722d55aaad7cdbac6014412dce534f71a9 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/antiresonant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@107962722d55aaad7cdbac6014412dce534f71a9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file altrag-0.1.1-py3-none-any.whl.
File metadata
- Download URL: altrag-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21f50d6eae6084aad356975a1f1473f43802e406ad6705fcc61efd9d8cddc5f4
|
|
| MD5 |
a5875e895bb5be978897da25a520db29
|
|
| BLAKE2b-256 |
5b480c5a4d2eb8107acd8be4b7159da773fd491ec24da30a0f9bd89ba6efda61
|
Provenance
The following attestation bundles were made for altrag-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on antiresonant/altRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
altrag-0.1.1-py3-none-any.whl -
Subject digest:
21f50d6eae6084aad356975a1f1473f43802e406ad6705fcc61efd9d8cddc5f4 - Sigstore transparency entry: 1186238142
- Sigstore integration time:
-
Permalink:
antiresonant/altRAG@107962722d55aaad7cdbac6014412dce534f71a9 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/antiresonant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@107962722d55aaad7cdbac6014412dce534f71a9 -
Trigger Event:
push
-
Statement type: