We will process a list of documents and use LLM to extract relationships between the concepts in each document. We will generate two kinds of relationships:
- Relationships between subjects and objects. E.g., "CocoIndex supports Incremental Processing"
- Mentions of entities in a document. E.g., "core/basics.mdx" mentions
CocoIndex
andIncremental Processing
.
You can find a step by step blog for this project here
Please drop Cocoindex on Github a star to support us if you like our work. Thank you so much with a warm coconut hug 🥥🤗.
- Install Postgres if you don't have one.
- Install Neo4j if you don't have one.
- Configure your OpenAI API key.
You can read the official CocoIndex Documentation for Property Graph Targets here.
Install dependencies:
pip install -e .
Setup:
python main.py cocoindex setup
Update index:
python main.py cocoindex update
After the knowledge graph is build, you can explore the knowledge graph you built in Neo4j Browser.
For the dev enviroment, you can connect neo4j browser using credentials:
- username:
neo4j
- password:
cocoindex
which is pre-configured in the our docker compose config.yaml.
You can open it at http://localhost:7474, and run the following Cypher query to get all relationships:
MATCH p=()-->() RETURN p

I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight:
python main.py cocoindex server -ci
And then open the url https://cocoindex.io/cocoinsight.
