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:
@@ -5,7 +5,7 @@ use sqlx::PgPool;
|
||||
use crate::config::DatabaseConfig;
|
||||
use crate::error::SaasResult;
|
||||
|
||||
const SCHEMA_VERSION: i32 = 12;
|
||||
const SCHEMA_VERSION: i32 = 13;
|
||||
|
||||
/// 初始化数据库
|
||||
pub async fn init_db(config: &DatabaseConfig) -> SaasResult<PgPool> {
|
||||
|
||||
Reference in New Issue
Block a user