Skip to main content

GraphAide

GraphAide Logo

Build knowledge graphs from any document with LLMs and Neo4j. GraphAide is a multi-agentic system that extracts entities and relationships from diverse sources, constructs knowledge graphs, and enables natural language reasoning over them—all with minimal setup.

30-Second Example

from graphaide import GraphAide, ModelConfig, GraphDBConfig, get_sample_data_path

# Setup (once)
graphaide = GraphAide(
    model_config=ModelConfig(provider="openai", model_name="gpt-4o"),
    graphdb_config=GraphDBConfig(uri="neo4j://localhost:7687", username="neo4j", password="password"),
)

# Extract from sample document
sample_pdf = get_sample_data_path("PNNL_About.pdf")
sample_ontology = get_sample_data_path("ontology_cyber.nt")
result = graphaide.extract(file_path=sample_pdf, ontology_path=sample_ontology)
print(f"✓ Extracted {len(result.nodes)} entities, {len(result.edges)} relationships")

# Load to Neo4j
graphaide.ingest(file_path=sample_pdf, ontology_path=sample_ontology)

# Query the graph
answer = graphaide.query("What organizations are mentioned?")
print(f"✓ Answer: {answer.answer}")

What It Does

  • Extract entities & relationships from PDFs, text, images, or web data
  • Ground entities to Wikidata for semantic enrichment
  • Load to Neo4j for queryable knowledge graphs
  • Reason over graphs with natural language questions
  • Track chunk provenance for result attribution

Supported Providers

LLM Embedding Vector Store
OpenAI, Anthropic, Google, AWS Bedrock, LMStudio OpenAI, Sentence Transformers, AWS Bedrock ChromaDB, Qdrant

Documentation

📚 Quick links:

Install

pip install graphaide

See QUICKSTART.md for detailed setup, Docker, and environment configuration.

Use Cases

  • Knowledge Graph Generation — Extract structured data from documents into queryable graphs
  • Semantic Search — Find related entities and concepts across datasets
  • Domain-Specific Reasoning — Answer questions requiring cross-document reasoning
  • Data Integration — Merge disparate sources with automated entity grounding
  • Compliance & Audit — Track relationships and dependencies with provenance

Architecture

GraphAide uses a multi-agent architecture orchestrated by LangGraph:

Document → [FileLoader] → [Extractor] → [Nodes4EdgesLoader] 
         → [NodesLoader] → [EdgesLoader] → Neo4j
         ↓
      [VectorDB] ← [Embeddings] ← RAG Context

Factory pattern manages LLMs, vector stores, and graph databases:

  • ModelFactory — Loads LLMs from OpenAI, Anthropic, Google, AWS Bedrock, or local LMStudio
  • GraphDBFactory — Manages Neo4j/Neptune connections
  • VectorStoreFactory — Manages ChromaDB or Qdrant vector indices
  • AgentFactory — Builds extraction, loading, and query agents

Agents communicate via KGGenerationState (append-only shared state with reducers):

  • raw_text, file_path — Input document
  • nodes, edges — Extracted entities and relationships
  • rag_context — Ontology constraints and Wikidata metadata
  • messages — Status and debug info

Tested Configurations

Provider LLM Embedding
OpenAI gpt-4o, gpt-4o-mini text-embedding-3-small
Anthropic claude-3-5-sonnet claude-3-5-sonnet (native)
AWS Bedrock anthropic.claude-3-5-sonnet amazon.titan-embed-text-v1
LMStudio (local) google/gemma-3-27b:2 text-embedding-nomic-embed-text-v1.5

Run Modes

Mode Command
CLI graphaide extract doc.pdf
Docker docker compose up then docker exec
Python from graphaide import GraphAide
REST graphaide servehttp://localhost:8000

Support

Please reach out to Sumit.Purohit@pnnl.gov for any questions.

Authors and acknowledgment

Please reach out to Sumit.Purohit@pnnl.gov for any questions.

Citation

If you use GraphAide in your research, please cite:

@inproceedings{purohit2024graphaide,
  title={GraphAide: Advanced Graph-Assisted Query and Reasoning System},
  author={Purohit, Sumit and Chin, George and Mackey, Patrick S and Cottam, Joseph A},
  booktitle={2024 IEEE International Conference on Big Data (BigData)},
  pages={3485--3493},
  year={2024},
  organization={IEEE}
}

The research described in this paper is partially supported by the Resilience Through Data Driven, Intelligently Designed Control (RD2C) Initiative at Pacific Northwest National Laboratory (PNNL) and the United States federal government. Pacific Northwest National Laboratory is a multiprogram national laboratory operated for the US Department of Energy (DOE) by Battelle Memorial Institute under Contract No. DEAC05-76RL01830. PNNL Information Release PNNL-SA205147.

License

Please refer LICENSE and DISCLAIMER files for details.

Project status

Active development

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphaide-0.4.21.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphaide-0.4.21-py3-none-any.whl (152.9 kB view details)

Uploaded Python 3

File details

Details for the file graphaide-0.4.21.tar.gz.

File metadata

  • Download URL: graphaide-0.4.21.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for graphaide-0.4.21.tar.gz
Algorithm Hash digest
SHA256 fdf89605ea0669a96fd706d794dcee49dbbd7c0f745f51cf42cc674fadd00275
MD5 e3f1f26499aad3f97359c9d7df6a6874
BLAKE2b-256 2b717aa3f0f59f36e71b3a721dedb85e0d204cf4a2b76dd9af09cf3913baf9e5

See more details on using hashes here.

File details

Details for the file graphaide-0.4.21-py3-none-any.whl.

File metadata

  • Download URL: graphaide-0.4.21-py3-none-any.whl
  • Upload date:
  • Size: 152.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for graphaide-0.4.21-py3-none-any.whl
Algorithm Hash digest
SHA256 7dfd232e5b96337a1361d412b913f1e62180d5dabb4260f4709620739a8e939c
MD5 050882b1a8359e5279613c2755067e3c
BLAKE2b-256 c04f33ef64d42c82a5a45304e2b832b2b3772b8d1a834e0077697248b40c3b12

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.26

2 files

0.4.25

2 files

0.4.24

2 files

0.4.23

2 files

0.4.22

2 files

This release

0.4.21 This release

2 files

0.4.20

2 files

0.4.19

2 files

0.4.18

2 files

0.4.17

2 files

0.4.16

2 files

0.4.15

2 files

0.4.14

2 files

0.4.13

2 files

0.4.12

1 file

0.4.11

1 file

0.4.10

1 file

0.4.9

1 file

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page