Skip to content

rbasina/meetara-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Meetara Core

Production-ready RAG (Retrieval-Augmented Generation) backend with emotion-aware responses, multi-domain support, and Hugging Face model integration.

Python FastAPI License


πŸ“‹ Table of Contents


🎯 Overview

Meetara Core is a modular, production-ready RAG assistant backend that provides:

  • βœ… 100+ Domain Support - Healthcare, Education, Business, Technology, and more
  • βœ… Emotion-Aware Responses - Facial and speech emotion detection
  • βœ… Multi-Language Support - 15+ languages including Telugu, Tamil, Bengali
  • βœ… Offline-First - All processing done locally with open-source models
  • βœ… Hugging Face Integration - Automatic model download and caching
  • βœ… Production Ready - FastAPI, comprehensive error handling, monitoring

✨ Features

Core Capabilities

  • Multi-Domain RAG: Handle 100+ domains using vector search with ChromaDB
  • LangChain Agent System: Tool-based orchestration with intelligent routing
  • Emotion-Aware Responses: Facial and speech emotion detection for adaptive responses
  • Multi-Language Support: Telugu, Tamil, Bengali + 12 other languages
  • Smart Domain Detection: Context-aware keyword matching with cross-domain intelligence
  • Image Extraction: Automatic extraction and retrieval of images from documents
  • Conversation Context: Maintains domain context across multi-turn conversations

Technical Features

  • Vector Storage: ChromaDB with Snappy compression (75-85% storage reduction)
  • Model Caching: Single-instance model loading with Hugging Face cache integration
  • Performance: Shared embeddings model, batch APIs, parallel loading
  • Config-Driven: All domain logic via YAML files (no hardcoding)
  • Modular Architecture: Extensible design for easy customization

πŸš€ Quick Start

πŸ“– For detailed quick start guide, see docs/QUICK_START.md

Prerequisites

  • Python 3.12+ (recommended) or Python 3.10+
  • 8GB+ RAM (for model loading)
  • 5GB+ disk space
  • Git (for cloning)

Installation

  1. Clone the repository
git clone <repository-url>
cd meetara-core
  1. Create virtual environment
python -m venv .venv-meetara
.venv-meetara\Scripts\activate  # Windows
# source .venv-meetara/bin/activate  # Linux/Mac
  1. Install dependencies
pip install -r requirements.txt
  1. Install Tesseract OCR (for image text extraction)

Windows:

# Download and install from: https://github.com/UB-Mannheim/tesseract/wiki
# Or use chocolatey:
choco install tesseract

Linux:

sudo apt-get install tesseract-ocr

macOS:

brew install tesseract

πŸ“ Note: Tesseract is required for extracting text from images in PDFs. The system will work without it, but OCR will be skipped.

  1. Configure environment
# Copy example env file
cp env.example .env

# Edit .env and set your configuration (see Configuration section)
  1. Start the server
python main.py
  1. Verify installation
curl http://localhost:8000/health
# Should return: {"status": "healthy", ...}

πŸŽ‰ API available at http://localhost:8000

Interactive API Documentation


πŸ—οΈ Architecture

πŸ“– For complete architecture documentation, see docs/ARCHITECTURE.md

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    User Request                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              FastAPI Endpoints (/api/chat)              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              MeetaraAgent (LangChain Agent)             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Query        β”‚  β”‚ Domain       β”‚  β”‚ RAG          β”‚ β”‚
β”‚  β”‚ Analyzer     β”‚β†’ β”‚ Detection    β”‚β†’ β”‚ Retrieval    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         GGUF LLM Processor (meetara-qwen3-1.7b)         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ β€’ Hugging Face Model Download & Caching          β”‚   β”‚
β”‚  β”‚ β€’ Single-Instance Loading (reused for all reqs) β”‚   β”‚
β”‚  β”‚ β€’ Domain-Specific Prompt Generation             β”‚   β”‚
β”‚  β”‚ β€’ Response Structure Validation                 β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Structured Response + Images               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

meetara-core/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/                    # FastAPI route handlers
β”‚   β”‚   β”œβ”€β”€ chat.py            # Chat endpoint with RAG
β”‚   β”‚   β”œβ”€β”€ emotion.py         # Emotion detection APIs
β”‚   β”‚   β”œβ”€β”€ upload.py          # Document upload & management
β”‚   β”‚   └── image_generation.py # Image generation API
β”‚   β”œβ”€β”€ agent/                  # LangChain agent system
β”‚   β”‚   β”œβ”€β”€ planner.py         # Main agent orchestration
β”‚   β”‚   β”œβ”€β”€ mcp_router.py      # Multi-component planner
β”‚   β”‚   └── tools/             # Agent tools
β”‚   β”‚       β”œβ”€β”€ adapter_selector.py    # Domain routing
β”‚   β”‚       β”œβ”€β”€ translation_tool.py    # Multi-language
β”‚   β”‚       β”œβ”€β”€ speech_tool.py          # STT/TTS
β”‚   β”‚       β”œβ”€β”€ emotion_tool.py         # Speech emotion
β”‚   β”‚       └── face_emotion_tool.py   # Facial emotion
β”‚   β”œβ”€β”€ rag/                   # RAG components
β”‚   β”‚   β”œβ”€β”€ domain_retrievers.py      # Domain-specific retrievers
β”‚   β”‚   β”œβ”€β”€ semantic_domain_detector.py # Semantic domain detection
β”‚   β”‚   └── vector_loader.py          # Vector store management
β”‚   β”œβ”€β”€ core/                  # Core utilities
β”‚   β”‚   β”œβ”€β”€ config.py          # Configuration management
β”‚   β”‚   β”œβ”€β”€ config_loader.py   # YAML config loader
β”‚   β”‚   β”œβ”€β”€ gguf_llm_processor.py # GGUF model processor
β”‚   β”‚   β”œβ”€β”€ llm_processor.py    # LLM integration
β”‚   β”‚   β”œβ”€β”€ query_analyzer.py  # Query analysis & domain detection
β”‚   β”‚   β”œβ”€β”€ domain_categorizer.py # Domain categorization
β”‚   β”‚   β”œβ”€β”€ logger.py          # Logging system
β”‚   β”‚   └── security.py        # Security & validation
β”‚   β”œβ”€β”€ services/              # Service layer
β”‚   β”‚   └── image_generator.py # Image generation service
β”‚   └── utils/                 # Utility functions
β”œβ”€β”€ config/                    # Configuration files
β”‚   β”œβ”€β”€ domain_config.yaml     # Domain definitions & settings
β”‚   β”œβ”€β”€ domain_keywords.yaml   # Domain keywords for detection
β”‚   └── tier_config.yaml       # Domain tier configurations
β”œβ”€β”€ scripts/                   # Utility scripts
β”‚   β”œβ”€β”€ batch_uploader.py      # Batch document upload
β”‚   β”œβ”€β”€ check_db_size.py       # Database size checker
β”‚   └── setup_environment.py   # Environment setup
β”œβ”€β”€ tests/                     # Test files
β”œβ”€β”€ docs/                      # Documentation
β”‚   └── archive/               # Archived documentation
β”œβ”€β”€ vectorstore/               # ChromaDB vector stores (per domain)
β”œβ”€β”€ images/                    # Extracted document images
β”œβ”€β”€ models/                    # Emotion detection models
β”œβ”€β”€ main.py                    # FastAPI application entry point
β”œβ”€β”€ requirements.txt           # Python dependencies
β”œβ”€β”€ env.example                # Environment variables template
└── README.md                  # This file

Data Flow

  1. User Query β†’ FastAPI endpoint (/api/chat/)
  2. Query Analysis β†’ Domain detection (keyword + semantic)
  3. RAG Retrieval β†’ Vector search in domain-specific ChromaDB
  4. Context Building β†’ Merge RAG context + conversation history
  5. LLM Generation β†’ GGUF model generates structured response
  6. Response Formatting β†’ Add images, format markdown, return JSON

βš™οΈ Configuration

πŸ”§ Critical Configuration Flags

These are the most important settings you should understand and configure:

1. Model Configuration ⚑

# Enable/disable Meetara fine-tuned models (recommended: true)
USE_MEETARA_MODELS=true

# Hugging Face model (auto-downloads and caches)
MEETARA_HF_MODEL_ID=meetara-lab/meetara-qwen3-1.7b-gguf
MEETARA_HF_MODEL_FILE=meetara-qwen3-1.7b-Q4_K_M.gguf

What it does:

  • βœ… true β†’ Uses your fine-tuned Meetara model (better responses, domain-aware)
  • ❌ false β†’ Falls back to base models (less accurate)
  • πŸ’‘ Recommendation: Keep true for production

2. Image Extraction Control πŸ–ΌοΈ

# Extract images during query time (affects performance)
ENABLE_IMAGE_EXTRACTION_DURING_QUERY=false

What it does:

  • βœ… true β†’ Extracts relevant images during each query (slower, visual context)
  • ❌ false β†’ Only extracts during document upload (faster queries)
  • πŸ’‘ Recommendation:
    • false for production (better performance)
    • true for fine-tuning data generation (better training data)

3. RAG Context Filtering 🎯

# Filter RAG context by keyword relevance
FILTER_RAG_CONTEXT_BY_RELEVANCE=false

What it does:

  • βœ… true β†’ Filters retrieved documents by keyword matching (stricter)
  • ❌ false β†’ Returns all semantically similar documents (more context)
  • πŸ’‘ Recommendation:
    • false for training data generation (full context)
    • true for production (focused responses)

4. Domain Response Structure πŸ“‹

Configured in: app/core/domain_categorizer.py β†’ DOMAIN_SECTIONS

What it does:

  • Defines response structure per domain category
  • Healthcare β†’ diagnosis, symptoms, treatment, precautions
  • Education β†’ explanation, examples, practice_questions
  • Legal β†’ legal_context, rights, obligations, next_steps

Note: This is NOT for model selection (one model for all domains). It only controls response formatting structure.


Environment Variables (.env)

Create a .env file from env.example:

# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=false

# CORS Configuration
CORS_ORIGINS=["http://localhost:3000","http://localhost:2025"]

# Vector Store Configuration
VECTORSTORE_PATH=vectorstore
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
CHUNK_SIZE=500
CHUNK_OVERLAP=100

# Meetara GGUF Models Configuration
# Option 1: Use Hugging Face model (recommended - automatic download)
MEETARA_HF_MODEL_ID=meetara-lab/meetara-qwen3-1.7b-gguf
MEETARA_HF_MODEL_FILE=meetara-qwen3-1.7b-Q4_K_M.gguf
# Cache directory (leave empty to use default HF cache: ~/.cache/huggingface/hub)
# On Windows: C:\Users\<username>\.cache\huggingface\hub
# MEETARA_MODEL_CACHE_DIR=

# Option 2: Use local models (fallback if HF not set)
# MEETARA_MODELS_PATH=C:/path/to/models
# MEETARA_INSTRUCT_MODEL=meetara-qwen3-1.7b-Q4_K_M.gguf

USE_MEETARA_MODELS=true
LOCAL_LLM_MAX_LENGTH=640
LOCAL_LLM_TOP_P=0.9
LOCAL_LLM_TOP_K=50

# LLM Configuration
LLM_CONTEXT_LENGTH=4096
LLM_TEMPERATURE=0.7

# Speech Processing
STT_MODEL=base
TTS_VOICE=en-US-JennyNeural
AUDIO_SAMPLE_RATE=16000

# Emotion Detection
EMOTION_MODELS_PATH=models/emotion
FACE_DETECTION_CONFIDENCE=0.5

# Fine-tuning Configuration (for meetara-lab integration)
ENABLE_IMAGE_EXTRACTION_DURING_QUERY=false
FILTER_RAG_CONTEXT_BY_RELEVANCE=false

# Logging
LOG_LEVEL=INFO
LOG_FILE=logs/meetara.log

Domain Configuration

Domains are configured in config/domain_config.yaml:

categories:
  healthcare:
    tier: safety_critical
    validation_level: strict
    domains:
      general_health:
        requires_validation: true
        priority: 1
      mental_health:
        requires_validation: true
        priority: 1

Adding a new domain:

  1. Add domain to config/domain_config.yaml
  2. Add keywords to config/domain_keywords.yaml
  3. Upload documents via /api/upload/doc
  4. Domain automatically available for queries

πŸ“š API Documentation

Core Endpoints

Chat Query

POST /api/chat/
Content-Type: application/json

{
  "query": "How can I improve my sleep quality?",
  "session_id": "conv-abc123",  # Reuse same ID for conversation
  "context": {
    "domain": "general_health",  # Optional: specify domain
    "lang": "en",
    "emotion": "anxious"
  }
}

Response:

{
  "response": "**Quick Answer:** To improve sleep quality...",
  "domain": "general_health",
  "confidence": 0.95,
  "images": [
    {
      "image_url": "/api/images/general_health/sleep_guide.png",
      "caption": "Sleep hygiene diagram"
    }
  ],
  "sources": ["Sleep Guide.pdf", "Health Manual.pdf"]
}

Get Available Domains

GET /api/chat/domains/categorized

Document Upload

Command Line (cURL):

# Upload with domain specified
curl -X POST "http://localhost:8000/api/upload/doc" \
  -F "file=@document.pdf" \
  -F "domain=general_health"

# Auto-detect domain
curl -X POST "http://localhost:8000/api/upload/doc" \
  -F "file=@document.pdf"

Python Script:

# Single file upload
python scripts/batch_uploader.py --file document.pdf --domain general_health

# Batch upload from directory
python scripts/batch_uploader.py --source-dir downloads/ --domain general_health

# Auto-detect domain
python scripts/batch_uploader.py --file document.pdf --auto-detect

UI (Swagger):

  1. Open http://localhost:8000/docs
  2. Navigate to /api/upload/doc
  3. Click "Try it out"
  4. Upload file and execute

See docs/ARCHITECTURE.md for complete upload guide.

Health Check

GET /health

Complete API Reference

Visit http://localhost:8000/docs for interactive Swagger documentation.


πŸ€– Model Management

Hugging Face Model Integration

Meetara Core supports automatic model download from Hugging Face:

Configuration:

MEETARA_HF_MODEL_ID=meetara-lab/meetara-qwen3-1.7b-gguf
MEETARA_HF_MODEL_FILE=meetara-qwen3-1.7b-Q4_K_M.gguf

How it works:

  1. First Request: Downloads model from HF (~1.2 GB, one-time)
  2. Caching: Stores in ~/.cache/huggingface/hub (standard HF cache)
  3. Loading: Loads model once into memory
  4. Reuse: Same model instance used for all requests

Performance:

  • First request: ~2-3 minutes (download + load)
  • Subsequent requests: ~30-35 seconds (generation only)

Model Loading Flow

Request β†’ Check Cache β†’ Download (if needed) β†’ Load (once) β†’ Reuse

Custom Cache Location

To use a custom cache directory:

# Example: Use a custom directory for model cache
MEETARA_MODEL_CACHE_DIR=/path/to/custom/cache

# Default: Uses standard HF cache location
# Windows: C:\Users\<username>\.cache\huggingface\hub
# Linux/Mac: ~/.cache/huggingface/hub

πŸ”§ Development

Adding a New Domain

  1. Add to config/domain_config.yaml:
categories:
  your_category:
    tier: quality
    domains:
      your_domain:
        requires_validation: false
        priority: 2
  1. Add keywords to config/domain_keywords.yaml:
your_domain:
  keywords: ["keyword1", "keyword2", "phrase"]
  1. Upload documents:
curl -X POST http://localhost:8000/api/upload/doc \
  -F "file=@your_document.pdf" \
  -F "domain=your_domain"

No code changes required! Everything is config-driven.

Adding a New Tool

  1. Create tool in app/agent/tools/your_tool.py:
from langchain_core.tools import BaseTool

class YourTool(BaseTool):
    name = "your_tool"
    description = "Tool description"
    
    def _run(self, query: str) -> str:
        # Tool logic
        return result
  1. Add to agent in app/agent/planner.py:
tools.append(YourTool())

Running Tests

# Run all tests
pytest tests/

# Run specific test
pytest tests/test_chat_api.py

πŸš€ Deployment

Docker Deployment

# Build image
docker build -t meetara-core .

# Run container
docker run -p 8000:8000 \
  -v $(pwd)/vectorstore:/app/vectorstore \
  -v $(pwd)/.env:/app/.env \
  meetara-core

Docker Compose

docker-compose up -d

Production Considerations

  • Environment Variables: Set all sensitive configs via .env
  • Model Caching: Ensure ~/.cache/huggingface/hub is persistent
  • Vector Store: Mount vectorstore/ directory as volume
  • Logging: Configure log rotation and monitoring
  • Health Checks: Use /health endpoint for monitoring

πŸ” Troubleshooting

Model Not Loading

Issue: Model download fails or model not found

Solutions:

  1. Check internet connection (for HF download)
  2. Verify MEETARA_HF_MODEL_ID and MEETARA_HF_MODEL_FILE in .env
  3. Check disk space (~2 GB needed)
  4. Verify cache directory permissions
  5. Check logs: logs/meetara.log

Domain Not Detected

Issue: Query routed to wrong domain

Solutions:

  1. Check config/domain_keywords.yaml has relevant keywords
  2. Verify domain exists in config/domain_config.yaml
  3. Use context.domain to explicitly specify domain
  4. Check logs for domain detection scores

Slow Response Times

Issue: Responses take too long

Solutions:

  1. First request includes model download (one-time)
  2. Reduce LOCAL_LLM_MAX_LENGTH in .env
  3. Reduce LLM_CONTEXT_LENGTH in .env
  4. Check CPU/RAM usage
  5. Consider GPU acceleration if available

Port Already in Use

Issue: Port 8000 already in use

Solutions:

# Windows
netstat -ano | findstr :8000
taskkill /PID <PID> /F

# Linux/Mac
lsof -ti:8000 | xargs kill -9

# Or change port in .env
API_PORT=8001

πŸ“Š Performance Metrics

Typical Performance

Operation Time Notes
Model Download ~99s One-time only
Model Load ~1.6s One-time only
Domain Detection ~0.2-0.4s Per request
RAG Retrieval ~0.2-0.5s Per request
LLM Generation ~30-45s Per request
Total (cached) ~30-35s After first load

Optimization Tips

  • Model Caching: Model loads once, reused for all requests
  • Vector Store: ChromaDB with Snappy compression (75-85% reduction)
  • Shared Embeddings: Single embeddings model instance
  • Batch Operations: Use /api/vectorstore/all for bulk stats

πŸ”’ Security

Security Features

  • Input Sanitization: XSS and injection protection
  • PII Redaction: Automatic privacy protection in logs
  • File Validation: Secure file upload handling
  • CORS Configuration: Cross-origin request control
  • Rate Limiting: Built-in request throttling

Best Practices

  • Never commit .env file to git
  • Use environment variables for sensitive data
  • Regularly update dependencies
  • Monitor logs for suspicious activity
  • Use HTTPS in production

πŸ“– Additional Resources

Configuration Files

  • config/domain_config.yaml - Domain definitions and settings
  • config/domain_keywords.yaml - Domain keywords for detection
  • config/tier_config.yaml - Domain tier configurations
  • env.example - Environment variables template

Scripts

  • scripts/batch_uploader.py - Batch document upload utility
  • scripts/check_db_size.py - Database size checker
  • scripts/setup_environment.py - Automated environment setup

Documentation


🀝 Contributing

See docs/CONTRIBUTING.md for detailed contribution guidelines.

Quick steps:

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

Code Style

  • Formatting: Black
  • Imports: isort
  • Type Hints: Required for all functions
  • Docstrings: Required for all functions/classes

πŸ“„ License

MIT License - see LICENSE file for details


πŸ“š Documentation


πŸ†˜ Support


πŸŽ‰ Status

βœ… Production Ready

  • All endpoints tested and working
  • Model download and caching operational
  • Multi-domain RAG functioning
  • Emotion detection integrated
  • Multi-language support active
  • Documentation complete

Meetara Core - Empowering AI assistants with emotion-aware intelligence.

Version: 1.0.0
Last Updated: November 2025
Python: 3.12+

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors