A powerful AI-driven agent that answers legal queries related to the Constitution of India and the Indian Penal Code (IPC) using keyword generation, vector search, and smart tool orchestration.
-
User enters a legal query
โ e.g., "When can the Indian government restrict freedom of speech?" -
AI Agent activates tools:
- ๐
generate_keywordsโ Extracts keywords like "freedom", "speech", "restrictions" - ๐
search_db_constitutionโ Searches Indian Constitution vector DB - โ๏ธ
search_db_penal_codeโ Searches IPC vector DB - ๐
enhanced_cross_domain_legal_searchโ Performs parallel searches and cross-references between Constitution and IPC - ๐ Synthesizes all retrieved data into a final answer
- ๐
-
Returns structured legal answer
With referenced articles and sections.
generate_keywords: Keyword extractor from user inputsearch_db_constitution: Vector search on Constitution articlessearch_db_penal_code: Vector search on IPC sectionsai_agent: Controls the flow, uses tools, composes the answer
A fine-tuned AI model trained on court judgments to:
- Predict punishment based on case description
- Reference relevant IPC sections
- Suggest similar past judgments
Planned Tool: predict_punishment_from_case
- Smart Search: Multi-stage hybrid search strategy for comprehensive results
- Cross-Reference: Automatic linking between Constitution and IPC sections
- Context-Aware: Understands legal context and relationships
- Fast & Accurate: Optimized vector search with result fusion
- Python 3.8+
- Milvus Vector Database
- OpenAI GPT Models / Google Gemini Models
- FastAPI Backend
For test results and detailed logs, check out the generated scripts and logs at:
- Constitution of India
- Indian Penal Code (IPC)
- Legal cross-references database
