A Django-based AI-powered data analysis application that lets users upload Excel/CSV files and ask natural language questions about their data. Built with local LLMs via Ollama, LangChain agents, and vector search.
- File Upload — Upload Excel (.xlsx, .xls) and CSV files with configurable null-value handling strategies (forward fill, backward fill, mean fill, zero fill, etc.)
- Natural Language Chat — Ask questions about your data in plain English; an AI agent translates them into SQL queries, Python computations, or semantic lookups
- Visualization — Auto-generated charts and plots via Matplotlib/Seaborn, plus a dedicated data exploration page with filtering and pagination
- ReAct Agent — Multi-tool reasoning agent with SQL, Python execution, and vector search capabilities
- Streaming Responses — Real-time Server-Sent Events for agent reasoning traces
- Vector Search — Semantic search over your data using ChromaDB embeddings
- Configurable Models — Choose Ollama models for QA, chat, and embeddings via the settings page
- Backend: Django, LangChain, Pandas, NumPy
- LLM: Ollama (local models, default: qwen3.5:9b)
- Vector Store: ChromaDB with nomic-embed-text embeddings
- Database: SQLite
- Visualization: Matplotlib, Seaborn
- Python 3.10+
- Ollama installed and running locally
-
Clone the repository
git clone <repo-url> cd excel_analysis
-
Create a virtual environment and install dependencies
python -m venv venv source venv/bin/activate pip install -r requirements.txt -
Pull the required Ollama models
ollama pull qwen3.5:9b ollama pull nomic-embed-text
-
Run migrations
python manage.py migrate
-
Start the server
python manage.py runserver
-
Open
http://127.0.0.1:8000/in your browser.
| Variable | Default | Description |
|---|---|---|
OLLAMA_BASE_URL |
http://127.0.0.1:11434 |
Ollama server URL |
OLLAMA_QA_MODEL |
qwen3.5:9b |
Model for SQL/data queries |
OLLAMA_CHAT_MODEL |
qwen3.5:9b |
Model for conversational responses |
OLLAMA_EMBED_MODEL |
nomic-embed-text |
Embedding model for vector search |
These can also be configured from the in-app Settings page.
- Upload — Go to
/uploadand upload an Excel or CSV file. Choose a null-handling strategy if your data has missing values. - Chat — Navigate to
/chat, create a session, and ask questions about your data (e.g., "What is the average unemployment rate by region?"). - Visualize — Use
/visualizationto filter, sort, and paginate through your data. - Settings — Configure Ollama models and connection at
/settings.
excel_analysis/
├── ai_analysis/ # Main Django app
│ ├── services/ # Business logic
│ │ ├── agent.py # ReAct agent engine
│ │ ├── data_ingestion.py # File upload & processing
│ │ ├── data_query.py # Filtering & visualization
│ │ ├── prompting.py # Dynamic prompt construction
│ │ ├── app_settings.py # Ollama config management
│ │ └── runtime.py # In-memory state management
│ ├── models.py # Database models
│ ├── views.py # API endpoints
│ ├── templates/ # HTML templates
│ └── tests/ # Test suite
├── excel_agent/ # Django project settings
├── data/ # Vector store index
├── media/ # Uploaded files & generated plots
├── requirements.txt
└── manage.py
pytestThis project is for personal/educational use.