Update docs

This commit is contained in:
Yiorgis Gozadinos 2025-07-19 13:16:09 +03:00
parent 2347612fb6
commit a6595b1597
No known key found for this signature in database
2 changed files with 32 additions and 2 deletions

View file

@ -10,6 +10,7 @@ Retrieval-Augmented Generation (RAG) library on SQLite.
- **Multiple embedding providers**: Ollama, VoyageAI, OpenAI
- **Multiple QA providers**: Ollama, OpenAI, Anthropic
- **Hybrid search**: Vector + full-text search with Reciprocal Rank Fusion
- **Reranking**: Optional result reranking with MixedBread AI or Cohere
- **Question answering**: Built-in QA agents on your documents
- **File monitoring**: Auto-index files when run as server
- **40+ file formats**: PDF, DOCX, HTML, Markdown, audio, URLs
@ -49,8 +50,8 @@ async with HaikuRAG("database.db") as client:
# Add document
doc = await client.create_document("Your content")
# Search
results = await client.search("query")
# Search (with optional reranking)
results = await client.search("query", rerank=True)
for chunk, score in results:
print(f"{score:.3f}: {chunk.content}")

View file

@ -103,6 +103,35 @@ QA_MODEL="claude-3-5-haiku-20241022" # or claude-3-5-sonnet-20241022, etc.
ANTHROPIC_API_KEY="your-api-key"
```
## Reranking
Reranking improves search quality by re-ordering the initial search results using specialized models. When enabled, the system retrieves more candidates (3x the requested limit) and then reranks them to return the most relevant results.
### MixedBread AI (Default)
```bash
RERANK=true
RERANK_PROVIDER="mxbai"
RERANK_MODEL="mixedbread-ai/mxbai-rerank-base-v2"
```
### Cohere
For Cohere reranking, install with Cohere extras:
```bash
uv pip install haiku.rag --extra cohere
```
Then configure:
```bash
RERANK=true
RERANK_PROVIDER="cohere"
RERANK_MODEL="rerank-v3.5"
COHERE_API_KEY="your-api-key"
```
## Other Settings
### Database and Storage