Building AI Knowledge Graph Using Graphiti & Neo4j

Table of contents
- 1. Why Graphiti for AI Agent Memory?
- 2. Quick Refresher: Knowledge‑Graph Basics
- 3. Setup
- 4. Initialise Graphiti (clean slate)
- 5. Insert Episodes into Your AI Knowledge Graph
- 6. Visual Exploration of AI Graph Memory
- 7. CSV Export at a Glance
- 8. Query Your AI Agent Memory (Hybrid Search)
- 9. Practical Uses of an AI Graph Memory
- 10. What’s Next?
Graphiti is a compact yet powerful Python library that converts raw text or JSON into an AI Knowledge Graph—a structured store of facts that acts as AI Agent Memory. Below is the exact workflow I used to load FutureSmart AI data into Neo4j, explore the resulting AI Graph Memory, and run hybrid (semantic + keyword) searches.
1. Why Graphiti for AI Agent Memory?
Real‑time inserts – Add new facts without bulk re‑processing.
LLM‑powered parsing – Entity extraction, relationship mapping, summaries, and embeddings handled automatically.
Neo4j under the hood – First‑class graph database with Cypher, indexes, and visualization tools.
Perfect for AI Agent Memory – Your agent can recall structured facts on demand.
2. Quick Refresher: Knowledge‑Graph Basics
“Pradip Nichite founded FutureSmart AI.”
Component | Example |
Entity | Pradip Nichite |
Entity | FutureSmart AI |
Edge | founded |
Triple | (Pradip Nichite, founded, FutureSmart AI) |
Graphiti stores each triple as Neo4j nodes (Entity) and edges (RELATES_TO), plus an Episode node that records the original text—together forming your AI Graph Memory.
3. Setup
pip install graphiti-core # build your AI Knowledge Graph in minutes
import os
from google.colab import userdata
os.environ["OPENAI_API_KEY"] = userdata.get("OPENAI_API_KEY")
neo4j_uri = "neo4j+s://<your‑instance>.databases.neo4j.io"
neo4j_user = "neo4j"
neo4j_password = userdata.get("NEO4J_PASSWORD")
4. Initialise Graphiti (clean slate)
from graphiti_core import Graphiti
from graphiti_core.utils.maintenance.graph_data_operations import clear_data
graphiti = Graphiti(neo4j_uri, neo4j_user, neo4j_password)
await clear_data(graphiti.driver) # optional for a fresh start
await graphiti.build_indices_and_constraints() # creates indexes once
5. Insert Episodes into Your AI Knowledge Graph
episodes = [
{
"name": "About Me",
"content": "Hi, I'm Pradip Nichite. I am the founder and CEO of FutureSmart AI.",
"type": EpisodeType.text,
"description": "intro"
},
{
"name": "About FutureSmart AI",
"content": "FutureSmart AI builds custom AI solutions for clients.",
"type": EpisodeType.text,
"description": "company overview"
}
]
await add_data(episodes) # helper loops and calls graphiti.add_episode()
Under‑the‑Hood Workflow
Entity extraction (people, orgs, products)
Relationship extraction (
founded
,associated_with
, …)Deduplication of entities
Summary + embedding generation
Graph write → Neo4j (your AI Graph Memory)
All steps run via LLM calls you can inspect in your OpenAI usage logs.
6. Visual Exploration of AI Graph Memory
Blue = Episode nodes (source text)
Brown = Entity nodes (deduplicated concepts)
Edges labelled MENTIONS & RELATES_TO connect everything
Run MATCH (n) RETURN n
in Neo4j Browser to explore your AI Knowledge Graph. Click any node to view its summary
and vector embedding
.
7. CSV Export at a Glance
Metric | Count |
Nodes total | 9 |
• Entity | 5 |
• Episode | 4 |
Relationships total | 13 |
• MENTIONS | 8 |
• RELATES_TO | 5 |
Sample from node‑export.csv
:
name | label | summary |
Pradip Nichite | Entity | Pradip Nichite is the founder and CEO of FutureSmart AI. |
FutureSmart AI | Entity | FutureSmart AI is a company that develops AI solutions for clients and is known for creating AI demos. |
About Me | Episodic | |
AI Demos | Entity | AI Demos is associated with FutureSmart AI and was founded by Pradip Nichite. |
FutureSmart Agent | Entity | FutureSmart Agent is a product developed by FutureSmart AI. |
About FutureSmart AI | Episodic | |
About AI Demos | Episodic | |
FutureSmart Agent | Episodic | |
https://agent.futuresmart.ai/ | Entity | FutureSmart AI is the company behind the product FutureSmart Agent. Their website is https://agent.futuresmart.ai/. |
8. Query Your AI Agent Memory (Hybrid Search)
query = "What products FutureSmart has"
results = await graphiti.search(query=query, num_results=3)
print_result(results)
Search Results:
UUID: dae5cb4d-adb2-401f-991f-aa5259127245
Fact: FutureSmart Agent is a product of FutureSmart AI
Valid from: 2025-08-01 07:54:17+00:00
---
UUID: afc8af04-0af2-4fd8-940a-91cf93da6943
Fact: https://agent.futuresmart.ai/ is the website of FutureSmart Agent
Valid from: 2025-08-01 07:54:17+00:00
---
UUID: c6d353e8-6fb1-4263-a0e9-4df21ea5805f
Fact: FutureSmart AI is the company behind AI Demos
Valid from: 2025-08-01 07:54:08+00:00
Graphiti blends embedding similarity with BM25 keywords to surface relevant facts for downstream agents.
9. Practical Uses of an AI Graph Memory
AI Agent Memory for chatbots and assistants
Enterprise AI Knowledge Graph for internal search
Neo4j Bloom dashboards for leadership teams
Light‑weight RAG pipelines powered by graph facts
10. What’s Next?
Integrate Graphiti memory into LangGraph / LangChain agents
Combine vector store retrieval with graph queries
Package everything in FastAPI + Streamlit for a live demo
Prefer video over text?
Watch the full walkthrough here
Need a Custom AI Agent or Graph Solution?
FutureSmart AI helps companies turn raw data into production-ready AI Knowledge Graphs and AI Agent Memory systems.
End-to-end Graphiti + Neo4j pipelines
LangChain / LangGraph agent integrations
Scalable FastAPI & Streamlit front-ends
Secure, cloud-native deployment
Want proof we deliver? 👉 See our real-world results: https://futuresmart.ai/case-studies
Book a free consult: contact@futuresmart.ai
Questions?
Drop a comment on YouTube or email contact@futuresmart.ai.
Subscribe to my newsletter
Read articles from Pradip Nichite directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Pradip Nichite
Pradip Nichite
🚀 I'm a Top Rated Plus NLP freelancer on Upwork with over $300K in earnings and a 100% Job Success rate. This journey began in 2022 after years of enriching experience in the field of Data Science. 📚 Starting my career in 2013 as a Software Developer focusing on backend and API development, I soon pursued my interest in Data Science by earning my M.Tech in IT from IIIT Bangalore, specializing in Data Science (2016 - 2018). 💼 Upon graduation, I carved out a path in the industry as a Data Scientist at MiQ (2018 - 2020) and later ascended to the role of Lead Data Scientist at Oracle (2020 - 2022). 🌐 Inspired by my freelancing success, I founded FutureSmart AI in September 2022. We provide custom AI solutions for clients using the latest models and techniques in NLP. 🎥 In addition, I run AI Demos, a platform aimed at educating people about the latest AI tools through engaging video demonstrations. 🧰 My technical toolbox encompasses: 🔧 Languages: Python, JavaScript, SQL. 🧪 ML Libraries: PyTorch, Transformers, LangChain. 🔍 Specialties: Semantic Search, Sentence Transformers, Vector Databases. 🖥️ Web Frameworks: FastAPI, Streamlit, Anvil. ☁️ Other: AWS, AWS RDS, MySQL. 🚀 In the fast-evolving landscape of AI, FutureSmart AI and I stand at the forefront, delivering cutting-edge, custom NLP solutions to clients across various industries.