Skip to content

feat: add document-graph — structured data ETL for graph-enhanced GenAI#355

Open
evanerwee wants to merge 2 commits into
awslabs:mainfrom
evanerwee:feature/document-graph
Open

feat: add document-graph — structured data ETL for graph-enhanced GenAI#355
evanerwee wants to merge 2 commits into
awslabs:mainfrom
evanerwee:feature/document-graph

Conversation

@evanerwee

Copy link
Copy Markdown
Contributor

Summary

This PR adds document-graph as a sibling package to lexical-graph, providing structured data ETL (CSV, Excel, JSON, Parquet, XML) that complements the existing unstructured text processing.

What it does

Lexical Graph Document Graph
Input Unstructured text (PDF, web) Structured data (CSV, Excel, JSON)
Extraction LLM-based (Claude) Deterministic ETL (pandas)
Graph Model Source → Chunk → Topic → Entity Row → Typed Node + Edges
Query Traversal-based semantic search Cypher over typed nodes

Both coexist in the same Neptune database with tenant-scoped label isolation.

Key Features

  • Schema providers (CSV, JSON, S3, Static, Glue) with auto-discovery
  • 20+ transformers (normalizers, field, document, filter, graph, truncators)
  • Cypher generation with tenant-scoped labels
  • Query engine for typed node retrieval
  • Multi-tenancy (complete data isolation)
  • Hybrid integration: index structured data into lexical-graph for semantic search

Testing

  • 59 tests passing
  • 100% docstring coverage
  • Tested on Neptune 1.4.7.0 + OpenSearch Serverless via SageMaker notebooks

Context

I previously collaborated with the team on this integration (before team changes). The intent was always to contribute document-graph as a companion to lexical-graph. Happy to discuss any architectural concerns or adjustments needed to align with the project's direction.

Checklist

  • Tests pass locally
  • Follows existing package structure (sibling to lexical-graph, byokg-rag)
  • Apache-2.0 license
  • No modifications to existing packages

Document-graph extends graphrag-toolkit with typed node support for structured
formats (CSV, Excel, JSON, Parquet, XML). It complements lexical-graph by handling
deterministic ETL while lexical-graph handles LLM-based extraction.

Key features:
- Schema providers (CSV, JSON, S3, Static, Glue) with auto-discovery
- 20+ transformers (normalizers, field, document, filter, graph, truncators)
- Cypher generation with tenant-scoped labels
- Query engine for typed node retrieval
- Multi-tenancy (same Neptune cluster, isolated by labels)
- Hybrid integration: index structured data into lexical-graph for semantic search

Coexists with lexical-graph in the same Neptune database:
- lexical-graph: unstructured text → Source/Chunk/Topic/Entity
- document-graph: structured data → typed nodes (__User__, __Account__, etc.)

59 tests passing. 100% docstring coverage. Sphinx docs included.
- 11 documentation pages (getting-started, lexical-graph-integration, pipeline,
  ingestors, schema-providers, transformers, graph-build, query-engine,
  multi-tenancy, examples index, API reference)
- 19 tested SageMaker notebooks covering all features
- Includes hybrid integration demos (document-graph + lexical-graph)
@acarbonetto

Copy link
Copy Markdown
Collaborator

@evanerwee

This looks very interesting! Thank you for contributing. Could I ask you to post an Issue with what we're aiming to achieve with the document-graph and we can link the issue for discussion.

@evanerwee

Copy link
Copy Markdown
Contributor Author

I will certainly do the write-up for you. When Ian was still around, we discussed the need, but Ian left. I will redo the description.

@acarbonetto

Copy link
Copy Markdown
Collaborator

I will certainly do the write-up for you. When Ian was still around, we discussed the need, but Ian left. I will redo the description.

related issue: #356

Thank you so much!

@mykola-pereyma

Copy link
Copy Markdown
Collaborator

@evanerwee is this PR obsolete since there is a fresh one #365 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants