feat: implement RAG Service MVP with PARSER + Memory integration

RAG Service Implementation:
- Create rag-service/ with full structure (config, document_store, embedding, pipelines)
- Document Store: PostgreSQL + pgvector via Haystack
- Embedding: BAAI/bge-m3 (multilingual, 1024 dim)
- Ingest Pipeline: Convert ParsedDocument to Haystack Documents, embed, index
- Query Pipeline: Retrieve documents, generate answers via DAGI Router
- FastAPI endpoints: /ingest, /query, /health

Tests:
- Unit tests for ingest and query pipelines
- E2E test with example parsed JSON
- Test fixtures with real PARSER output example

Router Integration:
- Add mode='rag_query' routing rule in router-config.yml
- Priority 7, uses local_qwen3_8b for RAG queries

Docker:
- Add rag-service to docker-compose.yml
- Configure dependencies (router, city-db)
- Add model cache volume

Documentation:
- Complete README with API examples
- Integration guides for PARSER and Router
This commit is contained in:
Apple
2025-11-16 04:41:53 -08:00
parent d3c701f3ff
commit 9b86f9a694
19 changed files with 1275 additions and 97 deletions

View File

@@ -0,0 +1,56 @@
{
"doc_id": "microdao-tokenomics-2025-11",
"doc_type": "pdf",
"pages": [
{
"page_num": 1,
"blocks": [
{
"type": "heading",
"text": "Токеноміка MicroDAO",
"bbox": {"x": 0, "y": 0, "width": 800, "height": 50},
"reading_order": 1
},
{
"type": "paragraph",
"text": "MicroDAO використовує токен μGOV як ключ доступу до приватних спільнот. Стейкінг μGOV дозволяє отримувати дохід та участь у управлінні.",
"bbox": {"x": 0, "y": 60, "width": 800, "height": 100},
"reading_order": 2
},
{
"type": "paragraph",
"text": "Стейкінг є основним механізмом отримання доходу в MicroDAO. Користувачі можуть стейкати токени та отримувати винагороди за участь у спільноті.",
"bbox": {"x": 0, "y": 170, "width": 800, "height": 100},
"reading_order": 3
}
],
"width": 800,
"height": 600
},
{
"page_num": 2,
"blocks": [
{
"type": "heading",
"text": "Роль стейкінгу",
"bbox": {"x": 0, "y": 0, "width": 800, "height": 50},
"reading_order": 1
},
{
"type": "paragraph",
"text": "Стейкінг μGOV токенів дає користувачам право голосу та доступ до приватних каналів спільноти. Мінімальна сума стейкінгу визначається кожною спільнотою окремо.",
"bbox": {"x": 0, "y": 60, "width": 800, "height": 100},
"reading_order": 2
}
],
"width": 800,
"height": 600
}
],
"metadata": {
"dao_id": "daarion",
"title": "Токеноміка MicroDAO",
"created_at": "2025-01-15T10:00:00Z"
}
}