Back to Projects
Applied AI & Developer Tools • 2026The Vision & Architecture
Semantically index repositories & chat with codebases
with zero-waste streaming RAG.
Monocle transforms GitHub repositories into conversational, live-indexed knowledge engines. Powered by a custom zero-waste RAG pipeline, Neon Serverless Postgres with pgvector, and Google Gemini 2.5 Flash, developers can query complex multi-file architectures with sub-second streamed answers, exact line numbers, and verified file citations.
Core Capabilities
Zero-Waste RAG Pipeline
Extracts AST and code chunks, directly embedding them with gemini-embedding-001 (768-dim vectors) into Neon pgvector, consuming zero text-generation quota during repository indexing.
Sub-Second Streaming Code Chat
Delivers rapid Time-To-First-Token via @ai-sdk/google and Vercel AI SDK, injecting global repository file tree maps alongside vector matches for full architectural context.
Decoupled Background Ingestion
BullMQ job dispatcher over Upstash Redis deduplicates concurrent indexing requests using deterministic job IDs (repo-index-${projectId}) with exponential backoff.
Automated Commit Diff Tracking
Polls real-time commit diffs via Octokit REST with semantic heuristic fallbacks and dynamic contextual questions tailored uniquely to the codebase.
Live Idempotent Credit System
Stripe webhook-verified credit allocations with real-time balance synchronization across topbar, sidebar, and dashboard metric grids via tRPC cache invalidation.
Technology Stack
Architectural Decisions
Direct AST embedding over LLM-based chunk summarization
Embedding raw AST chunks directly saves API generation quota and eliminates summarization hallucinations during repository ingestion.
BullMQ queue decoupling over synchronous API handlers
Large repository ingestion spans minutes; decoupling work to asynchronous background queues avoids serverless gateway timeouts.