通用源管理系统
一个灵活的系统,用于管理各种类型的来源(论文、书籍、网页等)并将它们与知识图谱集成。
特征
核心功能
- 通过内部 UUID 系统进行通用源识别
- 支持多种来源类型(论文、网页、书籍、视频、博客)
- 每个来源支持多个标识符(arxiv、DOI、语义学者、ISBN、URL)
- 带有标题和内容的结构化笔记
- 状态跟踪(未读、正在读、已完成、已存档)
实体集成
- 将源链接到知识图谱实体
- 跟踪来源和实体之间的关系
- 灵活的关系类型(讨论、介绍、扩展等)
- 与内存图集成
先决条件
该系统与MCP 内存服务器集成,用于持久知识图谱存储。
快速入门
- 使用我们的模式创建一个新的 SQLite 数据库:
# Create a new database
sqlite3 sources.db < create_sources_db.sql
- 安装源管理服务器:
# Install for Claude Desktop with your database path
fastmcp install source-manager-server.py --name "Source Manager" -e SQLITE_DB_PATH=/path/to/sources.db
架构
核心表
-- Sources table
CREATE TABLE sources (
id UUID PRIMARY KEY,
title TEXT NOT NULL,
type TEXT CHECK(type IN ('paper', 'webpage', 'book', 'video', 'blog')) NOT NULL,
identifiers JSONB NOT NULL,
status TEXT CHECK(status IN ('unread', 'reading', 'completed', 'archived')) DEFAULT 'unread'
);
-- Source notes
CREATE TABLE source_notes (
source_id UUID REFERENCES sources(id),
note_title TEXT NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (source_id, note_title)
);
-- Entity links
CREATE TABLE source_entity_links (
source_id UUID REFERENCES sources(id),
entity_name TEXT,
relation_type TEXT CHECK(relation_type IN ('discusses', 'introduces', 'extends', 'evaluates', 'applies', 'critiques')),
notes TEXT,
PRIMARY KEY (source_id, entity_name)
);
使用示例
1. 管理来源
添加具有多个标识符的论文:
add_source(
title="Attention Is All You Need",
type="paper",
identifier_type="arxiv",
identifier_value="1706.03762",
initial_note={
"title": "Initial thoughts",
"content": "Groundbreaking paper introducing transformers..."
}
)
# Add another identifier to the same paper
add_identifier(
title="Attention Is All You Need",
type="paper",
current_identifier_type="arxiv",
current_identifier_value="1706.03762",
new_identifier_type="semantic_scholar",
new_identifier_value="204e3073870fae3d05bcbc2f6a8e263d9b72e776"
)
添加网页:
add_source(
title="Understanding Transformers",
type="webpage",
identifier_type="url",
identifier_value="https://example.com/transformers",
)
2. 记笔记
向来源添加注释:
add_note(
title="Attention Is All You Need",
type="paper",
identifier_type="arxiv",
identifier_value="1706.03762",
note_title="Implementation details",
note_content="The paper describes the architecture..."
)
3.实体链接
将源链接到实体:
link_to_entity(
title="Attention Is All You Need",
type="paper",
identifier_type="arxiv",
identifier_value="1706.03762",
entity_name="transformer",
relation_type="introduces",
notes="First paper to introduce the transformer architecture"
)
按实体查询来源:
get_entity_sources(
entity_name="transformer",
type_filter="paper",
relation_filter="discusses"
)
最佳实践
- 源管理
- 在参考文献中使用一致的标题
- 提供尽可能多的标识符
- 保持笔记结构清晰,标题清晰
- 使用适当的源类型
- 实体链接
- 关系类型要具体
- 为关系添加上下文注释
- 根据内存图验证实体名称
- 保持实体关系的集中
技术细节
- 来源识别
- 内部 UUID 系统用于一致引用
- 每个源有多个外部标识符
- 灵活的标识符类型(arxiv、doi、url 等)
- 基于标题和类型的模糊匹配
- 数据组织
- 带标题的结构化笔记
- 清晰的源类型分类
- 实体关系跟踪
- 状态管理
贡献
- 分叉存储库
- 创建功能分支
- 添加新功能测试
- 提交拉取请求