# Feeding Your Local Data to LLMs (II)

> Source: <https://blog.devgenius.io/feeding-your-local-data-to-llms-ii-c6f7e965acbf?source=rss----4e2c1156667e---4>
> Published: 2026-09-08 12:51:48+00:00

Member-only story

# Feeding Your Local Data to LLMs (II)

## Using Graph Database combined with full-text search

In [the previous article](https://medium.com/dev-genius/feeding-your-local-data-to-llms-ec410b3aa95a), I presented a simple way for feeding local data into LLM queries. In this article, it is extended in two ways.

- The embedding will be stored in a graph database
- Similarity search will be combined with full-text search

I will use Neo4j graph database. For this article, a community version is deployed on Kubernetes. The detailed deployment steps are available in [Deploying Neo4j Graph Database in Kubernetes](https://medium.com/dev-genius/deploying-neo4j-graph-database-in-kubernetes-a367e10bfe0f) article.

The overall procedure is shown in the diagram below.

## Code Walk-through

In this section, we will go through a running example code. We use a local LLM and a Neo4j graph database as a knowledge database.

We install the following Python packages for the example code.

- langchain_community
- tiktoken
- neo4j
- openai
- sentence-transformers
- ipywidgets
- pdfplumber

We set all the environment specific variables in the `.env` file and load it using the `load_dotenv` function.
