π What Is LegalEase AI?
LegalEase AI is a full-stack legal research assistant that:
- Performs fast, intelligent semantic search across legal documents
- Answers natural language legal questions using a Gemini-powered agent
- Supports metadata filtering and document classification
- Includes both a CLI and Flask web UI
- Uses MindsDB for all intelligent querying and indexing
π§± Stack I Used
| Component | Tech | 
|---|---|
| Backend | Flask + MindsDB SDK | 
| Vector Store | PostgreSQL + pgvector | 
| Embeddings | mxbai-embed-largevia Ollama | 
| Reranking | Gemini 2.0 Flash | 
| Frontend | HTML, Bootstrap, styles.css | 
| Infra | Docker (for Ollama, PostgreSQL, MindsDB) | 
π Key Features
1. Semantic Search via MindsDB KB
SELECT *
FROM legal_kb_pg
WHERE content LIKE 'Miranda rights'
AND metadata['category'] = 'Criminal Law';
2. PGVector Indexing
CREATE INDEX ON KNOWLEDGE_BASE legal_kb_pg;
3. Scheduled Job Ingestion
CREATE JOB ingest_from_csv
AS (
  INSERT INTO legal_kb_pg
  SELECT * FROM files.legal_docs
  WHERE doc_id > LAST;
)
EVERY 1 HOUR;
4. Gemini Agent with KB Attached
CREATE AGENT legal_gemini_agent
USING
  model = 'gemini-2.0-flash',
  google_api_key = '<your-key>',
  include_knowledge_bases = ['legal_kb_pg'],
  prompt_template = 'You are LegalEase AI, a legal research assistant. Question: {{question}}';
πΈ User Interface
- 
/search: Ask legal questions and see search results with relevance scores.
- 
/agent: Ask natural questions like "What happened in Roe v. Wade?"
- 
/upload: Insert new legal documents into the KB.
- 
/jobs: View or create automatic ingestion jobs.
- 
/initialize: Create your KB and Agent in one click.
All queries are handled via MindsDB and routed through Gemini and Ollama for reasoning + embeddings.
π Bug Report & Open Source Contribution
I also discovered and reported a real-world issue while integrating MindsDB and Ollama:
π View my GitHub Issue on MindsDB
This was a great experience contributing back to a platform thatβs been super helpful.
π GitHub Repository
π https://github.com/sharmachaitanya945/legalease
Includes:
- 
README.mdwith setup instructions
- 
queries.pyfor full KB + agent automation
- 
styles.css, templates,SUBMISSION.md, andCONTRIBUTING.md
π¬ Want to Collaborate?
Iβd love to work with others on expanding this project:
- Add chat memory
- Create an LLM Router
- Multi-KB and table question merging
π§βπ» See CONTRIBUTING.md
π§ Summary
LegalEase AI shows how MindsDB can power:
- Embedded knowledge search
- Semantic metadata filtering
- RAG-style agentic reasoning
- A full legal research pipeline!
Thanks to the MindsDB team and this amazing community π
Happy to answer any questions or hear your feedback below! π
Built with β€οΈ by sharmachaitanya945 using MindsDB, Ollama, Gemini & Flask.
 
 
              
 
    
Top comments (0)