ChartAI is an AI-powered tool that extracts and visualizes complex corporate structures from legal documents and text. It uses Gemini AI to parse entity relationships (ownership, debt, control) and renders them as interactive, auto-arranged diagrams.
- AI-Powered Extraction: Automatically parses legal text to identify entities (Corporations, LLCs, Partnerships, etc.) and relationships.
- Document Upload: Upload PDF, DOCX, PPTX, and image files for analysis using Docling.
- Interactive Visualization: Renders corporate structures using React Flow with automatic layout (elkjs).
- Smart Routing: Intelligent edge routing to minimize crossing and improve readability.
- Chat Interface: Refine and modify charts using natural language commands.
- Export: Export charts as images for reports and presentations.
- Frontend: React 19, TypeScript, Vite, Tailwind CSS, shadcn/ui, React Flow, elkjs
- Document Extraction: Python Flask server with Docling
- AI: Google Gemini 2.5 Flash
- Node.js (v18+)
- npm or pnpm
- Python 3.10+ (for document extraction)
```bash
npm install
echo "VITE_GEMINI_API_KEY=your_api_key_here" > .env
npm run dev ```
The frontend will be available at http://localhost:5173
```bash
cd server python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python extract_server.py ```
The extraction server will run on http://localhost:5001
Note: The first time you extract a document, Docling will download required ML models (~2GB). This only happens once.
- Open the app at http://localhost:5173
- Paste legal text describing corporate structure in the chat
- The AI will extract entities and relationships and display them as a diagram
- Start the Python extraction server (see above)
- Click the 📎 button in the chat
- Upload a PDF, DOCX, PPTX, or image file
- The document text will be extracted and analyzed
Once a chart is generated, you can refine it with natural language:
- "Add a new entity called HoldCo"
- "Change the ownership from 65% to 80%"
- "Add a debt relationship between Bank X and Company Y"
| Variable | Description | Required |
|---|---|---|
| `VITE_GEMINI_API_KEY` | Google Gemini API key | Yes |
| `VITE_EXTRACT_SERVER_URL` | Document extraction server URL (default: http://localhost:5001) | No |
- PDF (.pdf)
- Microsoft Word (.docx, .doc)
- Microsoft PowerPoint (.pptx, .ppt)
- Images (.png, .jpg, .jpeg, .tiff, .bmp)
MIT