You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
I have created a knowledge graph in Neo4j using the neo4j framework with the following setup:
kg_builder = SimpleKGPipeline(
llm=llm,
driver=driver,
text_splitter=FixedSizeSplitter(chunk_size=500, chunk_overlap=100),
embedder=embedder,
entities=node_labels,
relations=rel_types,
prompt_template=prompt_template,
from_pdf=False # Make sure this is set to False
)
The graph is correctly built, and I can successfully query it using Neo4j directly. However, I am now trying to query this graph using the LlamaIndex framework and encountering an issue where the response is empty.
Here’s my code:
from llama_index.graph_stores.neo4j import Neo4jPropertyGraphStore
from llama_index.indices.property_graph import PropertyGraphIndex
from llama_index import OpenAIEmbedding
from llama_index.query_engine import QueryEngine
Problem:
When I run this query, I get an empty response.
However, when I query the Neo4j graph directly using the neo4j driver, I get the expected results.
Troubleshooting so far:
Verified that the graph data is correctly populated in Neo4j.
Checked the connection details (username, password, URI) — all correct.
Tried with and without include_text=True, but still no results.
Questions:
Is there something I am missing while querying the Neo4j graph using LlamaIndex?
Do I need to re-index the graph or perform any additional steps before querying?
Could there be an issue with how the property graph is being indexed?
Any guidance would be much appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I have created a knowledge graph in Neo4j using the neo4j framework with the following setup:
kg_builder = SimpleKGPipeline(
llm=llm,
driver=driver,
text_splitter=FixedSizeSplitter(chunk_size=500, chunk_overlap=100),
embedder=embedder,
entities=node_labels,
relations=rel_types,
prompt_template=prompt_template,
from_pdf=False # Make sure this is set to False
)
The graph is correctly built, and I can successfully query it using Neo4j directly. However, I am now trying to query this graph using the LlamaIndex framework and encountering an issue where the response is empty.
Here’s my code:
from llama_index.graph_stores.neo4j import Neo4jPropertyGraphStore
from llama_index.indices.property_graph import PropertyGraphIndex
from llama_index import OpenAIEmbedding
from llama_index.query_engine import QueryEngine
graph_store = Neo4jPropertyGraphStore(
username=NEO4J_USERNAME,
password=NEO4J_PASSWORD,
url=NEO4J_URI,
database="neo4j",
)
index = PropertyGraphIndex.from_existing(
property_graph_store=graph_store,
llm=OpenAI(model="gpt-4", temperature=0.3),
embed_model=OpenAIEmbedding(),
)
query_engine = index.as_query_engine(include_text=True)
response = await query_engine.aquery("question")
print(response)
Problem:
When I run this query, I get an empty response.
However, when I query the Neo4j graph directly using the neo4j driver, I get the expected results.
Troubleshooting so far:
Verified that the graph data is correctly populated in Neo4j.
Checked the connection details (username, password, URI) — all correct.
Tried with and without include_text=True, but still no results.
Questions:
Is there something I am missing while querying the Neo4j graph using LlamaIndex?
Do I need to re-index the graph or perform any additional steps before querying?
Could there be an issue with how the property graph is being indexed?
Any guidance would be much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions