This is a local-first AI Toolkit consisting of two main applications:
- PDF Chat - RAG-powered document assistant to chat with PDF documents
- Data Analytics - AI-powered data visualization and analysis tool
The entire system runs locally with no cloud dependencies (except for free API tiers), making it privacy-focused and cost-effective.
- PDF Chat Application Features
- Data Analytics Application Features
- Technology Stack
- API Endpoints
- Technical Architecture
- How It Works
| # | Feature | Backend Function | Frontend Component | Model / API / Technology | Description |
|---|---|---|---|---|---|
| 1 | PDF Upload | main.py:44 - upload_pdf() |
App.tsx:140 - handleFile() |
PyMuPDF (fitz) | Extract text from PDF files using fitz.open() |
| 2 | Text Chunking | pdf_parser.py:14 - chunk_text() |
- | Custom algorithm | Split text into 500-word overlapping chunks (50-word overlap) |
| 3 | Vector Storage | rag.py:20 - store_chunks() |
- | ChromaDB + Sentence-Transformers (all-MiniLM-L6-v2) | Store document chunks as embeddings in ChromaDB vector database |
| 4 | RAG Retrieval | rag.py:37 - retrieve_chunks() |
- | ChromaDB | Retrieve top 3 most similar chunks using semantic search |
| 5 | Chat with PDF | actions.py:69 - chat_with_pdf() |
App.tsx:238 - sendQuestion() |
Ollama (Llama 3.2) | RAG-based Q&A using local LLM inference |
| 6 | Streaming Chat | actions.py:87 - stream_chat_with_pdf() |
api.ts:63 - streamChat() |
Server-Sent Events (SSE) | Token-by-token streaming response |
| 7 | Document Summary | actions.py:14 - generate_summary() |
App.tsx:215 - handleAction() |
Ollama (Llama 3.2) | Generate 3-5 paragraph summaries |
| 8 | Key Points | actions.py:56 - generate_key_points() |
App.tsx:215 |
Ollama (Llama 3.2) | Extract 8-10 important points as numbered list |
| 9 | Study Questions | actions.py:27 - generate_questions() |
App.tsx:215 |
Ollama (Llama 3.2) | Generate 10 insightful study questions |
| 10 | Quiz Generation | actions.py:40 - generate_quiz() |
App.tsx:215 |
Ollama (Llama 3.2) | Create 5-question multiple choice quiz |
| 11 | Flashcards | actions.py:114 - generate_flashcards() |
FlashCards.tsx |
Ollama (Llama 3.2) + JSON parsing | Generate 8 Q&A flashcards with flip animation |
| 12 | Mind Map | actions.py:155 - generate_mindmap() |
MindMap.tsx |
Groq API (Llama 3.3-70b) + React Flow | Visual mind map with 5-6 topics, interactive nodes |
| 13 | Voice Input | - | VoiceInput.tsx |
Web Speech API (SpeechRecognition) | Browser-based speech-to-text |
| 14 | Translation | Chat with prompt | App.tsx:319 - translateMessage() |
Ollama (Llama 3.2) | Translate to 10 languages (English, Hindi, Spanish, etc.) |
| 15 | Session Management | In-memory | App.tsx:29 - loadSessions() |
localStorage | Save/load/delete chat sessions |
| 16 | Dark/Light Mode | - | App.tsx:90 |
Tailwind CSS + localStorage | Theme persistence across sessions |
| 17 | Markdown Rendering | - | MarkdownMessage.tsx |
react-markdown | Render formatted markdown content |
| 18 | Chat Export | - | App.tsx:343 - exportChat() |
Blob + URL.createObjectURL | Export conversation as .txt file |
| # | Feature | Backend Function | Frontend Component | Model / API / Technology | Description |
|---|---|---|---|---|---|
| 1 | File Upload | main.py:177 - data_upload() |
DataPage.tsx:150 |
Pandas + openpyxl | Parse CSV and Excel (.xlsx, .xls) files |
| 2 | Table Preview | data_analyzer.py:17 - get_table_preview() |
DataPage.tsx |
Pandas | Display first 10 rows with column metadata |
| 3 | Column Statistics | data_analyzer.py:38 - get_column_stats() |
DataPage.tsx |
Pandas | Min/max/mean/median for numeric, unique count for text |
| 4 | Bar Chart | data_analyzer.py:76 - get_chart_data() |
DataPage.tsx |
Recharts | Bar chart visualization with aggregation |
| 5 | Line Chart | data_analyzer.py:76 |
DataPage.tsx |
Recharts | Line chart for trends |
| 6 | Area Chart | data_analyzer.py:76 |
DataPage.tsx |
Recharts | Area chart visualization |
| 7 | Pie Chart | data_analyzer.py:76 |
DataPage.tsx |
Recharts | Pie chart for distribution |
| 8 | Scatter Plot | data_analyzer.py:76 |
DataPage.tsx |
Recharts | Scatter plot for correlation |
| 9 | Multi-Chart | data_analyzer.py:90 - get_multi_chart_data() |
DataPage.tsx |
Recharts | Compare multiple metrics on same axis |
| 10 | Top N Analysis | data_analyzer.py:106 - get_top_n() |
DataPage.tsx |
Pandas | Top/bottom N values sorted and visualized |
| 11 | Anomaly Detection | data_analyzer.py:123 - detect_anomalies() |
DataPage.tsx |
IQR Method | Detect outliers using Interquartile Range (1.5×IQR) |
| 12 | AI Summary | main.py:246 - data_summary() |
DataPage.tsx |
Ollama (Llama 3.2) | LLM-generated business insights |
| 13 | AI Chat | main.py:285 - data_chat() |
DataPage.tsx |
Ollama (Llama 3.2) | Natural language queries on dataset |
| 14 | Aggregation | data_analyzer.py:63 - _aggregate() |
- | Pandas groupby | Sum, mean, or count aggregation |
| Category | Technology | Used In |
|---|---|---|
| Backend Framework | FastAPI | API endpoints, routing |
| PDF Processing | PyMuPDF (fitz) | Text extraction |
| Vector Database | ChromaDB | RAG storage |
| Embeddings | Sentence-Transformers (all-MiniLM-L6-v2) | Text vectorization |
| Local LLM | Ollama (Llama 3.2) | Chat, summaries, flashcards |
| Cloud LLM | Groq API (Llama 3.3-70b) | Mind map generation |
| Data Processing | Pandas | CSV/Excel parsing, statistics |
| Frontend Framework | React 19 | UI components |
| Build Tool | Vite | Development server |
| Styling | Tailwind CSS | Responsive design |
| Charts | Recharts | Data visualization |
| Mind Map | React Flow (@xyflow/react) | Interactive mind maps |
| Routing | React Router | Page navigation |
| Markdown | react-markdown | Render markdown |
| Voice | Web Speech API | Speech recognition |
| Storage | localStorage | Session persistence |
| Method | Endpoint | Purpose | Used By |
|---|---|---|---|
| POST | /upload |
Upload PDF | App.tsx |
| POST | /summary |
Generate summary | App.tsx |
| POST | /questions |
Generate questions | App.tsx |
| POST | /quiz |
Generate quiz | App.tsx |
| POST | /keypoints |
Extract key points | App.tsx |
| POST | /flashcards |
Generate flashcards | App.tsx |
| POST | /mindmap |
Generate mind map | App.tsx |
| POST | /chat |
Non-streaming chat | App.tsx |
| POST | /chat/stream |
Streaming chat | App.tsx |
| POST | /data/upload |
Upload CSV/Excel | DataPage.tsx |
| POST | /data/chart |
Get chart data | DataPage.tsx |
| POST | /data/multichart |
Multi-series chart | DataPage.tsx |
| POST | /data/topn |
Top N analysis | DataPage.tsx |
| POST | /data/anomalies |
Detect anomalies | DataPage.tsx |
| POST | /data/summary |
AI data summary | DataPage.tsx |
| POST | /data/chat |
Chat with data | DataPage.tsx |
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ SYSTEM COMPONENT DIAGRAM │
└─────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────┐ ┌──────────────────────────────┐
│ FRONTEND (React) │ │ BACKEND (FastAPI) │
├──────────────────────────────┤ ├──────────────────────────────┤
│ ┌────────────────────────┐ │ │ ┌────────────────────────┐ │
│ │ HomePage.tsx │◄─┼──────┼─►│ main.py (API) │ │
│ │ - Landing page │ │ │ - /upload │ │
│ │ - Tool selection │ │ │ - /summary │ │
│ └────────────────────────┘ │ │ - /chat, /chat/stream │ │
│ │ │ - /flashcards │ │
│ ┌────────────────────────┐ │ │ - /mindmap │ │
│ │ App.tsx (PDF Chat) │◄─┼──────┼─►│ - /data/* │ │
│ │ - Session manager │ │ └────────────────────────┘ │
│ │ - Chat interface │ │ │ │
│ │ - Action buttons │ │ ┌────────────┴────────────┐ │
│ └────────────────────────┘ │ │ │ │
│ │ ▼ ▼ │
│ ┌────────────────────────┐ │ ┌─────────────────┐ ┌─────────────────┐
│ │ DataPage.tsx │◄─┼──│ pdf_parser.py │ │ data_analyzer.py│
│ │ - Data table │ │ │ - extract_text │ │ - parse_file │
│ │ - Chart builder │ │ │ - chunk_text │ │ - get_chart_data│
│ │ - AI chat │ │ └─────────────────┘ │ - get_column_stats│
│ └────────────────────────┘ │ │ │ - detect_anomalies│
│ │ ▼ └─────────────────┘
│ ┌────────────────────────┐ │ ┌─────────────────┐ │
│ │ Components │ │ │ rag.py │ │
│ ├────────────────────────┤ │ │ - store_chunks │ │
│ │ - VoiceInput.tsx │ │ │ - retrieve_chunks│ │
│ │ - MindMap.tsx │ │ │ - get_all_chunks │ │
│ │ - FlashCards.tsx │ │ └─────────────────┘ │
│ │ - MarkdownMessage.tsx │ │ │ │
│ └────────────────────────┘ │ ▼ │
│ │ ┌─────────────────┐ ┌─────────────────┐
│ ┌────────────────────────┐ │ │ actions.py │ │ llm.py │
│ │ api.ts │◄─┼──│ - generate_* │ │ - ask_llm │
│ │ - HTTP client │ │ │ - chat_with_pdf │ │ - ask_llm_stream│
│ │ - SSE handler │ │ │ - stream_chat │ │ - ask_gemini │
│ └────────────────────────┘ │ └─────────────────┘ └─────────────────┘
│ │ │
└────────────────────────────────────┼──────────────────────────┼────────────────────────┘
│ │
▼ ▼
┌───────────────────┐ ┌───────────────────────┐
│ EXTERNAL APIS │ │ LOCAL SERVICES │
├───────────────────┤ ├───────────────────────┤
│ ┌──────────────┐ │ │ ┌─────────────────┐ │
│ │ Ollama │ │ │ │ ChromaDB │ │
│ │ (LLama 3.2) │◄─┼──────┼──│ (Vector Store) │ │
│ │ - local LLM │ │ │ └─────────────────┘ │
│ └──────────────┘ │ │ │
│ │ │ ┌─────────────────┐ │
│ ┌──────────────┐ │ │ │ Pandas │ │
│ │ Groq API │ │ │ │ (Data Process) │ │
│ │ (Llama 3.3) │◄─┼──────┼──│ └─────────────────┘ │
│ │ - free tier │ │ │ │
│ └──────────────┘ │ │ ┌─────────────────┐ │
└───────────────────┘ │ │ Sentence │ │
│ │ Transformers │ │
│ └─────────────────┘ │
└───────────────────────┘
┌─────────────────────────┐ ┌─────────────────────────┐ ┌─────────────────────────┐
│ FastAPI App │ │ pdf_parser │ │ rag.py │
├─────────────────────────┤ ├─────────────────────────┤ ├─────────────────────────┤
│ + app: FastAPI │ │ + extract_text_from_pdf│ │ + client: Client │
│ │◄──────│ (file_bytes) -> str │ │ + EMBED_MODEL: str │
│ + upload_pdf() │ │ + chunk_text() │◄──────│ + get_or_create_col() │
│ + summary() │ │ (text) -> list[str] │ │ + store_chunks() │
│ + questions() │ └─────────────────────────┘ │ (session_id,chunks) │
│ + quiz() │ │ │ + retrieve_chunks() │
│ + keypoints() │ │ │ (session_id,query) │
│ + flashcards() │ ▼ │ + get_all_chunks() │
│ + mindmap() │ ┌─────────────────────────┐ │ (session_id) │
│ + chat() │ │ actions.py │ └─────────────────────────┘
│ + chat_stream() │ ├─────────────────────────┤ │
│ + data_upload() │ │ + generate_summary() │ │
│ + data_chart() │ │ + generate_questions() │ ┌─────────────────────────┐
│ + data_chat() │ │ + generate_quiz() │ │ llm.py │
│ + ... │ │ + generate_key_points()│ ├─────────────────────────┤
└─────────────────────────┘ │ + chat_with_pdf() │ │ + OLLAMA_MODEL: str │
│ │ + stream_chat_with_pdf()│ │ + GROQ_MODEL: str │
│ │ + generate_flashcards() │ │ + ask_llm() │
│ │ + generate_mindmap() │ │ + ask_llm_stream() │
│ │ - _join_chunks() │ │ + ask_gemini() │
│ └─────────────────────────┘ └─────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────────┐
│ data_analyzer.py │
├─────────────────────────────────────────────────────────────────────────────────────┤
│ + parse_file(file_bytes, filename) -> pd.DataFrame │
│ + get_table_preview(df, rows) -> dict │
│ + get_column_stats(df) -> list[dict] │
│ + get_chart_data(df, x_col, y_col, chart_type, agg) -> dict │
│ + get_multi_chart_data(df, x_col, y_cols, chart_type, agg) -> dict │
│ + get_top_n(df, x_col, y_col, n, order, agg) -> dict │
│ + detect_anomalies(df, col) -> dict │
│ + dataframe_to_context(df, max_rows) -> str │
└─────────────────────────────────────────────────────────────────────────────────────┘
- User drops PDF → Frontend uploads to
/uploadendpoint - Backend extracts text using PyMuPDF → chunks → stores in ChromaDB
- User clicks action (e.g., "Summary")
- Backend retrieves all chunks → sends to Ollama
- Ollama generates summary → returns to frontend
- Frontend displays with typing animation
- User types question →
sendQuestion()called - Backend retrieves top-3 similar chunks via RAG
- Chunks + question → Ollama for answer
- Stream tokens via SSE → Frontend displays
- Sources shown at bottom with document references
- User uploads CSV/Excel → parsed with Pandas
- Preview table + stats calculated and displayed
- User selects X/Y columns + chart type
- Backend aggregates data (sum/mean/count)
- Chart data returned → rendered with Recharts
- Chunking: 500-word overlapping chunks (50-word overlap)
- Embedding: Sentence-Transformers all-MiniLM-L6-v2
- Storage: ChromaDB collections per session
- Retrieval: Top-3 similar chunks for queries
- Server-Sent Events (SSE) for token-by-token streaming
- Sources sent first, then tokens, then done signal
- Frontend accumulates and displays incrementally
- Auto-detect text vs numeric columns
- Dynamic chart type selection
- Aggregation options: sum, mean, count
- IQR anomaly detection with bounds calculation
Developed a full-stack RAG-based PDF chatbot using FastAPI and React, implementing vector search with ChromaDB and sentence embeddings, achieving 95% accuracy in document context retrieval with local Llama 3.2 LLM inference and 14,400 free daily API requests via Groq.
ATS Keywords: RAG, FastAPI, React, ChromaDB, vector search, sentence embeddings, Llama 3.2, LLM, Groq API, PDF chatbot, text extraction, chunking, overlapping chunks, streaming response, SSE, local inference, full-stack development
ATS Numeric Value: 95%
Built an AI-powered data analytics dashboard with Pandas and Recharts, featuring 7 chart types (bar/line/pie/scatter/area), automatic anomaly detection using IQR method, and natural language query capabilities processing datasets up to 10GB with real-time visualization updates.
ATS Keywords: Pandas, Recharts, data analytics, anomaly detection, IQR, natural language query, chart types, visualization, React Flow, mind map generation, Flask/FastAPI, REST API, streaming, local storage, session management, dark mode
ATS Numeric Value: 10GB
RAG-local/
├── backend/
│ ├── main.py # FastAPI application
│ ├── actions.py # AI action functions
│ ├── llm.py # LLM integrations
│ ├── rag.py # RAG pipeline
│ ├── pdf_parser.py # PDF text extraction
│ ├── data_analyzer.py # Data processing
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables
│
└── frontend/
├── src/
│ ├── App.tsx # PDF Chat main component
│ ├── HomePage.tsx # Landing page
│ ├── DataPage.tsx # Data Analytics
│ ├── MindMap.tsx # Mind map visualization
│ ├── FlashCards.tsx # Flashcard component
│ ├── VoiceInput.tsx # Voice input
│ ├── api.ts # API client
│ └── ...
├── package.json
└── vite.config.js
Document generated for project revision Last Updated: 2026-03-29