Skip to content

dpfernandes/python-rag-ollama

Repository files navigation

TechNova University AI Chat Assistant

A modern AI-powered chat interface for TechNova University that provides instant answers to questions about the university's programs, campuses, and services. The application uses RAG (Retrieval-Augmented Generation) to provide accurate and context-aware responses based on the university's documentation.

Screenshot 2025-06-24 at 14 55 13 Screenshot 2025-06-24 at 14 54 58

Features

  • 🤖 AI-powered chat interface with natural language understanding
  • 📚 RAG-based responses using university documentation
  • 🎓 Information about programs, campuses, and services
  • 📊 Real-time chat statistics and analytics
  • 🔒 Session management for continuous conversations
  • 📱 Responsive design for all devices
  • 🎨 Modern and intuitive user interface

Tech Stack

Backend

  • Python 3.8+
  • Flask: Web framework
  • LangChain: AI/ML framework
  • Ollama: Local LLM server
  • SQLite: Database for storing chat statistics
  • Flask-CORS: Cross-origin resource sharing

Frontend

  • HTML5/CSS3: Modern web interface
  • JavaScript: Dynamic interactions
  • Chart.js: Statistics visualization

Prerequisites

  • Python 3.8 or higher
  • Ollama installed and running locally
  • Git (for cloning the repository)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/python-rag-ollama.git
cd python-rag-ollama
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install the required packages:
pip install -r requirements.txt
  1. Start the Ollama server:
ollama serve
  1. In a new terminal, start the Flask application:
python app.py

The application will be available at http://localhost:5001

Usage

  1. Open your browser and navigate to http://localhost:5001
  2. Enter your name to start chatting
  3. Ask questions about TechNova University, such as:
    • Available programs and degrees
    • Campus locations and facilities
    • Admission requirements
    • Student services
    • Research opportunities

Backoffice Dashboard

Access the backoffice dashboard at http://localhost:5001/backoffice to view:

  • Real-time chat statistics
  • Popular questions
  • System performance metrics

Project Structure

python-rag-ollama/
├── app.py              # Main Flask application
├── database.py         # Database operations
├── vector.py          # Vector store and retrieval
├── static/            # Static files
│   ├── styles.css     # CSS styles
│   └── logo.png       # University logo
├── templates/         # HTML templates
├── requirements.txt   # Python dependencies
└── README.md         # Project documentation

Development

Running Tests

python -m pytest tests/

Code Style

The project follows PEP 8 style guidelines. Use a linter to ensure code quality:

flake8 .

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • TechNova University for providing the documentation
  • Ollama team for the local LLM server
  • LangChain team for the RAG framework

Support

For support, please open an issue in the GitHub repository or contact the development team.

Roadmap

  • Add user authentication
  • Implement chat history export
  • Add support for multiple languages
  • Integrate with university's student portal
  • Add voice input/output capabilities

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors