AskFiles - Multi-Tier RAG with Dual-Tier Cognitive Memory & Evidence Provenance
Resilient Multi-Tier RAG Architecture with Dual-Tier Cognitive Memory and Verifiable Evidence Provenance

Project Overview
AskFiles is a production-grade, multi-tenant Retrieval-Augmented Generation (RAG) system with sub-second citation provenance and verifiable document grounding, orchestrated via an event-driven background pipeline (asynchronous Inngest DAGs for deterministic text chunking, document hierarchy parsing, and batched high-dimensional vector embeddings in Qdrant Cloud).
The system features a resilient distributed LLM inference cascade (Google Gemini 2.5 Flash primary → Qwen 2.5 72B Instruct fallback → NVIDIA Nemotron 120B safety net) achieving sub-2s query latency with zero-downtime fault tolerance, coupled with a Sean Chen dual-tier cognitive memory architecture (episodic conversational continuity in PostgreSQL and background semantic interest distillation).
Key Features
- Sub-Second Citation Anchoring — Binds generated assertions to exact PDF page numbers (page_label) and section headers via regex-derived chunk metadata with interactive floating quote verification cards.
- Distributed LLM Inference Cascade — Zero-downtime failover cascade (Google Gemini 2.5 Flash → Qwen 2.5 72B Instruct → NVIDIA Nemotron 120B) with exponential backoff and telemetry tracking.
- Dual-Tier Cognitive Memory — Decouples multi-turn episodic history in serverless Neon PostgreSQL from background Inngest consolidation DAGs that distill user interests into persistent semantic profiles.
- Event-Driven Background Processing — Asynchronous Inngest DAGs for deterministic text chunking, document hierarchy parsing, and batched high-dimensional vector embeddings in Qdrant Cloud.
- Strict Multi-Tenant Isolation & TTL Reaper — Payload-level vector filtering via Qdrant MatchAny and automated background TTL reaper DAG that cleans up expired guest vectors and records after 2 hours.
Technical Highlights
- Granular Evidence Provenance — Regex-derived chunk metadata anchors citations to page labels, powering interactive floating quote cards and enforcing zero-hallucination out-of-domain boundaries.
- Decoupled Memory Architecture — Maintains longitudinal personalization across multi-turn sessions in Neon PostgreSQL without recurrent context window bloat.
- Self-Healing Query Completion — Eliminates single-provider fragility and HTTP 429 rate limits via cross-model family routing across heterogeneous providers via OpenRouter.
- Automated Vector Lifecycle Management — Enforces strict payload-level isolation and background reaper DAGs to prevent data leakage and storage bloat.
Challenges & Solutions
Tech Stack Breakdown
frontend
React 18, Vite, Tailwind CSS, TypeScript
backend
Python, FastAPI, LlamaIndex, Inngest (Event-Driven DAGs)
database
Qdrant Cloud (Vector DB), Neon PostgreSQL
infrastructure
Docker, OpenRouter, Vercel
tools
Google Gemini 2.5 Flash, Qwen 2.5 72B, NVIDIA Nemotron 120B, JWT, Bcrypt