An AI-powered legal advisory system leveraging Cohere's LLM capabilities for advanced legal assistance.
- Document embedding and semantic search
- Legal document analysis
- Query understanding and processing
- Vector database storage for legal knowledge
- Client Consultation Agent (Model A) implementation
- Redis caching for efficient embedding storage and retrieval
The easiest way to run the system is with Docker:
-
Clone the repository:
git clone https://github.com/VarnitOS/GenAiGenesis.git cd GenAiGenesis -
Copy the environment example and add your API keys:
cp backend/.env.example backend/.envEdit the
backend/.envfile and add your Cohere API key. -
Run the system with Docker:
./run.sh -
Access the system:
- API: http://localhost:8080
- Redis GUI: http://localhost:8001
-
Set up Python environment (Python 3.9+ required)
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt -
Set up Redis:
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest -
Run the Flask app:
cd backend PYTHONPATH=/path/to/GenAiGenesis/backend python -m app.flask_app
GET /: Welcome messageGET /test: Test endpointPOST /api/embed: Generate embedding for a queryPOST /api/generate: Generate text using CoherePOST /api/client/understand: Analyze client queryPOST /api/client/respond: Generate response to client query
The system uses a modular design with three main components:
- Client Consultation Agent (Model A)
- Redis for embedding caching and vector storage
- Flask API for client access
The Redis integration provides:
- Persistent caching of embeddings
- Improved performance with reduced API calls
- Failover to in-memory cache if Redis is unavailable
This repository contains multiple components:
backend/: The LegalMind AI backend system with Model A (Client Consultation Agent)
MIT