PolicyPilot AI is a beginner-friendly full-stack MVP that helps users find risky clauses in leases, insurance policies, subscription agreements, and service contracts.
The app supports PDF uploads and pasted text. The backend extracts text, splits it into clauses, classifies risk signals, and returns plain-English guidance for the frontend results page.
PolicyPilot AI/
backend/
app.py Flask API routes
analyzer.py Clause splitting and risk analysis logic
parser.py PDF text extraction helpers
requirements.txt Python dependencies
uploads/ Temporary uploaded PDFs
frontend/
src/
App.jsx Main React experience
api.js Backend API client
index.css Tailwind entry and global styles
package.json Vite React app scripts
cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python app.pyThe Flask API runs at http://localhost:5000.
cd frontend
npm install
npm run devThe Vite app runs at http://localhost:5173.
POST /api/analyze
Send either:
multipart/form-datawith afilePDF- JSON with
{ "text": "..." }
The response includes extracted text, risky clauses, top five risky points, and an overall summary.
The current analyzer uses transparent heuristic rules so the app works immediately without external credentials. The backend is structured so analyzer.py can later call an AI model and return the same response shape to the frontend.