This project helps you make sense of unstructured text by extracting structured knowledge using OpenAI’s LLM and storing it as a graph in Neo4j.
-
Create a
.envfile
Copy.env.copyto.envand fill in your OpenAI and Neo4j credentials.cp env.copy .env -
Install dependencies
npm install -
Start Neo4j
- If using Docker:
docker run --name neo4j -p7474:7474 -p7687:7687 -d -e NEO4J_AUTH=neo4j/yourPwd neo4j:latest - Or start your local Neo4j instance.
- If using Docker:
-
Configure your prompt and input text
Editindex.jsto update the prompt or input text as needed. -
Run the script
node index -
View your graph
- Go to http://localhost:7474/ and log in.
- To visualize all nodes and relationships, run:
MATCH (n) OPTIONAL MATCH (n)-[r]->(m) RETURN n, r, m
Feel free to adjust the prompt or data structure in index.js to fit your needs! Also play with different db commands to explore your graph!