用户上传 Brief 或需求文件后,服务端自动完成需求解析、达人库检索、外部 API 兜底、推荐排序和名单导出。系统应优先使用自有达人库;自有库不足时再调用 JustOne API 补充候选,并将 JustOne 返回的原始数据全部沉淀,作为后续自有库建设和 RAG 检索的数据缓存。
用于已清洗、可直接推荐的达人主表。
| 字段 | 类型 | 说明 |
|---|---|---|
| id | uuid / bigint | 主键 |
| platform | varchar | 平台,如 xiaohongshu、douyin |
| platform_user_id | varchar | 平台账号 ID |
| display_name | varchar | 昵称 |
| gender | varchar | 性别 |
| fans_count | bigint | 粉丝数,统一存真实数量 |
| liked_collect_count | bigint | 赞藏/互动数,统一存真实数量 |
| content_type | text | 原始内容类型文本 |
| content_tags | jsonb | 结构化内容标签 |
| persona_tags | jsonb | 人设/风格标签 |
| city | varchar | 业务城市 |
| geo_location | varchar | 真实地理位置 |
| profile_url | text | 主页链接 |
| cooperation_method | varchar | 合作方式 |
| image_price | int | 图文报价 |
| video_price | int | 视频报价 |
| min_price | int | 最低报价 |
| source_kind | varchar | uploaded/company/confirmed_api |
| source_file | text | 上传文件或来源 |
| source_confidence | int | 来源可信度 |
| updated_at | timestamp | 最近更新时间 |
| embedding_text | text | 用于向量化的拼接文本 |
| embedding | vector | 向量字段,后续接 pgvector/Milvus 等 |
建议唯一索引:(platform, platform_user_id)。
用于保存 JustOne API 等接口返回的未清洗原始数据。
| 字段 | 类型 | 说明 |
|---|---|---|
| id | uuid / bigint | 主键 |
| provider | varchar | justone/tikhub 等 |
| endpoint | text | 请求接口 |
| request_params | jsonb | 请求参数 |
| response_body | jsonb | 原始响应 |
| fetched_at | timestamp | 获取时间 |
| expires_at | timestamp | 默认 fetched_at + 30 天 |
| normalized_status | varchar | pending/normalized/rejected |
| archive_path | text | 本地归档路径 |
建议索引:provider, fetched_at, expires_at,以及对 request_params 建 GIN 索引。
用于记录每次 Brief 检索过程,方便复盘。
| 字段 | 类型 | 说明 |
|---|---|---|
| id | uuid / bigint | 主键 |
| task_id | varchar | 提号任务 ID |
| query_text | text | Brief/检索文本 |
| criteria | jsonb | 结构化搜索条件 |
| local_hit_count | int | 本地库命中数 |
| provider_hit_count | int | 外部 API 命中数 |
| final_count | int | 最终候选数 |
| created_at | timestamp | 发生时间 |
当前开发环境已经升级为本地 PostgreSQL:
tihao_aitihao_ai_appnpm run db:initserver/db/schema.sqlcreator_profile_cleanprovider_raw_cachecreator_retrieval_eventdocs/provider-archives/本地先使用 double precision[] 保存向量,并通过 PostgreSQL 函数 cosine_similarity 做余弦相似度检索。上线环境如安装 pgvector,可将 embedding 字段迁移为 vector 类型,并保留当前服务层的查询编排逻辑。