文档知识图谱导入工具

Graphiti Influxer是一款将大型文档(PDF、EPUB)智能分块并导入Graphiti知识图谱的工具,通过MCP协议实现语义连接,解决AI助手处理大型文档的难题。

  • by Milofax
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Milofax/graphiti-influxer-public

使用说明

图形输入器

将大型文档(PDF、EPUB)摄入 Graphici知识图谱 通过MCP。

问题

Claude的上下文窗口无法处理大型文档。你在书籍、论文和文档中的宝贵知识仍然无法被人工智能助手访问。传统的RAG解决方案提供了没有语义连接的“文本沙漠”。

解决方案

Graphiti Influxer是一个web界面,它:

  • 提取物 来自PDF和EPUB的文本和元数据
  • 块 语义边界上的智能内容
  • 验证 具有外部API查找的元数据(OpenLibrary、CrossRef)
  • 摄入 通过MCP协议将块转换为Graphiti
  • 轨迹 优雅地进步和处理失败

状态

第一阶段:进行中 -Web界面MVP

特性

  • 拖放文件上传(PDF、EPUB)
  • 自动元数据提取(标题、作者、年份)
  • 基于卡片的评论界面,支持内联编辑
  • 通过OpenLibrary、CrossRef、ISBN.de查找元数据
  • 语义组块(段落边界,500-3000个字符)
  • 实时摄取进度
  • 恢复中断摄入的能力

需求

安装

使用紫外线(推荐)

# Clone the repository
git clone https://github.com/Milofax/graphiti-influxer-public.git
cd graphiti-influxer-public

# Install dependencies
uv sync

# Run the application
uv run influxer --help

使用pip

# Clone the repository
git clone https://github.com/Milofax/graphiti-influxer-public.git
cd graphiti-influxer-public

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install package
pip install -e .

# Run the application
influxer --help

用法

# Check MCP server connection
influxer status

# Ingest a PDF document
influxer ingest document.pdf --group-id main

# Ingest with custom metadata
influxer ingest book.epub --group-id main --title "Custom Title" --author "Author Name"

配置

通过环境变量进行配置或 .env 文件:

# MCP Server connection
GRAPHITI_MCP_URL=http://localhost:8000
GRAPHITI_MCP_TIMEOUT=30

# Ingestion settings
INFLUXER_CHUNK_SIZE=2000
INFLUXER_RATE_LIMIT=1.0  # requests per second

发展

# Install dev dependencies
uv sync --dev

# Run linter
uv run ruff check src tests

# Run type checker
uv run mypy src

# Run tests
uv run pytest tests -v

# Format code
uv run ruff format src tests

建筑

Browser (React + TypeScript)
         │
    HTTP/REST
         │
         ▼
┌─────────────────────────────────────┐
│     Influxer Docker Container       │
│  FastAPI │ Extractor │ MCP Client   │
│          │ (pymupdf) │ (SSE)        │
│  ────────┴───────────┴──────────    │
│  SQLite (State: Hash → UUIDs)       │
└─────────────────────────────────────┘
                   │
              MCP Protocol
                   │
                   ▼
         Graphiti MCP Server

贡献

欢迎投稿!拜托:

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'feat: add amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

请遵循 约定式提交 用于提交消息。

许可证

麻省理工学院