feat(saas): add knowledge base module — categories, items, versions, search, analytics

- 5 knowledge tables (categories, items, chunks, versions, usage) with pgvector + HNSW + GIN indexes
- 23+ API routes covering full CRUD, tree-structured categories, version snapshots
- Keyword-based search with ILIKE + array match (placeholder for vector search)
- Analytics endpoints: overview, trends, top-items, quality, gaps
- Markdown-aware content chunking with overlap strategy
- Worker dispatch for async embedding generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-04-02 00:21:28 +08:00
parent b66087de0e
commit ef60f9a183
8 changed files with 1194 additions and 1 deletions

View File

@@ -26,3 +26,4 @@ pub mod agent_template;
pub mod scheduled_task;
pub mod telemetry;
pub mod billing;
pub mod knowledge;