Skip to main content

Pointer-based skill retrieval for LLM agents. Alternative to vector DB RAG.

Project description

altRAG

altRAG

Pointer-based skill retrieval for LLM agents.
The alternative to vector DB RAG.

PyPI License Python Deps

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:

  1. Finds your skill files (docs/, skills/, knowledge/, or any .md/.yaml)
  2. Scans them into a pointer skeleton (.skt)
  3. Generates an interactive tree viewer (HUMAN.html)
  4. Adds the retrieval directive to your agent's config file
  5. Installs a git pre-commit hook to keep the skeleton fresh
  6. 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:

  1. Agent directive — the config tells the agent to re-scan after modifying skill files
  2. Git hookaltrag setup installs 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.

altRAG Interactive Skill Tree

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

altrag-0.1.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

altrag-0.1.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

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

Hashes for altrag-0.1.1.tar.gz
Algorithm Hash digest
SHA256 14c1c2a30ab5c0b3d2b91dee734f0fc5dd24b79ea9cf78c6e647fd669fb2fd19
MD5 a305dd55c5b44e7b0a0050c46ca9925f
BLAKE2b-256 9b17f13459a8b8c5171227f26103f4a4f430127bc22ae161121da3d18b7d04b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for altrag-0.1.1.tar.gz:

Publisher: publish.yml on antiresonant/altRAG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for altrag-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21f50d6eae6084aad356975a1f1473f43802e406ad6705fcc61efd9d8cddc5f4
MD5 a5875e895bb5be978897da25a520db29
BLAKE2b-256 5b480c5a4d2eb8107acd8be4b7159da773fd491ec24da30a0f9bd89ba6efda61

See more details on using hashes here.

Provenance

The following attestation bundles were made for altrag-0.1.1-py3-none-any.whl:

Publisher: publish.yml on antiresonant/altRAG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page