PythonProduction Verified

ContextForge

Production AI Retrieval & Evaluation Platform

Role

Lead AI Engineer: LangGraph retrieval pipeline, Redis semantic cache, RAGAS benchmark engine

Primary Stack

Python · LangGraph · FastAPI · Redis · RAGAS · PostgreSQL · OpenAI API

View on GitHub →

Production RAG systems frequently suffer from silent hallucinations and high token costs because they lack query intent routing, semantic caching, and systematized RAGAS metric evaluation.

CONSTRAINT 01

100K+ enterprise document corpus with multi-tenant search isolation

CONSTRAINT 02

Redis semantic caching to slash repeat LLM embedding and token costs

CONSTRAINT 03

Continuous automated RAGAS evaluation pipeline (faithfulness, answer relevance)

Why Redis semantic cache over raw database lookups?

40% of user queries in technical documentation are semantically identical rephrasings. By calculating cosine similarity against historical query embeddings in Redis with a 0.92 threshold, we return cached answers in 14ms while cutting OpenAI API costs by 40%.

Why automated RAGAS evaluation on every deployment?

Small tweaks to chunk size or prompt templates often cause subtle regressions. ContextForge runs automated RAGAS test suites (measuring Context Recall, Context Precision, and Faithfulness) as a mandatory CI/CD gate before deploying new retrieval pipelines.

● LIVE INTERACTIVE

Distributed System Architecture

Explore the multi-tier topology below. Switch between the interactive blueprint canvas, standard Mermaid.js flowcharts, and the step-by-step request simulator.

ContextForge System Blueprint
TOPOLOGY:

Two-stage hybrid retrieval architecture with query classification routing, Redis semantic caching, LangGraph reranking, and RAGAS evaluation gates.

🌐INGRESS PLANEFastAPI gateway with semantic query classifier
↓ DATA PIPELINE FLOW
BROKER & PIPELINERedis vector cache for sub-15ms repeat query recall
↓ DATA PIPELINE FLOW
⚙️COMPUTE & AGENT ENGINEDense/sparse hybrid search with cross-encoder reranking
↓ DATA PIPELINE FLOW
💾PERSISTENCE & STATEPostgreSQL pgvector partitions & document metadata
↓ DATA PIPELINE FLOW
📡TELEMETRY & ALERTSContinuous faithfulness scoring and latency telemetry
ingress planeACTIVE

FastAPI Query Router

FastAPI / Uvicorn

Component Role & Scope

Classifies user intent (fact lookup vs multi-hop synthesis) and assigns optimal retrieval strategy.

🛡 Fault Tolerance & Recovery

Falls back to standard hybrid search if intent classifier is ambiguous.

Topology Linkages (1)

● Root Edge Component (Direct client intake)
→ Egress toredis-cache

Checks semantic cache for existing query embedding

Click any node on canvasLive Synchronized
100K+documents indexed
-38%hallucination reduction
-40%token cost reduction

Engineering Post-Mortem & Next Iteration

I would implement contextual compression embeddings at the chunking stage to reduce prompt token sizes by another 30%.