-
Notifications
You must be signed in to change notification settings - Fork 92
M2: Document Indexing API on OpenAI-Compatible Server #651
Copy link
Copy link
Open
Labels
domain:surfacesAgent UI, Telegram, WhatsApp, Slack/Discord, mobileAgent UI, Telegram, WhatsApp, Slack/Discord, mobileenhancementNew feature or requestNew feature or requesttrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skillsHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills
Metadata
Metadata
Assignees
Labels
domain:surfacesAgent UI, Telegram, WhatsApp, Slack/Discord, mobileAgent UI, Telegram, WhatsApp, Slack/Discord, mobileenhancementNew feature or requestNew feature or requesttrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skillsHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills
Priority: P0 — Required for RAG-based webapp integration
Effort: Medium (3-5 days)
Problem
The only way to index documents into GAIA's RAG system over HTTP is through the full UI server (
gaia chat --ui), which brings in session management, Electron dependencies, and a heavy stack. The OpenAI-compatible API server (openai_server.py) has zero document/RAG endpoints. A webapp backend cannot programmatically index content.Deliverable
Add document management endpoints to
openai_server.py:Implementation approach
RAGSDKinstance in the API server (singleton, lazy-initialized)POST /v1/documentsaccepts:{ "path": "/path/to/doc.md" }or{ "content": "raw text...", "name": "doc-name" }.md,.txt,.pdf(via existing pypdf integration in RAGSDK)pending,indexing,ready,errorquery_documentstool automatically searches documents indexed via this APIFiles to change
src/gaia/api/openai_server.py— add 5 new FastAPI routessrc/gaia/api/schemas.py— add request/response models for documentssrc/gaia/rag/sdk.py— expose document listing/removal if not already availableAcceptance criteria
POST /v1/documentswith a file path or raw text and get a document ID back/v1/chat/completionscan retrieve content from indexed documentsGET /v1/documentsreturns a list of all indexed documents with statusDELETE /v1/documents/:idremoves a document and its chunks from the indexContext
Full milestone plan:
docs/plans/webapp-integration.md