进行中
一个灵活的系统,用于管理各种类型的资源(论文、书籍、网页等)并将其与知识图集成。
特性
核心功能
- 具有内部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等) - 基于标题和类型的模糊匹配
- 数据组织
- 带标题的结构化笔记 - 明确源类型分类 - 实体关系跟踪 - 状态管理
贡献
- 分叉存储库
- 创建要素分支
- 为新功能添加测试
- 提交拉取请求
