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…
Implements V1 ingestion system that monitors a Google Drive folder,
stores raw files to GCS, and populates Supabase KG with documents,
chunks, and embeddings.
Key components:
- Abstract ContentSource/StorageBackend interfaces for extensibility
- GoogleDriveSource: folder listing, file download, Google Docs export
- GCSStorageBackend: raw file storage with content hashing
- IngestionOrchestrator: coordinates full sync pipeline
- CLI for manual sync operations (python -m cli.ingest sync --full)
Schema changes:
- Add ingestion_source, external_id, external_path columns to documents
- Add sync_cursors table for tracking sync state
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>