Add FastAPI server for KG-based report generation
Claude
Unverified signature
0f06ab1
- Add api/server.py with endpoints:
- GET /companies - list all companies
- GET /companies/{id}/stats - get doc/chunk counts
- POST /reports/generate - generate report sections from KG
- Add fastapi and uvicorn dependencies
- Add `make api` and `make api-prod` Makefile targets
https://claude.ai/code/session_01PQ6QMnmh1DbR6PH9DaiPpS
Add KG-based report generation feature
Claude
Unverified signature
e0dd55e
Implements knowledge graph-based report generation that allows generating
reports directly from documents stored in Supabase, without requiring file uploads.
Key changes:
- Reorganize KG services into services/kg/ module (client.py, retrieval.py)
- Add KGRetrievalService with 3 retrieval modes:
* chunks: Vector search for relevant chunks
* full_documents: Use complete parsed_text from documents
* hybrid: Find top docs via chunks, then use full text (default)
- Add api/kg_routes.py with run_kg_generation() and helper functions
- Add "KG Reports" tab to Gradio UI (app.py) with:
* Company dropdown selector
* Data availability stats display
* Retrieval mode selector
* Section generation buttons (TAM, Product, Signals, Team)
- Add get_all_companies() method to KGClient
- Support embedding queries and vector search via OpenAIEmbedding
- Integrate with existing LLM pipeline and tracing infrastructure
The new flow allows users to select a company from the knowledge graph,
choos…
add initial unit and integration tests, makefile, and more codebase guidelines