Hermes
A research assistant built for the SLIIT CodeFest AI Challenge to search, verify, and answer questions from the Ashen Era Archive.
Hermes was built for the SLIIT CodeFest AI Challenge by team TheKade. It is an agentic research assistant designed to answer multi-hop questions against the Ashen Era Archive while strictly citing its sources and handling factual disagreements between documents.
How it works
The system processes questions through a LangGraph pipeline with conditional routing:
- Guardrail: Performs intent checks so simple conversational greetings skip the retrieval pipeline entirely.
- Planner: Resolves conversation context, breaks down multi-hop questions, and generates targeted search queries.
- Retriever: Combines dense vector search (pgvector) and PostgreSQL full-text search using Reciprocal Rank Fusion (RRF), with results refined by a cross-encoder reranker and cached in Redis.
- Critic: Evaluates whether the retrieved evidence answers the user's question, whether another search hop is needed, or if the archive simply does not contain the answer. It stops early when evidence is missing rather than guessing.
- Arbitrator: Ranks sources based on a fixed authority hierarchy. If two documents contradict each other, it explicitly documents the disagreement instead of choosing a winner.
- Synthesizer: Streams a sourced Markdown answer to the user over Server-Sent Events (SSE).
Model budget and guardrails
To keep inference predictable and avoid runaway loops, model calls per question are strictly capped. The critic and retriever can loop up to a fixed maximum number of hops. When the archive does not have enough information to answer a question, the response explicitly says so instead of speculating.
Tech stack
- Backend: FastAPI, Python 3.11, LangGraph
- Database and Cache: PostgreSQL with pgvector, Redis
- Frontend: Next.js App Router with Server-Sent Events streaming