Metadata-Version: 2.3
Name: voice-rag
Version: 0.1.0
Summary: Provider-agnostic voice RAG pipeline. Plug in your voice provider, LLM, vector store, and document parsers.
Project-URL: Homepage, https://github.com/kytona/voice-rag
Project-URL: Repository, https://github.com/kytona/voice-rag
Project-URL: Changelog, https://github.com/kytona/voice-rag/blob/main/CHANGELOG.md
Author-email: Gaurang Torvekar <info@kytona.com>
Maintainer-email: Kytona Limited <info@kytona.com>
License: MIT
Keywords: ai,chatbot,elevenlabs,fastapi,llm,qdrant,rag,retrieval,vector-search,voice
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: click>=8.0.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: fastembed>=0.6.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: openai>=1.0.0
Requires-Dist: pydantic-settings>=2.2.1
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: qdrant-client>=1.10.0
Requires-Dist: uvicorn>=0.27.0
Provides-Extra: all
Requires-Dist: anthropic>=0.40.0; extra == 'all'
Requires-Dist: deepgram-sdk>=3.0.0; extra == 'all'
Requires-Dist: elevenlabs>=1.0.0; extra == 'all'
Requires-Dist: google-genai>=1.0.0; extra == 'all'
Requires-Dist: pymupdf>=1.24.0; extra == 'all'
Requires-Dist: python-docx>=1.0.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40.0; extra == 'anthropic'
Provides-Extra: deepgram
Requires-Dist: deepgram-sdk>=3.0.0; extra == 'deepgram'
Provides-Extra: dev
Requires-Dist: anthropic>=0.40.0; extra == 'dev'
Requires-Dist: deepgram-sdk>=3.0.0; extra == 'dev'
Requires-Dist: elevenlabs>=1.0.0; extra == 'dev'
Requires-Dist: google-genai>=1.0.0; extra == 'dev'
Requires-Dist: pymupdf>=1.24.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: python-docx>=1.0.0; extra == 'dev'
Provides-Extra: docx
Requires-Dist: python-docx>=1.0.0; extra == 'docx'
Provides-Extra: elevenlabs
Requires-Dist: elevenlabs>=1.0.0; extra == 'elevenlabs'
Provides-Extra: gemini
Requires-Dist: google-genai>=1.0.0; extra == 'gemini'
Provides-Extra: pdf
Requires-Dist: pymupdf>=1.24.0; extra == 'pdf'
Description-Content-Type: text/markdown

# voice-rag

[![PyPI version](https://img.shields.io/pypi/v/voice-rag)](https://pypi.org/project/voice-rag/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/kytona/voice-rag/blob/main/LICENSE)
[![Python](https://img.shields.io/pypi/pyversions/voice-rag)](https://pypi.org/project/voice-rag/)

`voice-rag` is a Python package for voice-oriented RAG pipelines: ingest local documents, store them in Qdrant, serve an OpenAI-style chat-completions webhook, and swap voice or LLM providers behind a stable interface.

## What it includes

- Python SDK via `KnowledgeAgent`
- CLI for `init`, `ingest`, `serve`, `query`, `inspect`, and `doctor`
- Built-in voice adapters for `elevenlabs` and `deepgram`
- Built-in LLM clients for `openai`, `anthropic`, and `gemini`
- Built-in parsers for `.txt`, `.md`, `.pdf`, and `.docx`
- Qdrant vector store integration with hybrid dense + BM25 retrieval

## Quickstart

```bash
pip install "voice-rag[elevenlabs]"
export OPENAI_API_KEY=your_api_key_here
voice-rag init
```

Edit `voice-rag.yaml`, then ingest and serve:

```bash
voice-rag ingest ./data/sample_docs/claude-code-changelog.md --recreate
voice-rag serve
```

Point your voice platform to `http://localhost:8000/v1` if it expects an OpenAI-style Custom LLM endpoint.
By default, `voice-rag` uses an embedded local Qdrant store in `.qdrant`, so you do not need to start a separate Qdrant server unless you set `vector_store.url`.

## CLI

```bash
voice-rag init [--dir PATH]
voice-rag ingest <path> [--recreate] [--config PATH]
voice-rag serve [--host HOST] [--port PORT] [--reload] [--config PATH]
voice-rag query <text> [--limit N] [--config PATH]
voice-rag inspect [--config PATH]
voice-rag doctor
```

## Python API

```python
from voice_rag import KnowledgeAgent, VoiceRagConfig

config = VoiceRagConfig()
agent = KnowledgeAgent(config=config)
agent.ingest("./docs", recreate=True)
app = agent.create_app()
```

## Configuration

`voice-rag` reads configuration from `voice-rag.yaml` and environment variables. It does not auto-load `.env` files.

| Key                                 | Env                            | Default                    |
| ----------------------------------- | ------------------------------ | -------------------------- |
| `llm.api_key` / `embedding.api_key` | `OPENAI_API_KEY`               | (required for OpenAI)      |
| `llm.provider`                      | `LLM_PROVIDER`                 | `openai`                   |
| `llm.model`                         | `LLM_MODEL`                    | `gpt-4o-mini`              |
| `embedding.model`                   | `EMBEDDING_MODEL`              | `text-embedding-3-small`   |
| `vector_store.url`                  | `VECTOR_STORE_URL`             | empty; use local `.qdrant` |
| `vector_store.collection_name`      | `VECTOR_STORE_COLLECTION_NAME` | `knowledge_base`           |
| `vector_store.local_path`           | `VECTOR_STORE_LOCAL_PATH`      | `.qdrant`                  |
| `server.port`                       | `SERVER_PORT`                  | `8000`                     |

See [voice-rag.yaml](https://github.com/kytona/voice-rag/blob/main/voice-rag.yaml) for the full schema.

## Development

```bash
pip install -e ".[all,dev]"
pytest tests/ -v
```

Use [CONTRIBUTING.md](https://github.com/kytona/voice-rag/blob/main/CONTRIBUTING.md) for connector and packaging guidelines.

## Publishing to PyPI

With `PYPI_TOKEN` and the `release` environment configured in the repo, push a version tag to trigger the GitHub Actions workflow:

```bash
git tag v0.1.0
git push origin v0.1.0
```

The workflow runs smoke test → build → publish to PyPI.
