Repo for the CSCI E-89 Deep Learning Final Project (Fall '25, Harvard Extension School)
2025-12-29: The feature/refactor-ai-agent-insure-platform branch contains an updated version of the AI Agent Insure Application Platform.
The AI Agent Insure Application Platform is a production-ready insurance management system that combines:
- Structured Data (PostgreSQL): Policies, claims, customers, risk profiles
- Document Knowledge Base (ChromaDB): Company information, products, procedures
- User Data (MongoDB): User profiles and query history
- AI Agent: Intelligent query routing and RAG-powered question answering
π€ Intelligent Query Routing - Automatically routes queries to SQL, RAG, or Hybrid processing
π¬ Multimodal Chat Interface - Text and speech input/output for both admin and client users
π Admin Dashboard - Professional Next.js dashboard for support personnel
π€ Client Portal - Modern customer-facing portal with policy management
π PDF Document Upload - Upload and ingest PDFs into the knowledge base
π CSV Data Refresh - Refresh database from CSV files via API
β‘ Performance Optimized - Query caching, connection pooling, and optimized database queries
π Role-Based Access Control - Admin, authenticated client, and guest user permissions
See the feature/refactor-ai-agent-insure-platform branch for detailed documentation and setup instructions.
- Course: CSCI E-89 Deep Learning
- Professors: Prof. Zoran B. DjordjeviΔ & Prof. Rahul Joglekar
- Student: Robert Frenette
- Project: Local Assistant (LLM & RAG)
- Description: A local assistant leveraging large language models (LLMs) and retrieval-augmented generation (RAG) techniques to provide contextual assistance and information retrieval.
- Ollama: Local LLM hosting server
- llama3.2:3b: LLM
- nomic-embed-text: Embedding Model
- LangChain: Framework for developing applications powered by language models
- Chroma: Vector database for storing and retrieving embeddings
- Gradio: Framework for building machine learning and data science web apps
- π Ollama Crash Course: Build Local LLM powered Apps
- π Build a Large Language Model (From Scratch)
- π Agentic AI Systems with LangChain + MCP + RAG + Ollama: Build Real-World Intelligent Agents with Modular Tools, Local LLMs, and Retrieval-Augmented Reasoning
- Python 3.12+ installed
- uv package manager installed (install instructions)
- Ollama running locally:
ollama serve
- Required Ollama models (will be pulled automatically if not present):
llama3.2:3b(for LLM inference)nomic-embed-text(for embeddings)
- ffmpeg:
brew install ffmpeg(macOS)
The project includes an initialization script (init.sh) that sets up the entire environment and prepares all data.
Configuration: The application supports configuration via environment variables using a .env file. Before running the application, rename sample.env.txt in the project root to .env. See the .env file for customizable settings. All configuration values can be overridden without modifying code.
Option 1: Execute Script (venv activated during execution only)
./init.sh
# After completion, activate venv manually:
source .venv/bin/activateOption 2: Source Script (venv remains active after completion)
source init.sh
# Venv is already activated after completionThe script will:
- Clean up existing
.venv,__pycache__, logs, and databases - Create virtual environment (
uv venv --python python3.12) - Install dependencies (
uv pip install -r requirements.txt) - Create SQLite database (
insured-db/insureds.db) - Create vector store (
vector-store/chroma_db/)
After initialization:
# Activate venv (if not already activated)
source .venv/bin/activate
# Run the application
cd agent
python app.pyThe application will be available at http://127.0.0.1:7861
For detailed setup instructions and configuration options, see agent/README.md.
The main application directory containing the hybrid RAG chatbot. See agent/README.md for detailed documentation.
- Main Application:
app.py- Entry point for the chatbot - UI:
ui.py- Gradio interface separated from app logic - Configuration:
config.py- All settings (supports.envfile) - Processors: Domain processors for RAG, SQL, and audio processing
- Routing: Intelligent query routing (SQL vs RAG detection)
- Logging: Centralized logging configuration
Source PDF documents used for RAG retrieval. Documents are organized by category:
- company/: Company overview and website information
- products/: Product brochures and coverage details
- guides/: Process guides (claims, underwriting, coverage boundaries)
- agent_support/: Agent support guides for various products
- personnel/: Organizational information
These PDFs are processed into embeddings stored in vector-store/chroma_db/.
Vector database containing embeddings of all PDF documents. See vector-store/README.md for details.
- Creation Script:
create_chroma_vectorstore.py- Generates embeddings from PDFs - Database:
chroma_db/- Persistent ChromaDB storage (created by script)
SQLite database containing structured insurance data. See insured-db/README.md for schema details.
- Creation Script:
create_and_seed_insureds_db.py- Creates database from CSV files - Database:
insureds.db- SQLite database with 100 insureds, 208 policies, 46 claims - Source Data:
insured_data/- CSV files used to seed the database
Evaluation framework for testing RAG and SQL query systems. See agent-eval/README.md for usage.
- Test Script:
test.py- Runs evaluation tests - Evaluation Logic:
eval.py- Core evaluation functions - Test Data:
test_data.json- Test cases (6 RAG + 4 SQL = 10 total) - Results:
results/- JSON test results with timestamps - Analysis:
analysis.ipynb- Jupyter notebook for visualizing results
- PDF documents for this project contain fictitious data (created using an LLM) and are solely for demonstrative purposes.


