Skip to main content
This walks the production path: PostgreSQL + pgvector + Neo4j with the default VectorCypher engine. For embedded options (SQLite + LanceDB), see Configuration.
1

Install Khora

The Khora library requires Python version 3.13+ 
2

Setup databases

As Khora is meant to be used as a library, it has no built-in server and is made to work with existing databases.For local development, the Khora repo ships a compose.yaml that get’s you up and running with our recommended stack: Postgres (with pgvector) and Neo4j 
Then export connection URLs via environment variables in .env
3

Run migrations

Khora ships its schema as Alembic migrations. Run them once per database:
Or instantiate Khora(..., run_migrations=True) to apply on connect under an advisory lock, useful for single-process apps and tests.
4

Store a memory

remember() runs the 3-phase ingestion pipeline (stage → enrich → expand). recall() returns a RecallResult projection with chunks (typed RecallChunk), entities, relationships, and documents (deduplicated source documents). Build prompt context by iterating result.chunks. Each carries .content, .score, .id, and .document_id.
5

Batch ingestion (optional)

For higher throughput, stage documents and let a background processor pick them up:
The processor is opt-in. Read-only services don’t need it.
Pre-fetch the reranker model. Reranking is on by default, so the first recall() that runs it downloads the cross-encoder BAAI/bge-reranker-v2-m3 from Hugging Face (a couple of gigabytes). Pre-fetch it so that first query doesn’t pay the download cost, using the hf CLI:
Pin a different model with KHORA_QUERY_RERANKING_MODEL, or turn reranking off with KHORA_QUERY_ENABLE_RERANKING=false.

Next steps

Configuration

Every KHORA_* knob: storage, LLM, pipeline, query, telemetry.

VectorCypher

How the retrieval engine fuses vector, graph, and keyword search with query routing and RRF.