LegalForge AI
LegalForge automates legal document analysis in four stages: 1. **Upload** — ingest PDF legal documents into a Qdrant vector knowledge base 2. **Research** — Legal Researcher agent finds cases, precedents, and citations via DuckDuckGo + knowledge base 3. **Analyze** — Contract Analyst and Legal Strategist review terms, risks, and strategy 4. **Report** — Team Lead synthesizes analysis, key points, and recommendations
LegalForge AI
Multi-agent legal document analysis by Sharad Khare.
LegalForge AI is a coordinated legal agent team that indexes PDF documents in Qdrant, searches the web with DuckDuckGo, and delivers contract review, legal research, risk assessment, and compliance analysis through Streamlit.
Built and maintained by Sharad Khare — AI strategist, full-stack developer, and creator of practical agent workflows.
What this project does
LegalForge automates legal document analysis in four stages:
1. Upload — ingest PDF legal documents into a Qdrant vector knowledge base
2. Research — Legal Researcher agent finds cases, precedents, and citations via DuckDuckGo + knowledge base
3. Analyze — Contract Analyst and Legal Strategist review terms, risks, and strategy
4. Report — Team Lead synthesizes analysis, key points, and recommendations
Why Sharad Khare built LegalForge AI
Legal review is time-intensive and requires cross-disciplinary expertise — research, contract parsing, and strategic advice. LegalForge demonstrates how a coordinated Agno agent team with vector search compresses that workflow into a single Streamlit experience.
How it works
PDF Upload
│
▼
Qdrant Vector Index (OpenAI embeddings)
│
▼
Legal Agent Team
├── Legal Researcher (DuckDuckGo + knowledge base)
├── Contract Analyst (clause and term review)
└── Legal Strategist (risk and recommendations)
│
▼
Team Lead → Analysis, Key Points, Recommendations
Agent roles
| Agent | Tools | Output |
|-------|-------|--------|
| Legal Researcher | DuckDuckGo, Qdrant KB | Case law and precedent research |
| Contract Analyst | Qdrant KB | Clause review and term analysis |
| Legal Strategist | Qdrant KB | Risk assessment and strategy |
| Team Lead | Coordinates all agents | Comprehensive legal report |
Analysis types
- Contract Review
- Legal Research
- Risk Assessment
- Compliance Check
- Custom Query
Features
- PDF upload with Qdrant vector indexing
- Three specialized legal agents plus Team Lead coordinator
- DuckDuckGo web research combined with document knowledge base
- Five analysis modes from contract review to custom queries
- Tabbed output: detailed analysis, key points, recommendations
Quick start
cd legalforge-ai
pip install -r requirements.txt
streamlit run app.py
Required API keys
- OpenAI API key — agent reasoning and embeddings
- Qdrant API key — vector database for document search
- Qdrant URL — your Qdrant Cloud or self-hosted instance URL
Project structure
legalforge-ai/
├── app.py
├── legalforge/
│ ├── config.py
│ ├── documents.py
│ ├── agents.py
│ └── analysis.py
├── requirements.txt
├── pyproject.toml
└── README.md
Who this is for
- Legal professionals reviewing contracts and agreements
- Compliance teams checking regulatory alignment
- Startup founders evaluating vendor and partnership contracts
- Developers learning multi-agent + vector search patterns for legal tech
Use cases
- Upload a contract PDF and run automated clause review
- Research relevant case law alongside uploaded documents
- Assess legal risks and liabilities in agreements
- Run compliance checks against regulatory requirements
- Ask custom legal questions with full team coordination
Author
- Website: sharadkhare.in
License
MIT © Sharad Khare
Loading file tree…
Select a file to preview its source.
cd legalforge-ai
pip install -r requirements.txt
streamlit run app.py