Lexical Graph
Automate the construction of a hierarchical lexical graph from unstructured documents, then query it with semantic-guided or traversal-based retrieval.
Lexical Graph
Automate the construction of a hierarchical lexical graph from unstructured documents, then query it with semantic-guided or traversal-based retrieval.
BYOKG-RAG
Bring your own knowledge graph. Plug an existing graph into a multi-strategy KGQA pipeline without re-extracting anything.
Pluggable storage
Graph stores: Amazon Neptune (DB and Analytics), Neo4j, FalkorDB. Vector stores: Neptune, OpenSearch, Postgres, S3 Vectors.
Open source
Apache 2.0, developed in the open by AWS Labs.
pip install graphrag-lexical-graphfrom graphrag_toolkit.lexical_graph import LexicalGraphIndexfrom graphrag_toolkit.lexical_graph.storage import GraphStoreFactory, VectorStoreFactoryfrom llama_index.readers.web import SimpleWebPageReader
with ( GraphStoreFactory.for_graph_store( 'neptune-db://my-graph.cluster-abcdefghijkl.us-east-1.neptune.amazonaws.com' ) as graph_store, VectorStoreFactory.for_vector_store( 'aoss://https://abcdefghijkl.us-east-1.aoss.amazonaws.com' ) as vector_store,): graph_index = LexicalGraphIndex(graph_store, vector_store)
docs = SimpleWebPageReader(html_to_text=True).load_data([ 'https://docs.aws.amazon.com/neptune/latest/userguide/intro.html', ])
graph_index.extract_and_build(docs, show_progress=True)