Neo4j GraphRAG utilises a knowledge graph and can be added as a capability to agents.
Note: If you have been usingautogen
orag2
, all you need to do is upgrade it using:orasautogen
, andag2
are aliases for the same PyPI package.
OPENAI_API_KEY
.
You can utilise an OAI_CONFIG_LIST file and extract the OpenAI API key
and put it in the environment, as will be shown in the following cell.
Alternatively, you can load the environment variable yourself.
Important
- Default Models: - Question Answering: OpenAI’s
GPT-4o
withtemperature=0.0
. - Embedding: OpenAI’stext-embedding-3-small
.- Customization: You can change these defaults by setting the following parameters on the
Neo4jGraphQueryEngine
:
llm
: Specify a LLM instance with a llm you like.embedding
: Specify a BaseEmbedding instance with a embedding model.- Reference
pip install docx2txt
We start by creating a Neo4j property graph (knowledge graph) with a
sample employee handbook of a fictional company called BUZZ
strict=True
to tell the engine to only extracting allowed
relationships from the data for each entity