InsightForge: AI-Powered Business Intelligence Assistant with LangChain, RAG, and LLMs
Most businesses generate mountains of data — sales records, regional performance, customer demographics — but lack the tools or expertise to extract meaningful insights from it. InsightForge was built to change that: a conversational Business Intelligence Assistant that lets any user query their data in plain English and receive structured, actionable insights in seconds. Built on LangChain and LangGraph, InsightForge combines Retrieval-Augmented Generation (RAG) with OpenAI GPT-4 to ground every response in real business data rather than hallucinated answers. A three-way query router intercepts each request before any LLM call — directing chart requests to a ChartEngine, aggregation queries to DuckDB SQL, and open-ended reasoning to the full RAG pipeline. This dramatically reduces latency and API costs while maintaining response quality. The system also features a dual-layer memory architecture for coherent multi-turn conversations, semantic chunking by business domain for precise retrieval, and a QAEvalChain evaluator that scores every response across accuracy, completeness, relevance, and business value. The frontend is built with Next.js 13 and Nivo Charts, backed by a FastAPI REST API and PostgreSQL with pgvector for semantic search. Click here for detailed post.