Skip to content

NnA301023/clarus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Clarus (ExaBytes RAG Demo Application)

Python Flask LangChain License

A modern web application implementing Retrieval Augmented Generation (RAG) using Flask and Tailwind CSS. Upload documents and get AI-powered answers based on their content.

FeaturesQuick StartInstallationUsageArchitectureDevelopment

✨ Features

  • 📄 Document Processing

    • Support for PDF and TXT files
    • Automatic text chunking and embedding
    • Efficient vector storage with ChromaDB
  • 🔍 Advanced RAG Implementation

    • Powered by Groq's Mixtral-8x7b model
    • Sentence transformers for embeddings
    • Context-aware question answering
  • 🎨 Modern UI/UX

    • Clean, responsive design with Tailwind CSS
    • Real-time loading states
    • Toast notifications for feedback
    • Drag-and-drop file upload

🚀 Quick Start

# Clone the repository
git clone https://github.com/yourusername/clarus.git
cd clarus

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
uv pip install -e .

# Set up environment variables
cp app/.env.example app/.env
# Edit app/.env with your API keys

# Run the application
python main.py

Visit http://localhost:5000 in your browser to start using the application.

🛠️ Installation

Prerequisites

  • Python 3.11+
  • uv package manager (recommended) or pip
  • Groq API key for LLM access

Detailed Setup

  1. Environment Setup

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  2. Install Dependencies

    Using uv (recommended):

    uv pip install -e .

    Using pip:

    pip install -r requirements.txt
  3. Configure Environment Variables

    cp app/.env.example app/.env

    Edit app/.env and add:

    SECRET_KEY=your-secret-key
    GROQ_API_KEY=your-groq-api-key
    

🎯 Usage

  1. Upload Documents

    • Click the upload area or drag and drop files
    • Supported formats: PDF, TXT
    • Wait for the success notification
  2. Ask Questions

    • Enter your question in the text area
    • Click "Get Answer"
    • View AI-generated response based on your documents

🏗️ Architecture

.
├── app/                  # Application package
│   ├── templates/       # HTML templates
│   ├── static/         # Static files
│   ├── utils/          # Utility modules
│   │   └── rag.py     # RAG implementation
│   └── routes.py       # Flask routes
├── main.py             # Application entry point
├── pyproject.toml      # Project metadata and dependencies
└── requirements.txt    # Direct dependencies

🧪 Development

Tech Stack

  • Backend

    • Flask: Web framework
    • LangChain: RAG implementation
    • ChromaDB: Vector storage
    • Sentence Transformers: Text embeddings
    • Groq: LLM provider
  • Frontend

    • Tailwind CSS: Styling
    • Vanilla JavaScript: Interactivity

Development Tools

# Install development dependencies
uv pip install -e ".[dev]"

# Format code
black app/
isort app/

# Lint code
flake8 app/

📄 License

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


Made with ❤️ using Flask, LangChain, and Groq

About

Sharing Session Dibimbing X ExaBytes 2025

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors