This program will generate cypher queries and call them on a database that has been populated with dummy data. The cypher queries are generated using Mistral Large as its large language model.
- To install all project dependencies (listed in requirements.txt) run
pip install -r requirements.txt
. - Obtain a Mistral API key from here
You will need to use Neo4j Desktop, this can be downloaded here
Once installed follow the steps below:
- Create new project to host your DBMS.
- Create a new database within the project.
- Add the username and password to the
.env
file. - Add the database uri to the
.env
file. The default value for this isbolt://localhost:7687
- Run the database in Neo4j desktop.
In order for the application to be run, it must be loaded with the dummy data in dummy_data.txt
.
Follow these steps:
- Open the database in Neo4j desktop with Neo4j Browser.
- Copy the contents of
dummy_data.txt
and paste into Neo4j Browser. - Confirm that nodes are created by running
MATCH (n) RETURN n
.
The graph that is populated should look like:
To run the program, confirm that all set up tasks are completed and then run
python generate_cypher.py
.
An example question has been added: What did I spend more on Sainsburys or Tesco?
.
This should return something similar to: John, you spent more at Tesco, with a total of £1750. In contrast, your total spending at Sainsburys was £45.
Please try out different questions to query the database in different ways. There are more example questions below.
- What is the capital of France?
- What transactions were made today?
- How many transactions were made in January 2024?
- Who did I spend the most money with?
- Calculate the total amount Jane Smith spent in each transaction category.
- What was the latest transaction I made to Sainsburys?
- Find all persons who made transactions with Aldi?
- How much have I spent on rent?