Skip to main content

llama-index readers graphdb_cypher integration

Project description

Graph Database Cypher Loader

pip install llama-index-readers-graphdb-cypher

This loader populates documents from results of Cypher queries from a Graph database endpoint. The user specifies a GraphDB endpoint URL with optional credentials to initialize the reader. By declaring the Cypher query and optional parameters the loader can fetch the nested result docs. The results will be turned into a yaml representation to be turned into a string for the document.

The approach should work for Neo4j, AWS Neptune and Memgraph.

Usage

Here's an example usage of the GraphDBCypherReader.

You can test out queries directly with the Neo4j labs demo server: demo.neo4jlabs.com or with a free instance https://neo4j.com/aura

import os

from llama_index.readers.graphdb_cypher import GraphDBCypherReader

uri = "neo4j+s://demo.neo4jlabs.com"
username = "stackoverflow"
password = "stackoverflow"
database = "stackoverflow"

query = """
    MATCH (q:Question)-[:TAGGED]->(:Tag {name:$tag})
    RETURN q.title as title
    ORDER BY q.createdAt DESC LIMIT 10
"""
reader = GraphDBCypherReader(uri, username, password, database)
documents = reader.load_data(query, parameters={"tag": "lua"})

This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.

It uses the Neo4j Graph Database for the Cypher queries.

Project details


Download files

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

Source Distribution

llama_index_readers_graphdb_cypher-0.4.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file llama_index_readers_graphdb_cypher-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_graphdb_cypher-0.4.1.tar.gz
Algorithm Hash digest
SHA256 60481864b33127edb7d2badeffc3d9fabec58f458b9773f7c08aa91cb8d67806
MD5 bc962c8b9ff96763f8bac8c9b21c5390
BLAKE2b-256 883a884c5331a0d6b8bf0aa8e64e4108abb3bec8226499de9c078d9b957a04ea

See more details on using hashes here.

File details

Details for the file llama_index_readers_graphdb_cypher-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_graphdb_cypher-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4da2b309305349f428c98cdd8827028ade44b8060466d79315bc49cebc54bf3
MD5 c11004ff7d0cc3b1154046c7d37a53a5
BLAKE2b-256 5682f9391453e30db7cfa3b82825f1e8724093148bb5bd8fbc1f336e98033bc5

See more details on using hashes here.

Supported by

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