Skip to main content

Graphreader

Graphreader is a Python library that allows you to read and write data from a Neo4j database. It is built on top of the Langgraph/LangChain library, which provides a framework for building language models. It is based on Medium article Implementing GraphReader with Neo4j and LangGraph

Getting started

  1. Install the library using pip:

    pip install graphreader_agentic_rag
    
  2. Configure environment variables (.env):

    • OPENAI_API_KEY='your-openai-api-key'
    • OPENAI_MODEL_NAME='gpt-4o-mini'
    • NEO4J_URI="neo4j+s://xxxxxxxx.databases.neo4j.io"
    • NEO4J_USERNAME=neo4j
    • NEO4J_PASSWORD='your-neo4j-password'
    • ITERATION_LIMIT=12

Iteration limit is used to control the number of iterations that the agent will perform. This avoids infinite loops. If not specified, the default value is 10 iterations. Langgraph use 25 iterations. If the value higher than 25, it will cause an error.

  1. Import data:

To import data, you can use the import.ipynb Jupyter notebook available in the examples folder of the repository. There, three methods for data import are provided:

  • Text: Import text.
  • A single file: Import a specific file.
  • All files in a folder: Import all available files in a folder.

Currently, only files in the txt format are supported. This allows you to reprocess your original files using the tool of your choice.

  1. Run the agent:

To run the agent, use the agent.ipynb Jupyter notebook available in the examples folder of the repository.

Roadmap

  • [] Memgraph integration
  • [] Customizable prompting for agents

Add your files

Roadmap

If you have ideas for releases in the future, it is a good idea to list them in the README.

from graphreader.chains.neo4j_utils import result_sources

Metadata

Release files for graphreader_agentic_rag 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphreader_agentic_rag 0.1.1
File Size Uploaded
graphreader_agentic_rag-0.1.1.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphreader_agentic_rag 0.1.1
File Interpreter ABI Platform
graphreader_agentic_rag-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.8 kB

Release files / graphreader_agentic_rag-0.1.1.tar.gz

Download URL graphreader_agentic_rag-0.1.1.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
702df4d31e1d3df6f3211ae5768449a69192f333809a258ffe305a6572a2c176
BLAKE2b-256 checksum
How to use checksums
57e79594a65f4fbc32b7c648f2cfa6b217b2dbca9db40d6456e95d910086fb44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.8.0-48-generic

Release files / graphreader_agentic_rag-0.1.1-py3-none-any.whl

Download URL graphreader_agentic_rag-0.1.1-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af0472a6bfb0b021fd3cbea877ae694db4d9076bde323330e9a22ba716da5c35
BLAKE2b-256 checksum
How to use checksums
cfaaa0d7d7f06fb418a5a1b4acb8e569e2bbe405058c76f5eaa279b53a8a3af1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.8.0-48-generic

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page