Skip to content

A chatbot capable of both conversation and study assistance. Based on the AI that isn't ever really mentioned again after Far From Home.

License

Notifications You must be signed in to change notification settings

ChrisDanielW/EDITH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EDITH - Even Disconnected, I'm The Helper πŸ‘“

A modern, AI study assistant that runs completely offline

Smart conversation management β€’ Context-aware responses β€’ Minimalist web UI

EDITH Landing Page


🌟 What is EDITH?

EDITH is your personal AI study assistant that helps you make sense of your notes using local LLMs. She features a modern interface with conversation management, intelligent query classification, and context-aware responses. Best of all? She runs completely offline using LLaMA 3.1.

EDITH Chat Interface

Key Features

✨ Modern Web Interface

  • Modern landing page with welcoming design
  • Conversation management (create, save, switch, delete)
  • Clean, animated UI with expandable sidebar
  • Real-time typing indicators and status updates

🧠 Intelligent AI Assistant

  • Context-aware responses that reference previous messages
  • Automatic classification between knowledge queries and casual chat
  • RAG (Retrieval-Augmented Generation) for note-based answers
  • Conversational mode for general questions

πŸ“š Powerful Note Processing

  • Multi-format support (PDF, DOCX, images with OCR, text files)
  • Drag-and-drop or multi-file upload
  • Automatic text chunking and embedding generation
  • Vector database storage with Pinecone for fast retrieval

πŸ”’ Privacy First

  • 100% local LLM execution via Ollama
  • No data sent to external servers
  • Your notes stay on your machine

πŸš€ Quick Start

1. Install Ollama & Pull Model

# Download Ollama from: https://ollama.ai/download
# Then pull LLaMA 3.1:
ollama pull llama3.1:8b-instruct-q4_K_M

2. Install Dependencies

# Clone the repository
git clone https://github.com/ChrisDanielW/EDITH.git
cd EDITH

# Install Python dependencies
pip install -r requirements.txt

3. Configure Pinecone

# Create a .env and copy the contents of "env-example.txt" provided in the root directory to it
# Then edit the .env and add your Pinecone API key
notepad .env

Get a free Pinecone API key at pinecone.io

4. Start EDITH

# Start the web UI and API server
python start_ui.py

Open your browser to http://localhost:5000 and start chatting!


πŸ“– User Guide

First Time Setup

  1. Upload Your Notes
    • Click the πŸ“Ž Upload button in the sidebar
    • Select or drag-and-drop your documents (PDF, DOCX, TXT, images)
    • EDITH will process and index them automatically

Upload Interface

  1. Start a Conversation
    • Type your first message on the landing page
    • A new numbered conversation will be created automatically
    • Ask questions about your notes or just chat casually

Using EDITH

Asking About Notes:

You: What is polymorphism in OOP?
EDITH: [Searches your notes and provides detailed explanation]

Casual Conversation:

You: Hey, how's it going?
EDITH: [Responds naturally without searching notes]

Follow-up Questions:

You: Can you explain that in more detail?
EDITH: [References previous conversation context]

Conversation with Context

Managing Conversations

  • New Conversation: Click the βž• button (appears when in a conversation)
  • Switch Conversations: Click any conversation in the left sidebar
  • Delete Conversation: Click the Γ— button on any conversation
  • Return to Landing: Click the hamburger menu (☰) to collapse sidebar

Architecture

Tech Stack

Frontend:

  • Vanilla HTML, CSS, JavaScript
  • LocalStorage for conversation persistence
  • Modern animated UI with responsive design

Backend:

  • Flask REST API
  • Python 3.8+
  • Ollama for LLM execution

AI/ML:

  • LLaMA 3.1 (8B Instruct, 4-bit quantized)
  • Sentence Transformers for embeddings
  • Pinecone vector database
  • RAG architecture for context retrieval

How It Works

  1. Document Upload β†’ Text extraction & chunking β†’ Embedding generation β†’ Store in Pinecone
  2. User Query β†’ Classify (knowledge vs. casual) β†’ Retrieve relevant chunks (if knowledge) β†’ Generate answer with conversation context
  3. Conversation History β†’ Last 3 exchanges sent with each query β†’ Context-aware responses

Project Structure

EDITH/
β”œβ”€β”€ ui/                          # Web interface
β”‚   β”œβ”€β”€ index.html              # Main HTML
β”‚   β”œβ”€β”€ styles.css              # Styling
β”‚   └── app.js                  # Frontend logic
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.py                 # Core EDITH class
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── app.py              # Flask API server
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   └── llama_client.py     # LLM interface
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ rag_service.py      # RAG pipeline
β”‚   β”‚   β”œβ”€β”€ vector_store.py     # Pinecone integration
β”‚   β”‚   β”œβ”€β”€ note_analyzer.py    # Document analysis
β”‚   β”‚   └── summarizer.py       # Summarization
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ document_loader.py  # File loading
β”‚   β”‚   β”œβ”€β”€ text_chunker.py     # Smart chunking
β”‚   β”‚   β”œβ”€β”€ embeddings.py       # Embedding generation
β”‚   β”‚   └── query_classifier.py # Query classification
β”‚   └── config/
β”‚       └── settings.py         # Configuration
β”œβ”€β”€ start_ui.py                 # Launch script
β”œβ”€β”€ requirements.txt            # Python dependencies
└── README.md                   # This file

Configuration

Token Limits (Adjustable in src/main.py)

  • RAG Mode: 500 tokens (detailed educational responses)
  • Conversational Mode: 350 tokens (natural chat)
  • Fallback Mode: 400 tokens (general knowledge)

Model Selection

Edit src/config/settings.py to change models:

# Current default
MODEL_NAME = "llama3.1:8b-instruct-q4_K_M"

# For more powerful responses (slower, needs more RAM)
MODEL_NAME = "llama3.1:70b-instruct-q4_K_M"

Vector Database

EDITH uses Pinecone with these settings:

  • Top K: 3 most relevant chunks
  • Similarity Threshold: 0.7
  • Max Context: 2000 characters

Features

Conversation Management

  • Persistent storage in browser localStorage
  • Numbered conversations (1, 2, 3...)
  • Auto-save after every message
  • Landing page shows on startup

Intelligent Query Routing

  • Automatic classification of user intent
  • Knowledge queries β†’ RAG mode (searches notes)
  • Casual queries β†’ Conversational mode (direct chat)
  • Hybrid queries β†’ RAG with conversational tone

Context Awareness

  • Sends last 6 messages (3 exchanges) with each query
  • References previous conversation naturally
  • Maintains conversation flow across messages

Contributing

Contributions are welcome! Areas for improvement:

  • Export conversations to PDF/text
  • Search within conversations
  • Custom system prompts per conversation
  • Markdown rendering in responses
  • Code syntax highlighting
  • Voice input/output

πŸŽ₯ Demo Video

See EDITH in action - uploading documents, managing conversations, and answering questions:

πŸ“Ί Watch Demo Video

Click the link above to download and watch the demo


License

MIT License - See LICENSE for details


Acknowledgments

  • LLaMA 3.1 by Meta AI
  • Ollama for easy local LLM deployment
  • Pinecone for vector database
  • Sentence Transformers for embeddings

Made for students who want to study smarter (and also in the hopes of possibly getting an internship)

About

A chatbot capable of both conversation and study assistance. Based on the AI that isn't ever really mentioned again after Far From Home.

Resources

License

Stars

Watchers

Forks