Metadata-Version: 2.4
Name: axon-rag
Version: 0.3.2
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Dist: numpy>=1.20.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: sentence-transformers>=3.0.0
Requires-Dist: tf-keras>=2.0.0
Requires-Dist: ollama>=0.1.0
Requires-Dist: openai>=1.0.0
Requires-Dist: google-genai>=1.4.0
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: httpx>=0.25.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: uvicorn>=0.22.0
Requires-Dist: python-docx>=1.0.0
Requires-Dist: python-pptx>=0.6.18
Requires-Dist: pymupdf>=1.24.0
Requires-Dist: pypdf>=4.0.0
Requires-Dist: openpyxl>=3.1.0
Requires-Dist: pyarrow>=10.0.0
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: tiktoken>=0.7.0
Requires-Dist: lancedb>=0.8.0
Requires-Dist: tqdb>=0.7.0
Requires-Dist: prometheus-client>=0.20
Requires-Dist: streamlit>=1.30.0 ; extra == 'all'
Requires-Dist: chromadb>=0.4.0 ; extra == 'all'
Requires-Dist: qdrant-client>=1.7.0,<2.0.0 ; extra == 'all'
Requires-Dist: fastembed>=0.1.0,<1.0.0 ; extra == 'all'
Requires-Dist: networkx>=3.0 ; extra == 'all'
Requires-Dist: leidenalg>=0.11.0 ; extra == 'all'
Requires-Dist: igraph>=1.0.0 ; extra == 'all'
Requires-Dist: gliner>=0.2.0 ; extra == 'all'
Requires-Dist: llmlingua>=0.2.0 ; extra == 'all'
Requires-Dist: transformers>=4.20.0 ; extra == 'all'
Requires-Dist: ebooklib>=0.18 ; extra == 'all'
Requires-Dist: striprtf>=0.0.26 ; extra == 'all'
Requires-Dist: extract-msg>=0.28.0 ; extra == 'all'
Requires-Dist: chromadb>=0.4.0 ; extra == 'chroma'
Requires-Dist: pytest>=7.4.0,<8.0.0 ; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0,<1.0.0 ; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0,<5.0.0 ; extra == 'dev'
Requires-Dist: pytest-testmon>=2.1.0,<3.0.0 ; extra == 'dev'
Requires-Dist: black==23.12.1 ; extra == 'dev'
Requires-Dist: ruff>=0.1.0,<1.0.0 ; extra == 'dev'
Requires-Dist: mypy>=1.5.0,<2.0.0 ; extra == 'dev'
Requires-Dist: pre-commit>=3.4.0,<4.0.0 ; extra == 'dev'
Requires-Dist: chromadb>=0.4.0 ; extra == 'dev'
Requires-Dist: cryptography>=42.0.0 ; extra == 'dev'
Requires-Dist: keyring>=24.0.0 ; extra == 'dev'
Requires-Dist: requests>=2.31.0 ; extra == 'dev'
Requires-Dist: deepeval>=0.21.0 ; extra == 'eval'
Requires-Dist: fastembed>=0.1.0,<1.0.0 ; extra == 'fastembed'
Requires-Dist: gliner>=0.2.0 ; extra == 'gliner'
Requires-Dist: networkx>=3.0 ; extra == 'graphrag'
Requires-Dist: leidenalg>=0.11.0 ; extra == 'graphrag'
Requires-Dist: igraph>=1.0.0 ; extra == 'graphrag'
Requires-Dist: langchain-core>=0.1.0 ; extra == 'langchain'
Requires-Dist: llama-index-core>=0.10.0 ; extra == 'llama-index'
Requires-Dist: llmlingua>=0.2.0 ; extra == 'llmlingua'
Requires-Dist: ebooklib>=0.18 ; extra == 'loaders'
Requires-Dist: striprtf>=0.0.26 ; extra == 'loaders'
Requires-Dist: extract-msg>=0.28.0 ; extra == 'loaders'
Requires-Dist: qdrant-client>=1.7.0,<2.0.0 ; extra == 'qdrant'
Requires-Dist: transformers>=4.20.0 ; extra == 'rebel'
Requires-Dist: cryptography>=42.0.0 ; extra == 'sealed'
Requires-Dist: keyring>=24.0.0 ; extra == 'sealed'
Requires-Dist: requests>=2.31.0 ; extra == 'sealed-test'
Requires-Dist: transformers>=4.40 ; extra == 'sparse'
Requires-Dist: torch>=2.0 ; extra == 'sparse'
Requires-Dist: streamlit>=1.30.0 ; extra == 'starter'
Requires-Dist: cryptography>=42.0.0 ; extra == 'starter'
Requires-Dist: keyring>=24.0.0 ; extra == 'starter'
Requires-Dist: ebooklib>=0.18 ; extra == 'starter'
Requires-Dist: striprtf>=0.0.26 ; extra == 'starter'
Requires-Dist: extract-msg>=0.28.0 ; extra == 'starter'
Requires-Dist: streamlit>=1.30.0 ; extra == 'ui'
Provides-Extra: all
Provides-Extra: chroma
Provides-Extra: dev
Provides-Extra: eval
Provides-Extra: fastembed
Provides-Extra: gliner
Provides-Extra: graphrag
Provides-Extra: langchain
Provides-Extra: llama-index
Provides-Extra: llmlingua
Provides-Extra: loaders
Provides-Extra: qdrant
Provides-Extra: rebel
Provides-Extra: sealed
Provides-Extra: sealed-test
Provides-Extra: sparse
Provides-Extra: starter
Provides-Extra: ui
License-File: LICENSE
Summary: General-purpose open-source RAG engine with multi-LLM, hybrid retrieval, GraphRAG, and MCP support
Keywords: rag,llm,embeddings,vector-search,knowledge-base,mcp,ollama,graphrag
Author: Open Source Contributor
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: API Reference, https://github.com/jyunming/Axon/blob/main/docs/API_REFERENCE.md
Project-URL: Advanced RAG, https://github.com/jyunming/Axon/blob/main/docs/ADVANCED_RAG.md
Project-URL: AxonStore Guide, https://github.com/jyunming/Axon/blob/main/docs/AXON_STORE.md
Project-URL: Code RAG Guide, https://github.com/jyunming/Axon/blob/main/docs/CODE_RAG_GUIDE.md
Project-URL: Documentation, https://github.com/jyunming/Axon/tree/main/docs
Project-URL: Getting Started, https://github.com/jyunming/Axon/blob/main/docs/GETTING_STARTED.md
Project-URL: Governance Console, https://github.com/jyunming/Axon/blob/main/docs/GOVERNANCE_CONSOLE.md
Project-URL: Homepage, https://github.com/jyunming/Axon
Project-URL: Issue Tracker, https://github.com/jyunming/Axon/issues
Project-URL: MCP Tools, https://github.com/jyunming/Axon/blob/main/docs/MCP_TOOLS.md
Project-URL: Offline Guide, https://github.com/jyunming/Axon/blob/main/docs/OFFLINE_GUIDE.md
Project-URL: Release Notes, https://github.com/jyunming/Axon/releases
Project-URL: Repository, https://github.com/jyunming/Axon
Project-URL: Security, https://github.com/jyunming/Axon/blob/main/SECURITY.md
Project-URL: Setup Guide, https://github.com/jyunming/Axon/blob/main/docs/SETUP.md

<div align="center">
  <img src="https://raw.githubusercontent.com/jyunming/Axon/main/docs/assets/repl-animation.gif" alt="Axon" width="400" />

  <h3>Your documents, answerable. On your hardware.</h3>

  <p>
    Drop in PDFs, code, spreadsheets, or URLs — ask anything, get cited answers from a local LLM.<br/>
    Nothing leaves your machine.
  </p>

  [![PyPI version](https://img.shields.io/pypi/v/axon-rag.svg)](https://pypi.org/project/axon-rag/)
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
  [![CI](https://github.com/jyunming/Axon/actions/workflows/ci.yml/badge.svg)](https://github.com/jyunming/Axon/actions/workflows/ci.yml)
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/jyunming/Axon/blob/main/LICENSE)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

</div>

---

<div align="center">
  <img src="https://raw.githubusercontent.com/jyunming/Axon/main/docs/assets/repl-demo.png" alt="Axon REPL startup" width="820" />
</div>

---

## 🤔 Why Axon?

Most RAG tools make you choose between **cloud power** and **data privacy**. Axon runs entirely on your hardware — full capability, zero egress.

- 🔒 **Private by default** — all inference runs locally via Ollama or vLLM. No API key, no upload, no telemetry.
- 📄 **Ingest anything** — 54 file formats (PDF, DOCX, Jupyter, code, images, URLs) in one command. SHA-256 dedup skips unchanged files.
- 🤖 **Works in your tools** — `@axon` in Copilot Chat, MCP for Claude Code / Codex / Gemini CLI / Cursor, Graph panel in VS Code or your browser.
- 🤝 **Built for teams** — share your knowledge base with signed, revocable read-only keys. Sealed (AES-256-GCM encrypted) sharing works safely through OneDrive, Dropbox, and Google Drive. Per-user permissions, full audit trail, no extra infrastructure. [Quick setup →](#sealed-sharing-quick-start)
- 🕸️ **See your knowledge as a graph** — interactive 3D entity-relationship graph. Embedded webview in VS Code; opens in your browser everywhere else. Click any node to jump to the exact source line.
- 🔬 **Production-grade retrieval** — hybrid search, reranking, HyDE, multi-query expansion, and automatic web fallback. Zero manual tuning.

---

## ✨ Capabilities

<table>
<tr>
<td width="50%" valign="top">

### 🔍 Retrieval
- Hybrid semantic + keyword search
- HyDE, multi-query, step-back, query decomposition
- Sentence-window context retrieval
- BGE reranker for second-pass precision
- Web fallback via Brave Search (CRAG-Lite)
- Smart per-question query routing

</td>
<td width="50%" valign="top">

### 🧠 Graph Intelligence
- **RAPTOR** — hierarchical corpus summaries
- **GraphRAG** — entity/relation/community graph (local / global / hybrid)
- **Code Graph** — file/class/function graph with import edges
- Interactive 3D graph — embedded webview in VS Code, browser elsewhere

</td>
</tr>
<tr>
<td width="50%" valign="top">

### 📥 Ingest Everything
- **54 file formats** — PDF, DOCX, XLSX, PPTX, Jupyter, images, 24 code formats
- URL ingestion — any public web page
- SHA-256 dedup skips unchanged files
- Stale detection for modified sources
- 4 content-aware chunking strategies

</td>
<td width="50%" valign="top">

### 🔧 LLMs & Embeddings
- **Local:** Ollama, vLLM
- **Cloud:** OpenAI, Gemini, xAI Grok, GitHub Copilot (API)
- Hot-swap provider and model — no restart needed
- Streaming on all providers
- 4 embedding providers; BGE-M3 for multilingual

</td>
</tr>
<tr>
<td width="50%" valign="top">

### 🏗️ Projects & Privacy
- Isolated knowledge base per project, with nesting
- Federated search across projects (`@projects`, `@mounts`, `@store`)
- **Strict offline / air-gapped mode** — zero outbound calls
- **AxonStore** — signed read-only sharing across OS users

</td>
<td width="50%" valign="top">

### ☁️ Cloud-Drive Sharing
**Sealed (AES-256-GCM encrypted) sharing works through any cloud sync drive.**
Files are ciphertext on disk — cloud providers see only encrypted bytes.

- OneDrive Personal / Business
- Dropbox
- Google Drive (Mirror mode)

→ [Sharing Guide](docs/SHARING.md) | [Quick Setup →](#sealed-sharing-quick-start)

</td>
</tr>
<tr>
<td width="50%" valign="top">

### 🛡️ Governance & Agents
- **Governance Console** — full audit trail of every query
- Graceful maintenance states: `normal → draining → readonly → offline`
- **REST API** — 70 endpoints with Swagger docs at `/docs`
- **MCP server** — 48 tools for Claude Code, Codex, Gemini, Cursor, Copilot
- **`@axon`** VS Code chat participant with Graph and Governance panels

</td>
</tr>
</table>

---

## ⚡ Quick Start

```bash
pip install "axon-rag[starter]"   # Python 3.10+. Includes UI, sealed sharing, extra loaders.
axon                              # First run auto-launches the setup wizard, then drops into the REPL.
```

That's it. The wizard configures your LLM provider, embedding model, and retrieval defaults; subsequent runs go straight to the REPL.

If something doesn't look right:

```bash
axon --doctor                     # Health checks: Python, Ollama, model pulled, store writable.
```

Local inference uses [Ollama](https://ollama.com). Cloud providers (OpenAI, Gemini, Grok, vLLM, GitHub Copilot) work via API keys.

**[→ Setup guide for VS Code, MCP, and cloud providers →](https://github.com/jyunming/Axon/blob/main/docs/SETUP.md)**

---

## 🔐 Sealed Sharing Quick Start

Share an encrypted knowledge base through OneDrive, Dropbox, or Google Drive. Cloud providers see only ciphertext.

```bash
pip install "axon-rag[sealed]"   # install sealed extra on both machines
```

**Owner (5 steps)**

```bash
axon --store-init "/path/to/OneDrive/AxonStore"  # 1. point store at sync folder
axon --store-bootstrap "your-passphrase"          # 2. bootstrap master key (once per machine)
axon --project-new research                       # 3. create project + ingest
axon --project research --ingest /docs
axon --project-seal research                      # 4. encrypt in place (≈1 s per 100 MB)
axon --share-generate research alice              # 5. print SEALED1:... string — send to grantee
```

**Grantee (3 steps)**

```bash
axon --store-init "/path/to/OneDrive/AxonStore"   # 1. same shared folder
axon --share-redeem "SEALED1:..."                  # 2. redeem — DEK stored in OS keyring
axon --project mounts/owner_research "question"   # 3. query; Axon decrypts to temp, wipes on exit
```

**[→ Full Sharing Guide](docs/SHARING.md)** — OneDrive setup, revocation, headless/Docker grantees, filesystem compatibility matrix.

---

## 🚀 Entry Points

| Command | Starts | Default Port | Best For |
|---------|--------|-------------|---------|
| `axon` | Interactive REPL | — | Day-to-day exploration, power users |
| `axon-api` | FastAPI REST server | `8000` | Agents, scripts, CI pipelines |
| `axon-mcp` | MCP stdio server | — | Any MCP-compatible agent (Claude Code, Codex, Gemini CLI, Cursor, Copilot…) |
| `axon-ui` | Streamlit UI | `8501` | Browser-based exploration |

---

## 🔌 VS Code + GitHub Copilot

<div align="center">
  <img src="https://raw.githubusercontent.com/jyunming/Axon/main/docs/assets/AxonCopilot.gif" alt="Axon Copilot integration" width="400" />
</div>

<br/>

<div align="center">
  <img src="https://raw.githubusercontent.com/jyunming/Axon/main/docs/assets/vscode-graph-panel.png" alt="Axon VS Code Graph Panel — answer, cited sources, and interactive 3D code graph" width="820" />
</div>

<br/>

Install the bundled VSIX to unlock the **`@axon` chat participant**, **Knowledge Graph panel**, **Code Graph panel**, and **Governance dashboard** — directly inside VS Code alongside Copilot.

```
Extensions panel  →  "..."  →  Install from VSIX...
→  run `axon-ext`  (or install from VSIX manually)
```

Or connect via MCP for Copilot agent mode — point `.vscode/mcp.json` at `axon-mcp` and all 48 tools appear in the agent hammer menu automatically.

> The VS Code extension surfaces **39 LM tools** to Copilot Chat, covering core RAG operations, sealed-store security, sharing, and governance.

**[Full setup guide →](https://github.com/jyunming/Axon/blob/main/docs/SETUP.md)**

---

## 🐍 Use Axon from Your Python Agent

Drop-in retrievers for LangChain and LlamaIndex agents — no REST round-trips, no extra process. Both wrap the same `AxonBrain.search_raw()` codepath the REST and REPL surfaces use, so hybrid search, reranking, HyDE, multi-query, and the GraphRAG budget apply automatically.

```python
# pip install "axon-rag[langchain]"
from axon import AxonBrain, AxonConfig
from axon.integrations.langchain import AxonRetriever

brain = AxonBrain(AxonConfig.from_yaml("config.yaml"))
retriever = AxonRetriever(brain=brain, top_k=5)

docs = retriever.invoke("what does the project do?")  # list[Document]
```

```python
# pip install "axon-rag[llama-index]"
from axon.integrations.llama_index import AxonLlamaRetriever

retriever = AxonLlamaRetriever(brain=brain, top_k=5)
nodes = retriever.retrieve("what does the project do?")  # list[NodeWithScore]
```

Per-call overrides (e.g. force HyDE for one question): `retriever.with_overrides({"hyde": True}).invoke(query)`.

---

## 📚 Documentation

**Getting started**

| | Guide | What it covers |
|-|-------|---------------|
| 🚀 | **[Getting Started](https://github.com/jyunming/Axon/blob/main/docs/GETTING_STARTED.md)** | First-time walkthrough — ingest, query, settings |
| ⚙️ | **[Setup Guide](https://github.com/jyunming/Axon/blob/main/docs/SETUP.md)** | Install, models, VS Code extension, MCP connection |
| 🔧 | **[Troubleshooting](https://github.com/jyunming/Axon/blob/main/docs/TROUBLESHOOTING.md)** | Common errors and platform-specific fixes |

**Reference**

| | Guide | What it covers |
|-|-------|---------------|
| 🔑 | **[Admin Reference](https://github.com/jyunming/Axon/blob/main/docs/ADMIN_REFERENCE.md)** | Every endpoint, REPL command, CLI flag, and config option |
| ⚡ | **[Quick Reference](https://github.com/jyunming/Axon/blob/main/docs/QUICKREF.md)** | Commands and flags at a glance |
| 📡 | **[API Reference](https://github.com/jyunming/Axon/blob/main/docs/API_REFERENCE.md)** | Full REST endpoint reference with request/response schemas |
| 🔌 | **[MCP Tools](https://github.com/jyunming/Axon/blob/main/docs/MCP_TOOLS.md)** | All 48 MCP tool signatures with parameter defaults |

**Deep dives**

| | Guide | What it covers |
|-|-------|---------------|
| 🤖 | **[Model Guide](https://github.com/jyunming/Axon/blob/main/docs/MODEL_GUIDE.md)** | Choosing LLM and embeddings; per-provider config examples |
| 🔬 | **[Advanced RAG](https://github.com/jyunming/Axon/blob/main/docs/ADVANCED_RAG.md)** | HyDE, RAPTOR, GraphRAG, CRAG-Lite — how each technique works |
| 🌐 | **[Web Search](https://github.com/jyunming/Axon/blob/main/docs/WEB_SEARCH.md)** | Brave Search integration, CRAG-Lite fallback setup |
| 🏝️ | **[Offline / Air-gap Guide](https://github.com/jyunming/Axon/blob/main/docs/OFFLINE_GUIDE.md)** | Full air-gap setup, model pre-download, local-assets-only mode |
| 💻 | **[Code RAG Guide](https://github.com/jyunming/Axon/blob/main/docs/CODE_RAG_GUIDE.md)** | Code graph retrieval and structural search |
| 🤝 | **[AxonStore](https://github.com/jyunming/Axon/blob/main/docs/AXON_STORE.md)** | Multi-user sharing, revocation, and the lease lifecycle |
| 🔐 | **[Sharing Guide](https://github.com/jyunming/Axon/blob/main/docs/SHARING.md)** | Plaintext and sealed sharing — which filesystems are safe, OneDrive/Dropbox/Google Drive setup, revocation |
| 📊 | **[Governance Console](https://github.com/jyunming/Axon/blob/main/docs/GOVERNANCE_CONSOLE.md)** | Audit trail, maintenance runbook, session management |
| 📈 | **[Evaluation Guide](https://github.com/jyunming/Axon/blob/main/docs/EVALUATION.md)** | RAGAS metrics, running evals, building testsets |
| 🛠️ | **[Development Guide](https://github.com/jyunming/Axon/blob/main/docs/DEVELOPMENT.md)** | Tests, contributing, pre-commit hooks, packaging & release |

---

## 🔒 Security

Ingestion is sandboxed to a configurable base directory (`RAG_INGEST_BASE`). Requests outside it are rejected with `403`. See [SECURITY.md](https://github.com/jyunming/Axon/blob/main/SECURITY.md).

## 📄 License

MIT — see [LICENSE](https://github.com/jyunming/Axon/blob/main/LICENSE).


