An AI-powered financial analysis assistant with document intelligence, RAG queries, agentic workflows, and data visualization.
- π¬ Chat Interface β ChatGPT-like UI with streaming responses, markdown rendering, and code highlighting
- π Document Upload β Upload PDFs, CSVs, Excel, and PowerPoint files for AI analysis
- π RAG Queries β Ask questions over uploaded documents with retrieval-augmented generation
- π€ Multi-Agent Workflows β AutoGen-style agents for financial analysis, document parsing, and visualization
- π Chart Generation β AI-generated matplotlib charts returned as interactive images
- πͺ Document Mirror β Reconstruct and transform document structures (slides, tables, summaries)
- π Dark & Light Themes β Glassmorphism UI with smooth transitions
- πΎ Chat History β Persistent conversations with rename/delete support
- βοΈ Flexible LLM Backend β Works with OpenAI, vLLM, or any OpenAI-compatible API
βββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js Frontend (:3000) β
β app/page.tsx β app/layout.tsx β globals.cssβ
β TailwindCSS + Framer Motion + React Markdownβ
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β HTTP / SSE
ββββββββββββββββββββΌβββββββββββββββββββββββββββ
β FastAPI Backend (:8000) β
β api.py β
β βββββββββββββββββββββββββββββββββββββββ β
β β /chat β Streaming LLM responses β β
β β /upload β File ingestion + embed β β
β β /query β RAG-based Q&A β β
β β /agent β Multi-agent workflows β β
β β /plot β Chart generation β β
β β /docs β Document management β β
β βββββββββββββββββββββββββββββββββββββββ β
β FAISS Vector DB β File Storage β
βββββββββββββββββββββββββββββββββββββββββββββββ
β
OpenAI-compatible API
ββββββββββββββββΌβββββββββββββββ
β β β
OpenAI API vLLM Local Custom API
- Node.js 18+ and npm
- Python 3.10+
- An OpenAI API key OR a running vLLM server
# Clone the repository
cd Finance-ai
# Install frontend dependencies
npm install
# Install backend dependencies
pip install -r requirements.txt# Start FastAPI server
uvicorn api:app --host 0.0.0.0 --port 8000 --reloadThe API will be available at http://localhost:8000.
API docs: http://localhost:8000/docs
# In a new terminal
npm run devOpen http://localhost:3000 in your browser.
Open the Settings panel (βοΈ icon) in the app and enter:
| Setting | OpenAI | vLLM Local |
|---|---|---|
| API Key | sk-... |
any-string (ignored) |
| API URL | https://api.openai.com/v1 |
http://localhost:8001/v1 |
| Model | gpt-4 |
Your model name (e.g. meta-llama/Meta-Llama-3-8B) |
{
"api_key": "sk-proj-...",
"api_url": "https://api.openai.com/v1",
"model": "gpt-4"
}First, start vLLM:
python -m vllm.entrypoints.openai.api_server \
--model meta-llama/Meta-Llama-3-8B-Instruct \
--host 0.0.0.0 \
--port 8001Then configure the app:
{
"api_key": "not-needed",
"api_url": "http://localhost:8001/v1",
"model": "meta-llama/Meta-Llama-3-8B-Instruct"
}{
"api_key": "your-api-key",
"api_url": "https://api.together.xyz/v1",
"model": "mistralai/Mixtral-8x7B-Instruct-v0.1"
}Finance-ai/
βββ app/
β βββ page.tsx # Complete frontend (single file)
β βββ layout.tsx # Root layout
β βββ globals.css # Global styles + animations
βββ api.py # Complete backend (single file)
βββ package.json # Frontend dependencies
βββ requirements.txt # Python dependencies
βββ next.config.js # Next.js config with API proxy
βββ tailwind.config.ts # TailwindCSS config
βββ postcss.config.js # PostCSS config
βββ tsconfig.json # TypeScript config
βββ README.md # This file
Finance-ai/
βββ uploads/ # Uploaded documents
βββ vector_db/ # FAISS indexes
βββ metadata.json # Document metadata
| Method | Endpoint | Description |
|---|---|---|
POST |
/chat |
Streaming LLM chat (SSE) |
POST |
/upload |
Upload & ingest documents |
POST |
/query |
RAG-based Q&A over documents |
POST |
/agent |
Multi-agent workflow execution |
POST |
/plot |
Generate charts from data |
GET |
/documents |
List all uploaded documents |
DELETE |
/documents/{id} |
Delete a document |
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "Explain EBITDA"}],
"api_key": "sk-...",
"api_url": "https://api.openai.com/v1",
"model": "gpt-4"
}'curl -X POST http://localhost:8000/upload \
-F "file=@financial_report.pdf"curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{
"query": "What were the Q3 revenue figures?",
"document_id": "abc-123",
"api_key": "sk-...",
"api_url": "https://api.openai.com/v1",
"model": "gpt-4"
}'The /agent endpoint runs an AutoGen-style pipeline:
User Query
β
βΌ
ββββββββββββββββββββ
β Document Parser β Extracts and structures document content
β Agent β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Data Analyst β Analyzes financial data, generates insights
β Agent β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Visualization β Creates charts and visual representations
β Agent β
ββββββββββ¬ββββββββββ
β
βΌ
Final Output (streamed via SSE)
Each agent step is streamed as an SSE event so the frontend can display progress in real-time.
- Next.js 14 β React framework (App Router)
- TailwindCSS β Utility-first styling
- Framer Motion β Animations
- React Markdown β Markdown rendering
- Lucide React β Icons
- FastAPI β Async Python web framework
- FAISS β Vector similarity search
- LangChain β LLM orchestration
- Matplotlib β Chart generation
- OpenAI Python SDK β LLM integration
- OpenAI (GPT-4, GPT-3.5)
- vLLM (any HuggingFace model)
- Any OpenAI-compatible API
MIT License β feel free to use and modify.