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.5.0.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.5.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_graphdb_cypher-0.5.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_graphdb_cypher-0.5.0.tar.gz
Algorithm Hash digest
SHA256 330b5d4483a53031f078d06960941c1ff6101eb90dffe0ff56b10f9d76d952c2
MD5 44a8b1da8996571b2e5aa43b2a67a8c3
BLAKE2b-256 7c7afc71fad550f8011d5e4bc50a7eb65132d76533e76fd7d8662bae4751a3dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_readers_graphdb_cypher-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_graphdb_cypher-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1c8bc3d27ac62748fe8f272ded7a33f74157b9fb35bb1cec57b3b85c2f936a2
MD5 066805c90971292675cbc4d05cd2888a
BLAKE2b-256 2cdb7210543b10c33e7dc15f76fec3531194b33f473c847560c7ca8d536183da

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