Skip to main content
Hyper-Extract Logo

Smart Knowledge Extraction CLI

Transform documents into structured knowledge with one command.

📖 English Version · 中文版

Trendshift

PyPI Version Python Version License Docs GitHub Stars


"Stop reading. Start understanding."
"告别文档焦虑,让信息一目了然"


Hero & Workflow

📰 What's New

v0.8.0

  • 🔄 Document Upsert — re-feed an attributed document and its previous version is rolled back automatically: removed facts disappear, shared keys re-merge from surviving sources. (#84)
  • 📁 Per-File Source Attribution — he parse ./docs/ attributes each file by its name automatically; roll back or audit any single file later. An explicit --source still overrides.
  • ⏱️ Spatiotemporal Provenance — temporal/spatial/spatio-temporal graphs fully support source attribution and rollback, with deterministic (MERGE_FIELD) replay tests.
v0.5.0 – v0.7.0 — provenance, deletion, incremental index, template validator, GraphML/CSV export
  • 🗑️ Two-Tier Knowledge Deletion — hard-delete by key (he remove --node/--edge, orphan edges pruned) or remove a single wrong fact via LLM-assisted editing (he remove --edit-node --fact), with dry-run, key-invariance checks, and automatic backups. (#84)
  • 📜 Source Attribution & Provenance — he feed --source / he parse --source record each document's raw contributions; he remove --document rolls back exactly what one document contributed; he info --sources shows the ledger. (#84)
  • 📈 Incremental Everything — feed/parse/removal/edit patch the vector index in place (only affected vectors re-embedded); he feed skips documents whose content hash is unchanged (--refeed to force). (#84)
  • 🧪 he template validate — catch semantic template errors before paying for LLM calls: 9 diagnostic rules, --json for CI, --all for directories. (#77)
  • 📊 GraphML & CSV Export — desktop graph tools and spreadsheets; hypergraphs get a hyperedges table. (#85)
  • 🌐 OrcaRouter Provider — one key for 150+ models via create_client("orcarouter"). (#71)
  • 🔐 Config File Permissions — ~/.he/config.toml saved 0600. (#86)
  • 🔗 Obsidian wikilink fix — aliases no longer break on [ ] | # ^. (#87)
  • 🛡️ Chunk-Level Fault Isolation — one failed chunk no longer discards the rest of a multi-chunk extraction. (#78)
  • ⚡ MCP Python SDK 2.x — he-mcp works on mcp 1.x and 2.x. (#72, #82)
  • 🔀 Directed-Edge Fix — (source, target) order preserved; custom endpoint field names. (#74)
  • 🔑 DeepSeek API Key Fix — DEEPSEEK_API_KEY honored on the OpenAI-compatible path. (#76)
  • 🎓 Education Templates — course_concept_graph + curriculum_structure. (#80)
  • 🧭 Smaller Fixes — Graph_RAG.search 3-tuple; he talk -i --top-k; onboarding/docs overhaul. (#70, #73, #57)

Archived

See the full changelog in the GitHub releases.

Hyper-Extract is an intelligent, LLM-powered knowledge extraction and evolution framework. It radically simplifies transforming highly unstructured texts into persistent, predictable, and strongly-typed Knowledge Abstracts. It effortlessly extracts information into a wide spectrum of formats—ranging from simple Collections (Lists/Sets) and Pydantic Models, to complex Knowledge Graphs, Hypergraphs, and even Spatio-Temporal Graphs.

✨ Core Features

🔷 8 Knowledge Structures From simple Lists to advanced Graphs, Hypergraphs, and Spatio-Temporal Graphs
🧠 10+ Extraction Engines GraphRAG, LightRAG, Hyper-RAG, KG-Gen, and more — ready to use
📝 80+ YAML Templates Zero-code extraction across Finance, Legal, Medical, TCM, Industry, and General domains
🔄 Incremental Evolution & Provenance Feed new documents anytime — every source is attributed and the index updates incrementally; audit (he info --sources), roll back (he remove --document), or upsert updated versions as your sources change
📤 Obsidian Export Turn any extracted graph into an Obsidian vault — Markdown notes linked by [[wikilinks]]

🎯 What Can You Do With It?

📄 Researcher — Turn papers into knowledge graphs

Feed a 20-page academic paper, get an interactive graph of key concepts, authors, and citations.

he parse paper.pdf -t general/academic_graph -o ./paper_kb/
he show ./paper_kb/
🏦 Financial Analyst — Extract entities from earnings reports

Automatically identify companies, executives, financial metrics, and their relationships from unstructured reports.

he parse earnings.md -t finance/earnings_graph -o ./finance_kb/
he search ./finance_kb/ "What are the key risk factors?"
🔒 Local Deployment — Keep data on-premise with vLLM

Run Qwen3.5-9B + bge-m3 locally via vLLM. No data leaves your machine.

from hyperextract import create_client
llm, emb = create_client(
    llm="vllm:Qwen3.5-9B@http://localhost:8000/v1",
    embedder="vllm:bge-m3@http://localhost:8001/v1",
    api_key="dummy",
)

🚀 Supported Platforms & Models

Hyper-Extract uses LangChain structured output with function calling. The model must support tool/function calling.

Platform Verified Models
OpenAI gpt-4o, gpt-4o-mini, gpt-5
Anthropic claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5
DeepSeek deepseek-v4-flash, deepseek-v4-pro
阿里云百炼 qwen-plus, qwen-turbo, deepseek-r1
Local vLLM Qwen3.5-9B (GPTQ-Marlin)

Embedding models (semantic search) work with any OpenAI-compatible endpoint: text-embedding-3-small, text-embedding-v4 (Bailian), bge-m3 (local vLLM).

DeepSeek note: DeepSeek V4 models default to "thinking" mode, which Hyper-Extract auto-disables so structured extraction works. Set DEEPSEEK_API_KEY. DeepSeek has no embeddings API — pair it with an OpenAI-compatible embedder:

from hyperextract import create_client
llm, emb = create_client(llm="deepseek", embedder="openai:text-embedding-3-small")

Anthropic note: Claude is used for the LLM (set ANTHROPIC_API_KEY). Anthropic has no embeddings API, so pair it with an OpenAI-compatible embedder:

from hyperextract import create_client
llm, emb = create_client(llm="anthropic", embedder="openai:text-embedding-3-small")

Requires the extra: pip install 'hyperextract[anthropic]'.

📖 Full guide: Provider System & Local Model Support

⚡ 30-Second Quick Start

1. Install:

# Install uv first (if you haven't)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install Hyper-Extract CLI
uv tool install hyperextract
# or: pipx install hyperextract

2. Configure your provider (pick one):

OpenAI:

he config init -p openai -k YOUR_OPENAI_API_KEY

Anthropic (Claude):

he config llm -p anthropic -k YOUR_ANTHROPIC_API_KEY
he config embedder -p openai -k YOUR_OPENAI_API_KEY

DeepSeek:

he config llm -p deepseek -k YOUR_DEEPSEEK_API_KEY
he config embedder -p openai -k YOUR_OPENAI_API_KEY

Bailian (Alibaba Cloud):

he config init -p bailian -k YOUR_BAILIAN_API_KEY

Local vLLM:

he config llm -p vllm -u http://localhost:8000/v1 -k dummy -m Qwen/Qwen3.5-9B
he config embedder -p vllm -u http://localhost:8001/v1 -k dummy -m BAAI/bge-m3

3. Extract, query & visualize:

# Extract knowledge from a document
he parse examples/en/tesla.md -t general/biography_graph -o ./output/ -l en

# Query it
he search ./output/ "What are Tesla's major achievements?"

# Visualize
he show ./output/

# Export to an Obsidian vault (Markdown notes + [[wikilinks]])
he export obsidian ./output/ -o ./vault/

Which provider should I use? OpenAI and Bailian provide both LLM and embedding models in one API. Anthropic and DeepSeek are LLM-only (pair them with an OpenAI embedder for search/chat). Local vLLM is free but requires a GPU. DeepSeek is the most cost-effective option (~$0.001-0.005/page vs ~$0.01-0.05/page for OpenAI gpt-4o-mini).

🐍 Python API (click to expand)
uv pip install hyperextract
from hyperextract import Template

ka = Template.create("general/biography_graph")

with open("examples/en/tesla.md") as f:
    result = ka.parse(f.read())

result.show()

🔗 More examples: examples/en

📈 Why Hyper-Extract?

Feature GraphRAG LightRAG KG-Gen ATOM Hyper-Extract
Knowledge Graph ✅ ✅ ✅ ✅ ✅
Temporal Graph ✅ ❌ ❌ ✅ ✅
Spatial Graph ❌ ❌ ❌ ❌ ✅
Hypergraph ❌ ❌ ❌ ❌ ✅
Domain Templates ❌ ❌ ❌ ❌ ✅
Interactive CLI ✅ ❌ ❌ ❌ ✅
Multi-language ✅ ❌ ❌ ❌ ✅

🧩 Supported Knowledge Structures

From simple to complex — pick the right structure for your data:

Knowledge Structures Matrix

Example — AutoGraph visualization:

AutoGraph Visualization
📋 What's under the hood? (Architecture & Templates)

Hyper-Extract follows a three-layer architecture:

  • Auto-Types — 8 strongly-typed data structures (Model, List, Set, Graph, Hypergraph, Temporal Graph, Spatial Graph, Spatio-Temporal Graph)
  • Methods — Extraction algorithms: KG-Gen, GraphRAG, LightRAG, Hyper-RAG, Cog-RAG, and more
  • Templates — 80+ presets across 6 domains. Zero-code setup.
Architecture

Template example (Graph type):

language: en
name: Knowledge Graph
type: graph
tags: [general]
description: 'Extract entities and their relationships.'
output:
  entities:
    fields:
    - name: name
      type: str
    - name: type
      type: str
    - name: description
      type: str
  relations:
    fields:
    - name: source
      type: str
    - name: target
      type: str
    - name: type
      type: str
identifiers:
  entity_id: name
  relation_id: '{source}|{type}|{target}'

📚 Documentation & Resources

Resource Link
Full Documentation yifanfeng97.github.io/Hyper-Extract
CLI Guide Command-line interface
Provider System Model compatibility & local deployment
Template Gallery 80+ presets
Examples Working code

🔌 MCP Server

Expose your knowledge abstracts to MCP-capable assistants (Claude Desktop, IDE agents) via the Model Context Protocol — read + export only.

pip install 'hyperextract[mcp]'
he-mcp        # stdio MCP server

Tools: list_templates, info, search, ask (RAG), export_obsidian. Full guide: MCP Server docs.

🤝 Contributing & License

Contributions are welcome! Please submit Issues and PRs.
Licensed under Apache-2.0.

🔒 Security

This project has been security assessed by MseeP.ai.

AtomGit Mirror

AtomGit mirror - a synchronized AtomGit mirror of Agent Reach for easier access and cloning in China. Hosted on AtomGit: https://atomgit.com/yifanfeng97/Hyper-Extract

Release files for hyperextract 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hyperextract 0.8.1
File Size Uploaded
hyperextract-0.8.1.tar.gz 201.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hyperextract 0.8.1
File Interpreter ABI Platform
hyperextract-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 466.1 kB

Release files / hyperextract-0.8.1.tar.gz

Download URL hyperextract-0.8.1.tar.gz
Size 201.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cccd70c0ae7bab5f1ca98738b4ce77da4971fdaeafd756d9b2faaecc69635a5b
BLAKE2b-256 checksum
How to use checksums
41fcd44d5562af1c848bc6b11f11986d541f3e05fba3b32189d4dc77a0644294
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / hyperextract-0.8.1-py3-none-any.whl

Download URL hyperextract-0.8.1-py3-none-any.whl
Size 265.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee06ed508876ec776b1c2ff9ff891ce6c265b374b3ec21025ea99049f168a4c4
BLAKE2b-256 checksum
How to use checksums
3166737b8863938a4d0c9052f9b41ec0aa79f635098995598ad58f4203e5bb95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.4

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page