9edcb58c93
Adds a searchable KB for חוק הביטוח הלאומי, תקנות הביטוח הלאומי, and חוזרי הביטוח הלאומי. Hybrid search (pgvector cosine + tsvector/trgm) fused with Reciprocal Rank Fusion, exposed to Shira as the `search_insurance_kb` tool. - api/services/kb/: asyncpg pool, Voyage voyage-multilingual-2 client, per-kind chunker (statute-by-section / circular header-aware), ingest pipeline with supersession (old source → superseded_by), hybrid search. - api/routes/admin_kb.py: POST /admin/kb/ingest (multipart), GET /admin/kb/stats. - mcp_server/tools/legal_kb_tools.py: `search_insurance_kb` registered under the `legal` toolset. - pyproject.toml: +asyncpg, +python-docx, +boto3, +python-multipart. Infra (external): pgvector/pgvector:pg16 on the shared PG, insurance_kb DB with hnsw + gin indexes, MinIO bucket insurance-kb, KB_DATABASE_URL in Infisical /espocrm, VOYAGE_API_KEY/VOYAGE_MODEL/KB_DATABASE_URL on the shira-hermes Coolify app. Refs Task Master #2 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
40 lines
2.4 KiB
JSON
40 lines
2.4 KiB
JSON
{
|
|
"master": {
|
|
"tasks": [
|
|
{
|
|
"id": "1",
|
|
"title": "Discovery tools + medical_case_analysis skill",
|
|
"description": "Add browse_folder/find_case_folder/set_case_folder_path tools, enrich list_documents with diagnostic, update prompt rules, and add medical_case_analysis skill.",
|
|
"details": "",
|
|
"testStrategy": "",
|
|
"status": "in-progress",
|
|
"dependencies": [],
|
|
"priority": "medium",
|
|
"subtasks": [],
|
|
"updatedAt": "2026-04-19T06:11:18.162Z"
|
|
},
|
|
{
|
|
"id": "2",
|
|
"title": "feat(kb): Phase 1 — Israeli National Insurance KB",
|
|
"description": "Phase 1 of the Israeli National Insurance knowledge base. Create insurance_kb database on the shared PostgreSQL instance with pgvector and pg_trgm extensions. Schema: kb_source (law/regulation/circular + supersession) and kb_chunk (content, heading_path, section_ref, tsvector, vector(1024) with HNSW cosine index). Create MinIO bucket insurance-kb. Add KB module to shira-hermes: config, asyncpg pool, Voyage client, parse+chunk+embed pipeline, hybrid search with RRF, search_insurance_kb tool (registered in mcp_server), POST /admin/kb/ingest, GET /admin/kb/stats. Store KB_DATABASE_URL in Infisical /espocrm. Validate end-to-end by ingesting 2-3 sample circulars and issuing a semantic query via the tool.",
|
|
"details": "See plan in conversation on 2026-04-21. Chunking strategy differs per kind: laws/regulations split by section; circulars split header-aware ~600 tokens with 80 overlap. Supersession: soft (superseded_by FK) not delete. Dependencies to add: asyncpg, voyageai (or REST via httpx), python-docx. Voyage model: voyage-multilingual-2, dim=1024, input_type=document for ingest / query for search.",
|
|
"testStrategy": "Manual: upload 2-3 sample PDF circulars via POST /admin/kb/ingest, verify kb_source + kb_chunk rows, verify embedding column non-null, call search_insurance_kb with a Hebrew query and confirm top-k results cite the right section_ref.",
|
|
"status": "in-progress",
|
|
"dependencies": [],
|
|
"priority": "high",
|
|
"subtasks": [],
|
|
"updatedAt": "2026-04-21T00:00:00.000Z"
|
|
}
|
|
],
|
|
"metadata": {
|
|
"version": "1.0.0",
|
|
"lastModified": "2026-04-21T00:00:00.000Z",
|
|
"taskCount": 2,
|
|
"completedCount": 0,
|
|
"tags": [
|
|
"master"
|
|
]
|
|
}
|
|
}
|
|
}
|