Production-Grade AI Search Engine (RAG + LangGraph)

Featured

Production-grade AI search engine with real-time web retrieval and streaming AI synthesis

A production-grade, Perplexity-style research assistant that combines real-time web retrieval, intelligent source ranking, and streaming AI synthesis with inline citations. Built with LangGraph for RAG orchestration, OpenAI GPT-4.1-mini for answer generation, and Next.js 16 with Edge Runtime for real-time streaming.

FastAPIGoJavaScriptLangChainLangGraphNext.jsOpenAIPostgreSQLPythonRailwayReactRedisRustSupabaseTailwind CSSTypeScriptVercelWebSocketshadcn/ui

What it does

Production-grade AI search engine that combines real-time web retrieval, intelligent source ranking, and streaming AI synthesis to deliver comprehensive, cited answers instantly using RAG orchestration

Best for

Researchers, students, and professionals who need fast, comprehensive answers with source citations and real-time information from the web

Output

Full-stack AI search platform with Next.js 16 frontend, FastAPI backend with LangGraph RAG orchestration, Supabase PostgreSQL database, and Upstash Redis caching

Problem

  • Traditional LLM chat interfaces:
  • Hallucinate facts
  • Don't cite sources
  • Lack transparency and trust
  • Feel slow or opaque during generation
  • Search engines, on the other hand:
  • Return links, not synthesized answers
  • Require manual verification and reading
  • Break research flow
  • The challenge was to combine the strengths of search engines and LLMs while avoiding their weaknesses — in a way that feels fast, transparent, and trustworthy.

Solution

I designed and built a multi-stage Retrieval-Augmented Generation (RAG) system that:

  • 1. Retrieves fresh web data in real time
  • 2. Ranks and analyzes sources for credibility
  • 3. Streams a synthesized answer with inline citations
  • 4. Allows users to continue the conversation with context preserved

The result is an AI search experience that feels:

  • Immediate (streaming)
  • Trustworthy (citations + ranked sources)
  • Usable for real research, not just exploration
Langgraph Real Time AI Search Engine homepage
Click to view full size

My Role

End-to-end AI Engineer (architecture, backend, frontend, deployment)

Technical Architecture

AI & RAG Layer

  • LangGraph orchestrates a multi-stage pipeline:

  • Search → Fetch → Extract → Rank → Synthesize
  • OpenAI GPT-4.1-mini generates grounded answers with inline citations
  • Heuristic source ranking based on:

  • Domain quality
  • Content length
  • Relevance and provider rank
  • Inline citation grounding ensures every claim is traceable

Backend

  • FastAPI (Python, async) for high-performance orchestration
  • Server-Sent Events (SSE) for real-time streaming responses
  • Redis (Upstash) for:

  • Search result caching
  • Content caching
  • Rate limiting
  • Supabase (PostgreSQL) for:

  • Queries
  • Sources
  • Citations
  • Conversations
  • Collections

Frontend

  • Next.js 16 + React 19
  • Edge Runtime for low-latency streaming
  • Streaming UI with progressive answer rendering
  • Source panel with credibility indicators
  • Dark/light mode, keyboard shortcuts, mobile-first UX

Deployment

  • Vercel (frontend + Edge Functions)
  • Railway (backend API)
  • Fully cloud-native, production-ready setup

Impact

This project demonstrates how to build trustworthy AI systems by design:

  • Eliminates hallucinations by grounding answers in retrieved sources

  • Improves research speed by synthesizing information instantly

  • Increases transparency through ranked sources and inline citations

  • Enables deeper exploration via follow-up questions and collections

This is built to production standards:

  • Rate limiting

  • Caching

  • Error handling

  • Accessibility

  • Performance optimization (90+ Lighthouse scores)

Challenges & Key Decisions

  • Streaming architecture: Designing token-level streaming across Edge → API → UI
  • Source ranking: Balancing relevance vs domain credibility
  • Latency vs quality: Optimizing retrieval depth without slowing UX
  • Trust & UX: Making AI reasoning visible without overwhelming users
  • Scalability: Schema-isolated storage and cache-aware retrieval for future multi-tenant use
  • These trade-offs mirror real decisions faced in production AI systems.

What This Project Demonstrates

  • End-to-end AI product engineering
  • Advanced RAG orchestration with LangGraph
  • Real-time streaming LLM UX
  • Full-stack ownership (AI, backend, frontend, infra)
  • A production mindset: reliability, performance, and trust
  • This project clearly separates AI engineering from simple prompt-based applications.

Tech Stack

Frontend

JavaScriptNext.jsReactTailwind CSSTypeScriptshadcn/ui

Backend

FastAPIGoPython

Data & Infrastructure

PostgreSQLRedisSupabase

AI & ML

LangChainLangGraphOpenAI

Tools & Infrastructure

RailwayVercelWebSocket

Highlights

  • Real-Time Web Retrieval — Queries Serper or Brave Search for fresh web results
  • Intelligent Source Ranking — Heuristic-based ranking with domain quality analysis
  • Streaming AI Synthesis — GPT-4.1-mini generates answers with inline citations in real-time
  • Source Grounding — Every claim is backed by ranked sources with visual credibility indicators
  • Conversational Continuity — Continue the conversation with AI after receiving answers
  • Search Collections — Organize searches into custom collections with AI-generated tags
Derril Filemon — Senior AI Engineer & Full-Stack Developer