Skip to content

refactor: replace Zep Cloud memory with local JSON file storage#634

Open
PMA-Titan wants to merge 1 commit into
666ghj:mainfrom
PMA-Titan:main
Open

refactor: replace Zep Cloud memory with local JSON file storage#634
PMA-Titan wants to merge 1 commit into
666ghj:mainfrom
PMA-Titan:main

Conversation

@PMA-Titan
Copy link
Copy Markdown

Summary

  • Removes the zep-cloud dependency entirely (no external API key or network calls needed)
  • Adds backend/app/utils/local_graph_store.py: thread-safe JSON store that persists nodes, edges, and episodes under uploads/graphs/{graph_id}/
  • Rewrites graph_builder.py to use LLM-based entity/relationship extraction, storing results locally instead of sending to Zep Cloud
  • Rewrites zep_graph_memory_updater.py to write agent activities as episodes + searchable fact edges in local JSON
  • Rewrites zep_entity_reader.py and zep_tools.py to read/search local JSON (keyword matching replaces Zep semantic search)
  • Updates oasis_profile_generator.py and ontology_generator.py to remove all Zep SDK references
  • Removes ZEP_API_KEY from config.py, requirements.txt, pyproject.toml, and .env

Test plan

  • Start backend without a ZEP_API_KEY — server should start cleanly
  • Upload a document and build a graph — nodes and edges appear in uploads/graphs/{graph_id}/
  • Run a simulation — agent activities are written to episodes.jsonl and edges.json
  • Generate a report — insight_forge and panorama_search return results via keyword search

🤖 Generated with Claude Code

Removes the zep-cloud dependency entirely and replaces it with a
local file-based graph store (LocalGraphStore) that persists nodes,
edges, and episodes as JSON files under uploads/graphs/{graph_id}/.

- Add backend/app/utils/local_graph_store.py: thread-safe JSON store
  with keyword search, node upsert, and episode append
- Rewrite graph_builder.py: LLM-based entity/relationship extraction
  from text batches, stored locally instead of sent to Zep Cloud
- Rewrite zep_graph_memory_updater.py: agent activities written as
  episodes + searchable fact edges in local JSON
- Rewrite zep_entity_reader.py: reads nodes/edges from local JSON
- Rewrite zep_tools.py: keyword search on local JSON replaces
  Zep semantic search; _local_search is now the primary path
- Update oasis_profile_generator.py: local store replaces Zep client
  for entity context enrichment
- Update ontology_generator.py: generated code template uses
  pydantic BaseModel instead of Zep EntityModel/EdgeModel
- Convert zep_paging.py to a no-op stub (pagination not needed)
- Remove ZEP_API_KEY from config.py, add GRAPH_STORAGE_DIR
- Remove ZEP_API_KEY guards from api/graph.py and api/simulation.py
- Remove zep-cloud==3.13.0 from requirements.txt and pyproject.toml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant