How internscience/graphanything works
GraphAnything turns heterogeneous artifacts into provenance-rich knowledge graphs through a schema-led extraction and human-review workflow, then supports querying, versioning, federation, quality reporting, and nine render formats. CLI and MCP tools are documented drivers of the shared Session core. The sampled source confirms extractor dispatch, LLM extraction, session review, and rendering; other subsystem connections follow README descriptions and are shown only at that level.
Main entry points: session.py Session workflow · cli.py CLI / REPL · __init__.py Extractor registry · serve.py MCP server
Components 22
User interfaces
- CLI / REPL
cli.py - MCP server
serve.py
Graph construction
- Session workflow
session.py - Schema proposal
_proposer.py - Schema presets
schemas - Extractor registry
extractors/__init__.py - Rule extractors
extractors/tier1.py - Chat-log extractor
extractors/chatlog.py - LLM entity extractor
extractors/llm_entity.py - LLM client
llm_client.py - Sample review
preview.py - Merge normalization
normalize.py - Provenance
provenance.py
Graph operations
- Graph and sessions
store.py - Snapshots and diff
temporal.py - Federation
federate.py - Quality evaluation
quality.py
Query and output
- Graph query
ask.py - Provenance explain
provenance.py - Graph rendering
viz/__init__.py
Other components
- User
- OpenAI-compatible endpoint
Connections 22
- User → CLI / REPL: commands
- User → MCP server: tools
- CLI / REPL → Session workflow: drives
- MCP server → Session workflow: drives
- Session workflow → Schema proposal: proposes schema
- Session workflow → Schema presets: uses presets
- Session workflow → Extractor registry: dispatches extraction
- Extractor registry → Rule extractors: dispatches
- Extractor registry → Chat-log extractor: dispatches
- Extractor registry → LLM entity extractor: dispatches
- LLM entity extractor → LLM client: requests completion
- LLM client → OpenAI-compatible endpoint: HTTP requests
- Session workflow → Sample review: returns sample
- Session workflow → Merge normalization: applies review rules
- Extractor registry → Provenance: stamps outputs
- Session workflow → Graph and sessions: persists graph
- Session workflow → Snapshots and diff: versions graph
- CLI / REPL → Graph query: queries graph
- CLI / REPL → Provenance explain: explains provenance
- CLI / REPL → Federation: combines graphs
- CLI / REPL → Quality evaluation: evaluates graph
- CLI / REPL → Graph rendering: renders graph