Knowledge Engine
An enterprise RAG pipeline built for documents that actually matter — with re-ranking, document lifecycle management, and a modular architecture you can swap piece by piece.
The problem it solves
Basic RAG is easy to prototype but fragile at scale. Documents get updated, chunks go stale, retrieval quality drops for long or ambiguous queries, and there's no clean way to update or remove a specific document without rebuilding the whole store. KnowledgeEngine addresses all of this.
How it works
Documents flow through an ingestion pipeline into pgvector. Retrieval uses cosine similarity to pull candidates, which are then re-ranked by a cross-encoder to improve precision. The LLM generates responses grounded in the re-ranked context. Every component — embedder, retriever, reranker, LLM — is modular and swappable. Documents have a full lifecycle: ingest, update, delete, re-embed.
What makes it interesting
The re-ranking step is often the difference between a RAG system that feels useful and one that feels like a keyword search with extra steps. The cross-encoder sees the full query and each candidate chunk together, which gives it much better relevance signal than embedding similarity alone. Adding that layer, and making it optional and configurable, was the core design challenge.