Seamlessly extract, analyze, and gain insights from contracts using Portia AI.
Monorepo: Next.js 15.5 (Frontend) & FastAPI + Portia SDK (Backend)Built during AgentHack 2025!
- Automated Legal Document Extraction:
Upload PDF contracts and agreements; extract parties, obligations, dates, and critical clauses in seconds. - Hybrid AI + Human-in-the-Loop Review:
Portia agent flags ambiguities and routes them to you — ensuring high-confidence results. - Real-Time Risk Analysis:
Instantly identifies missing or risky clauses so you can act before it’s too late. - Interactive Insights Dashboard:
Visualize, export, and search structured contract data, deadlines, and risk metrics. - Seamless Collaboration:
Multi-user access, notifications, and rapid feedback cycles for audit-ready workflows.
Users upload a PDF through the Next.js frontend.
- React dropzone for upload
- Immediate feedback on format, size, duplicates
FastAPI backend manages async document processing:
- Saves incoming file & metadata
- Kicks off Portia agent with
PDFReaderand legal extraction plan - Portia parses text, runs custom clause prompts, structures results:
- Extracted:
parties,dates,obligations,clauses, risk triggers - If ambiguity:
Portia’s planners flag for human input, pausing flow until legal review/response is given (stored to DB, resumes on resolve)
- Extracted:
- Stores final structured data + trace for full auditability
- Fetches extraction summaries and traces via REST API
- Dynamic table and PDF viewer with highlight overlays
- Real-time updates via long-poll for background jobs
- User can review and download data as PDF or JSON
- Sign Up / Log In
Fast, secure onboarding with multiple account linking. - Document Upload
Drag-and-drop or browse, status bar feedback. - Background Extraction
Automatic queueing; jobs start instantly. - Review Results
Explore extracted data; flagged sections if review needed. - Action & Collaboration
Mark issues resolved, or comment for later review. - Export & Analyze
Download structured data or view reports in dashboard.
- Node.js (v18+)
- Python 3.10+
- Docker Compose (for databases/cache)
- Portia API SDK key (sign up at Portia Labs)
git clone https://github.com/yourusername/obligence.git
cd obligencedocker-compose up -dcd apps/backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # Fill PORTIA & DB keys
alembic upgrade head # Migrate DB
uvicorn app.main:app --reloadcd apps/frontend
pnpm install
cp .env.local.example .env.local # Set NEXT_PUBLIC_API_URL
pnpm dev- Access the frontend at http://localhost:3000
- API is served at http://localhost:8000
obligence/
├── apps/
│ ├── backend/ # FastAPI + Portia SDK agent logic & API
│ └── frontend/ # Next.js 14, React, all UI/UX assets
├── infrastructure/ # Docker, scripts, infra-as-code
└── README.md
⭐ Made by [Ishaan](https://github.com/ishaan2053) and [Pranav Tripathi](http://github.com/prnvtripathi) during AgentHack 2025 ⭐



