A Rust-based RAG (Retrieval-Augmented Generation) system with llama.cpp integration using the lancor crate.
- Document ingestion and chunking
- Vector embeddings using llama.cpp
- PostgreSQL with pgvector for similarity search
- Interactive chat with conversation history
- HTTP API server
- CLI interface
- Install PostgreSQL with pgvector extension
- Copy
.env.exampleto.envand configure - Run migrations:
cargo run -- db up - Ingest documents:
cargo run -- ingest -s /path/to/docs - Start server:
cargo run -- serve - Or use interactive chat:
cargo run -- chat
First start a PostgreSQL + pgvector server:
docker run --detach --name db --publish 5432:5432 \
-e POSTGRES_USER=myuser \
-e POSTGRES_PASSWORD=mypassword \
-e POSTGRES_DB=mydb \
pgvector/pgvector:pg17
Then enable the pgvector extension:
docker exec -it db psql -U myuser -d mydb
mydb=# CREATE EXTENSION IF NOT EXISTS vector;
With donda:
# Database operations
donda db up
donda db status
# Ingest documents
donda ingest -s ./knowledge-base -m text
# Start HTTP server
donda serve -H 0.0.0.0 -p 7070
# Interactive chat
donda chat
# Show version
donda version
GET /health- Health checkPOST /chat- Chat endpoint{ "message": "Your question here", "conversation_id": "optional-conversation-id" }
and most importantly tichy, donda began life as a rewrite of tichy in Rust.
GPL-3.0