Files
insightflow/README.md

89 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# InsightFlow - Audio to Knowledge Graph Platform
## Phase 3: Memory & Growth - Completed ✅
### 新增功能
#### 1. 多文件图谱融合 ✅
- 支持上传多个音频文件到同一项目
- 系统自动对齐实体,合并图谱
- 实体提及跨文件追踪
- 文件选择器切换不同转录内容
#### 2. 实体对齐算法优化 ✅
- 新增 `entity_aligner.py` 模块
- 支持使用 Kimi API embedding 进行语义相似度匹配
- 余弦相似度计算
- 自动别名建议
- 批量实体对齐 API
#### 3. PDF/DOCX 文档导入 ✅
- 新增 `document_processor.py` 模块
- 支持 PDF、DOCX、TXT、MD 格式
- 文档文本提取并参与实体提取
- 文档类型标记(音频/文档)
#### 4. 项目知识库面板 ✅
- 全新的知识库视图
- 统计面板:实体数、关系数、文件数、术语数
- 实体网格展示(带提及统计)
- 关系列表展示
- 术语表管理(添加/删除)
- 文件列表展示
### 技术栈
- 后端: FastAPI + SQLite
- 前端: 原生 HTML/JS + D3.js
- ASR: 阿里云听悟
- LLM: Kimi API
- 文档处理: PyPDF2, python-docx
### 部署
```bash
# 构建 Docker 镜像
docker build -t insightflow:phase3 .
# 运行容器
docker run -d \
-p 18000:8000 \
-v /opt/data:/app/data \
-e KIMI_API_KEY=your_key \
-e ALIYUN_ACCESS_KEY_ID=your_key \
-e ALIYUN_ACCESS_KEY_SECRET=your_secret \
insightflow:phase3
```
### API 文档
#### 新增 API
**文档上传**
```
POST /api/v1/projects/{project_id}/upload-document
Content-Type: multipart/form-data
file: <文件>
```
**知识库查询**
```
GET /api/v1/projects/{project_id}/knowledge-base
```
**术语表管理**
```
POST /api/v1/projects/{project_id}/glossary
GET /api/v1/projects/{project_id}/glossary
DELETE /api/v1/glossary/{term_id}
```
**实体对齐**
```
POST /api/v1/projects/{project_id}/align-entities?threshold=0.85
```
### 数据库 Schema 更新
- `transcripts` 表新增 `type` 字段audio/document
- `entities` 表新增 `embedding` 字段
- 新增索引优化查询性能