Skip to main content
Zeus’s knowledge base system implements Agentic RAG (Retrieval-Augmented Generation), enabling the Agent to proactively retrieve relevant information from user-uploaded documents. Unlike traditional RAG, Zeus’s knowledge base is a specialized tool for the Agent — the Agent autonomously decides when to invoke retrieval, supports multi-turn queries and result verification, and works in concert with other tools (code execution, web search, etc.).

Core Architecture

The system uses a dual-path recall strategy combining vector semantic search + BM25 keyword matching, with results merged and ranked via RRF (Reciprocal Rank Fusion) for optimal results.

Technology Stack

ComponentTechnologyDescription
Vector StorePostgreSQL pgvector (langchain-postgres PGVector)Vector storage + metadata filtering with cosine similarity
EmbeddingOpenAI text-embedding-3-small (default)Supports user-configurable embedding models
Keyword RetrievalBM25 (rank-bm25 + jieba Chinese tokenizer)3-tier cache (Memory → Redis → PostgreSQL), lazy-loaded
Document ParsingLangChain Document Loaders + SmartChunkerMulti-format support + semantically-aware chunking
Metadata StorageNext.js API (Drizzle ORM + PostgreSQL)Knowledge base / document CRUD
Agent FrameworkDeepAgents (LangGraph)Agentic RAG tool integration

Data Flow Overview