Multimodal AI Assistant
Enterprise Conversational Intelligence & Stateful Agent Platform
The Engineering Problem
A high-performance full-stack conversational intelligence platform powered by Next.js and FastAPI—featuring NDJSON token streaming, stateful agent workflows orchestrated via LangGraph, in-memory multi-format document ingestion, and persistent thread checkpointing backed by PostgreSQL.
- ▶Low-latency Time to First Byte (TTFB) achieved via asynchronous FastAPI StreamingResponse and NDJSON chunking.
- ▶Durable conversational state persistence across process restarts via AsyncPostgresSaver.
- ▶Stateless in-memory file parsing eliminating temporary disk storage and I/O bottlenecks.
Provides a directed cyclic state machine with thread-level AsyncPostgresSaver checkpointing and automatic context window summarization when message limits are reached.
Parses PPTX, DOCX, XLSX, PDFs, images, and code directly in RAM, completely eliminating disk I/O latency and storage leak vectors.
Asynchronous FastAPI StreamingResponse dispatches raw token chunks with low latency and instant client-side cancellation support.
Cross-origin SameSite=None cookie security with 1-click Guest Mode generating instant trial UUID sessions without registration friction.
HOVER NODES TO INSPECT SERVICE BOUNDARIES AND IMPLEMENTATION DETAILS
Next.js / TypeScript / Shadcn UI
FastAPI / Python / Uvicorn
LangGraph / LangChain
PyPDF2 / python-docx / openpyxl
Google Gemini SDK
PostgreSQL / AsyncPostgresSaver
Streams NDJSON tokens and renders Markdown dispatches with Prism syntax highlighting.



4 MASTER SUBSYSTEMS — 3 DATABASE TABLES — 11 API ENDPOINTS
StateGraph state machine executing conversation routing, web search tool dispatches, and automatic context window summarization.
In-memory RAM parsing of PPTX, DOCX, XLSX, PDF, Vision Images, and source code files via io.BytesIO without disk writes.
Asynchronous NDJSON SSE token chunk generator powered by FastAPI StreamingResponse with keepalive heartbeat.
Stateful JWT auth with HTTP-Only SameSite=None cookies, 1-click Guest Trial UUID generation, and PostgreSQL session persistence.
Cyclic Reasoning & LangGraph State Safety
Multi-turn agent conversations required complex state preservation without losing context or looping infinitely during tool calls.
Architected a LangGraph StateGraph utilizing PostgreSQL-backed AsyncPostgresSaver checkpointing to persist graph states after every execution step.
Real-Time NDJSON SSE Token Streaming
Standard HTTP REST responses caused long latency delays while waiting for complete LLM completion dispatches.
Integrated Server-Sent Events (SSE) from FastAPI StreamingResponse, streaming raw NDJSON token chunks with low latency directly to Next.js components.
Stateless Multi-Format Ingestion in RAM
Writing user-uploaded documents (PPTX, DOCX, XLSX, PDF) to disk caused I/O bottlenecks and potential storage leak vectors.
Engineered in-memory file stream processing using Python io.BytesIO, extracting text and images directly in RAM before passing to Gemini API.