Thanks to visit codestin.com
Credit goes to github.com

Skip to content

iammhk/RAGaYaman

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RAG-Yaman Logo

🎡 RAG-Yaman: Advanced Music-Themed Retrieval-Augmented Generation

A customized RAG system based on LightRAG with enhanced user experience and music-themed branding


πŸŽ‰ What's New in RAG-Yaman

RAG-Yaman is a customized version of LightRAG with significant enhancements and improvements:

🎡 Enhanced User Experience

  • Music-Themed Branding: Complete rebrand with music icons and "RAGai" identity
  • Custom Logo & Favicon: Personalized branding throughout the application
  • Responsive Login Page: Enhanced authentication interface with custom styling

πŸ” Security & Authentication

  • User Authentication System: Secure login with JWT tokens
  • Multi-User Support: Admin and user account management
  • Session Management: Configurable token expiration and security settings

πŸ“ Content Creation Features

  • Built-in Text Document Creator: Add documents directly from the UI
  • Dialog-Based Interface: User-friendly forms for content creation
  • Title & Content Management: Organized document structure with validation

πŸ›  Technical Improvements

  • Python 3.13 Support: Latest Python version compatibility
  • Virtual Environment Setup: Isolated development environment
  • Enhanced Error Handling: Improved validation and error messages
  • Consistent Token Management: Fixed authentication token storage issues

🎨 UI/UX Enhancements

  • Music3 Icons: Consistent music-themed iconography
  • Cache-Busting: Proper favicon and asset loading
  • Responsive Design: Mobile-friendly interface improvements
  • Enhanced Navigation: Improved user flow and experience

πŸš€ Quick Start

Prerequisites

  • Python 3.13 (recommended)
  • Node.js (for WebUI development)
  • OpenAI API Key or Ollama for local LLM

Installation

  1. Clone the Repository
git clone https://github.com/iammhk/RAGaYaman.git
cd RAGaYaman
  1. Set up Python Environment
# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate

# Install dependencies
pip install -e ".[api]"
  1. Configure Environment
# Copy and configure environment file
cp .env.example .env
# Edit .env with your settings
  1. Start the Server
lightrag-server

The RAG-Yaman interface will be available at http://localhost:9621

Default Login Credentials

  • Username: admin
  • Password: admin123

Note: Change these credentials in the .env file for production use


✨ Key Features

🎡 Music-Themed Interface

  • Custom "RAGai" branding with music note icons
  • Consistent emerald color scheme
  • Enhanced visual identity throughout the application

πŸ“ Document Management

  • Upload Documents: Support for PDF, DOC, PPT, CSV files
  • Create Text Documents: Built-in editor for direct content creation
  • Document Processing: Automatic knowledge graph generation
  • Batch Operations: Multiple document handling

πŸ” Advanced Query System

  • Multiple Search Modes: Local, Global, Hybrid, Mix, Naive
  • Context-Aware Responses: Conversation history support
  • Real-time Results: Fast retrieval with caching

πŸ•ΈοΈ Knowledge Graph Visualization

  • Interactive Graph: Explore entities and relationships
  • Dynamic Layouts: Multiple visualization options
  • Node Filtering: Advanced search and filtering capabilities

πŸ” Security Features

  • JWT Authentication: Secure token-based authentication
  • User Management: Multiple user accounts with different permissions
  • Session Control: Configurable token expiration
  • API Key Protection: Secure API access

πŸ”§ Configuration

Environment Variables

Key configuration options in .env:

# Server Configuration
HOST=0.0.0.0
PORT=9621
WEBUI_TITLE='RAGai'
WEBUI_DESCRIPTION="Simple and Fast Graph Based RAG System"

# Authentication (uncomment to enable)
AUTH_ACCOUNTS='admin:admin123,user1:pass456'
TOKEN_SECRET=Your-Key-For-RAG-Yaman-API-Server
TOKEN_EXPIRE_HOURS=48

# LLM Configuration
LLM_MODEL=gpt-4o
LLM_BINDING_HOST=https://api.openai.com/v1
LLM_BINDING_API_KEY=your-openai-api-key

# Embedding Configuration
EMBEDDING_BINDING=ollama
EMBEDDING_MODEL=all-minilm
EMBEDDING_DIM=384
EMBEDDING_BINDING_HOST=http://localhost:11434

# Storage Configuration
RAG_YAMAN_KV_STORAGE=JsonKVStorage
RAG_YAMAN_DOC_STATUS_STORAGE=JsonDocStatusStorage
RAG_YAMAN_GRAPH_STORAGE=NetworkXStorage
RAG_YAMAN_VECTOR_STORAGE=NanoVectorDBStorage
COSINE_THRESHOLD=0.2

Docker Deployment

Use Docker Compose for easy deployment:

# Build and start services
docker-compose up -d --build

# View logs
docker-compose logs -f

# Stop services
docker-compose down

πŸ“– Usage Examples

Creating Text Documents

  1. Login to the RAG-Yaman interface
  2. Navigate to the Documents tab
  3. Click "Add Document" button (with music note icon)
  4. Enter title and content in the dialog
  5. Submit to create and process the document

Querying the Knowledge Base

from lightrag import LightRAG, QueryParam

# Initialize RAG-Yaman
rag = LightRAG(working_dir="./rag_storage")

# Query with different modes
response = await rag.query(
    "What are the main themes?",
    param=QueryParam(mode="hybrid")
)

Authentication API

import requests

# Login
response = requests.post("http://localhost:9621/auth/login", 
    json={"username": "admin", "password": "admin123"})
token = response.json()["access_token"]

# Use authenticated endpoints
headers = {"Authorization": f"Bearer {token}"}
documents = requests.get("http://localhost:9621/api/documents", headers=headers)

πŸ›  Development

Building the WebUI

cd lightrag_webui
npm install
npm run build

Running in Development Mode

# Start backend
lightrag-server

# Start frontend (in another terminal)
cd lightrag_webui
npm run dev

Project Structure

RAGaYaman/
β”œβ”€β”€ lightrag/              # Core RAG system
β”œβ”€β”€ lightrag_webui/        # React-based WebUI
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   β”œβ”€β”€ features/      # Feature-specific components
β”‚   β”‚   β”œβ”€β”€ api/          # API integration
β”‚   β”‚   └── locales/      # Internationalization
β”œβ”€β”€ data/                  # Data storage
β”‚   β”œβ”€β”€ inputs/           # Input documents
β”‚   └── rag_storage/      # Processed data
β”œβ”€β”€ assets/               # Project assets
β”œβ”€β”€ docker-compose.yml    # Docker configuration
└── .env                 # Environment configuration

πŸ”— API Reference

Authentication Endpoints

  • POST /auth/login - User login
  • POST /auth/logout - User logout
  • GET /auth/status - Check authentication status

Document Endpoints

  • GET /api/documents - List documents
  • POST /api/documents/upload - Upload documents
  • POST /api/documents/text - Create text document
  • DELETE /api/documents/{id} - Delete document

Query Endpoints

  • POST /api/query - Perform RAG query
  • GET /api/graph - Get knowledge graph
  • POST /api/extract - Extract entities and relationships

🀝 Contributing

We welcome contributions to RAG-Yaman! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow Python PEP 8 style guide
  • Add tests for new features
  • Update documentation as needed
  • Ensure compatibility with Python 3.13

πŸ“„ License

This project is based on LightRAG and maintains the same licensing terms.


πŸ™ Acknowledgments


πŸ“ž Support


🎡 Thank you for using RAG-Yaman! 🎡

About

"RAGaYaman: Simple and Fast Retrieval-Augmented Generation"

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 75.5%
  • TypeScript 22.3%
  • Shell 1.2%
  • JavaScript 0.5%
  • CSS 0.3%
  • Dockerfile 0.1%
  • Other 0.1%