A Streamlit-based chatbot that integrates Zep for long-term conversational memory and visualizes the underlying knowledge graph using st_link_analysis.
This project demonstrates:
- Persistent chat memory using Zep
- Context-aware responses from stored conversation history
- Exporting Zep graph data into JSON
- Interactive graph visualization inside a Streamlit app
- 💬 Chatbot with long-term memory (Zep)
- 🧠 Context retrieval for improved LLM responses
- 🕸️ Zep graph (nodes & edges) export
- 📊 Graph visualization using
st_link_analysis - 🖥️ Single Streamlit application
.
├── streamlit_app.py # Main Streamlit app (chat + graph visualization)
├── zep_graph.py # Optional graph export/debug utility
├── zep_memory_bot.py # Optional CLI-based chatbot
├── requirements.txt
├── docker-compose.yml # Optional (remove secrets before committing)
├── data/ # Optional local data (not required)
├── zep_thread_id.txt # Runtime file (do not commit)
└── .env # Secrets file (do not commit)
- Python 3.10 or higher
- Zep account (Zep Cloud API key or Zep OSS)
- OpenAI API key (or compatible LLM provider)
git clone <your-github-repo-url>
cd <repo-folder>python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
OPENAI_API_KEY=your_openai_api_key
ZEP_API_KEY=your_zep_api_key
OPENAI_MODEL=gpt-4o-mini
ZEP_USER_ID=vk_user.env or API keys to GitHub.
streamlit run streamlit_app.pyOnce running:
- Start chatting with the bot
- Memory is stored and retrieved from Zep
- Use the UI control to refresh and visualize the Zep knowledge graph
The Zep graph is converted into the format required by st_link_analysis:
{
"nodes": [
{ "data": { "id": "node_1", "label": "User" } }
],
"edges": [
{
"data": {
"id": "edge_1",
"source": "node_1",
"target": "node_2",
"label": "related_to"
}
}
]
}- Do not commit
.env - Do not commit
zep_thread_id.txt - Remove API keys from
docker-compose.ymlbefore pushing - Use environment variables for all secrets
Add a license (MIT recommended) if you plan to make this repository public or reusable.