GraphAide
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:
- QUICKSTART.md — 5-minute setup and CLI examples
- ARCHITECTURE.md — Technical deep dive (agents, workflows, patterns)
- REFERENCE.md — Complete API/CLI reference
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 LMStudioGraphDBFactory— Manages Neo4j/Neptune connectionsVectorStoreFactory— Manages ChromaDB or Qdrant vector indicesAgentFactory— Builds extraction, loading, and query agents
Agents communicate via KGGenerationState (append-only shared state with reducers):
raw_text,file_path— Input documentnodes,edges— Extracted entities and relationshipsrag_context— Ontology constraints and Wikidata metadatamessages— 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 serve → http://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
Release files for graphaide 0.4.39
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| graphaide-0.4.39.tar.gz | 416.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| graphaide-0.4.39-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 856.1 kB
Release files / graphaide-0.4.39.tar.gz
| Download URL | graphaide-0.4.39.tar.gz |
|---|---|
| Size | 416.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6aaec004a08fb56e8cedf4f0f3bc2af401ff0c4eed1cb006c9dad473b4ecda83
|
|
BLAKE2b-256 checksum How to use checksums |
65bfd4a0382e3a5410f1c18d1bfae4d87150887d5b41eea4f3f94387f269d8a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / graphaide-0.4.39-py3-none-any.whl
| Download URL | graphaide-0.4.39-py3-none-any.whl |
|---|---|
| Size | 440.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98395a043bf7facadab72342cdfb65e7188814149ca4b6e6482e1cd5eee13a38
|
|
BLAKE2b-256 checksum How to use checksums |
2aefef3db23a8297107c9ffc8b6b4de2ccee9ac908f32a961cb72512bf45c162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|