Skip to content

laasya2005/Dora-Agent

Repository files navigation

Dora - Customer Support Agent

A document-based AI customer support agent that answers questions using only uploaded documents.

Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   React UI      │────▶│  FastAPI Server │────▶│  Ollama/Mistral │
│   (Vite)        │     │  (Python)       │     │  (Local LLM)    │
└─────────────────┘     └─────────────────┘     └─────────────────┘
        │                       │
        │                       ▼
        │               ┌─────────────────┐
        │               │   RAG Module    │
        │               │  (JSON Store)   │
        │               └─────────────────┘

Tech Stack

Component Technology
Frontend React + Vite
Styling Inline JSX Styles
Backend FastAPI (Python)
LLM Mistral via Ollama
RAG Custom keyword search
Storage JSON file

Project Structure

CustomerSupport/
├── server.py           # API endpoints (/upload, /chat, /documents)
├── rag.py              # Document chunking, search, context retrieval
├── system_prompt.py    # AI personality and instructions
├── requirements.txt    # Python dependencies
└── frontend/
    ├── src/
    │   ├── App.jsx         # React UI components + inline styles
    │   └── main.jsx        # React entry point + global styles
    ├── index.html
    ├── package.json
    └── vite.config.js

How RAG Works

  1. Upload - Extract text from PDF/TXT/MD → Split into 800-char chunks → Store with tokenized keywords
  2. Query - Tokenize question → Search all documents → Return top 3 matches per document
  3. Answer - Send context + question to LLM → Stream response back to UI

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Ollama with Mistral model

Installation

  1. Install Ollama and pull Mistral:
# Install Ollama from https://ollama.ai
ollama pull mistral
  1. Install Python dependencies:
cd CustomerSupport
pip3 install -r requirements.txt
  1. Install frontend dependencies:
cd frontend
npm install

Running the App

  1. Start Ollama (if not running):
ollama serve
  1. Start the backend server:
cd CustomerSupport
python3 server.py
  1. Start the frontend (new terminal):
cd CustomerSupport/frontend
npm run dev
  1. Open http://localhost:3000

Usage

  1. Upload one or more documents (PDF, TXT, or MD)
  2. Ask questions about the uploaded content
  3. Dora will answer using only information from the documents

API Endpoints

Method Endpoint Description
GET /health Check server and Ollama status
POST /upload Upload a document
GET /documents List uploaded documents
DELETE /documents Clear all documents
POST /chat/stream Send message and stream response

Features

  • Document upload (PDF, TXT, MD)
  • Multi-document search
  • Real-time streaming responses
  • Source citation in answers
  • Clean, responsive UI
Screenshot 2026-01-18 at 9 52 57 PM Screenshot 2026-01-18 at 9 53 19 PM Screenshot 2026-01-18 at 9 38 12 PM

About

Dora is an AI-powered customer support agent built using RAG with Mistral AI, FastAPI, and Vite, enabling secure question-answering over uploaded business documents.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors