MicroFish/backend/app/services
Abhishek Yadav 28827067c0 feat: migrate knowledge graph from Zep Cloud to Graphiti + local Neo4j
Replaces the paid, rate-limited Zep Cloud service with Graphiti (graphiti-core
0.11.6) backed by a local Neo4j instance — free, unlimited, and self-hosted.

Key changes:
- Add GraphitiAdapter: drop-in Zep-compatible wrapper around Graphiti with a
  persistent event-loop thread to avoid asyncio/Neo4j driver conflicts
- Switch LLM client to native GeminiClient + GeminiEmbedder (text-embedding-004
  fails on Gemini compat endpoint; use google-genai SDK directly)
- Add _GeminiReranker passthrough replacing OpenAIRerankerClient (which
  hardcodes gpt-4.1-nano and uses logprobs unsupported by Gemini)
- Fix Cypher queries: use s.uuid/t.uuid for edge source/target instead of
  r.source_node_uuid (null property in Graphiti's schema)
- Add ontology-based entity type classifier (_classify_entity_type) so nodes
  get colored by type in the D3 graph visualization instead of all being Entity
- Apply classifier in ZepEntityReader so filter_defined_entities finds entities
  (previously 0 personas loaded because all labels were ['Entity'])
- Add startup recovery: auto-mark graph_building projects as graph_completed
  on backend restart if Neo4j already has their data
- Add resume capability to graph build: skip already-processed episodes after
  a restart (断点续传)
- Add non-blocking graph data cache with background refresh in graph.py
- Add EMBEDDING_MODEL config (default: gemini-embedding-001 for Gemini users)
- Add CLAUDE.md with project architecture and dev commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 01:30:28 +05:30
..
__init__.py Implement Interview feature for agent interactions in simulations 2025-12-08 15:55:39 +08:00
graph_builder.py feat: migrate knowledge graph from Zep Cloud to Graphiti + local Neo4j 2026-03-22 01:30:28 +05:30
graphiti_adapter.py feat: migrate knowledge graph from Zep Cloud to Graphiti + local Neo4j 2026-03-22 01:30:28 +05:30
oasis_profile_generator.py feat: migrate knowledge graph from Zep Cloud to Graphiti + local Neo4j 2026-03-22 01:30:28 +05:30
ontology_generator.py Enhance backend startup logging and API endpoint display 2025-11-28 18:59:36 +08:00
report_agent.py fix(report_agent): refine tool call handling and response validation; enforce strict separation between tool calls and final answers 2026-02-24 17:47:44 +08:00
simulation_config_generator.py Enhance simulation configuration and management features 2025-12-05 15:50:54 +08:00
simulation_ipc.py Implement Interview feature for agent interactions in simulations 2025-12-08 15:55:39 +08:00
simulation_manager.py feat(history): 添加首页历史项目展示组件 2025-12-31 17:54:39 +08:00
simulation_runner.py Refactor process termination in SimulationRunner to support cross-platform handling and improve code clarity. Update development script to ensure concurrent processes are terminated correctly. 2025-12-30 17:45:27 +08:00
text_processor.py Introduce Project ID for context management, finalizing the stateful API pipeline from file submission to graph construction. 2025-11-28 17:21:08 +08:00
zep_entity_reader.py feat: migrate knowledge graph from Zep Cloud to Graphiti + local Neo4j 2026-03-22 01:30:28 +05:30
zep_graph_memory_updater.py feat: migrate knowledge graph from Zep Cloud to Graphiti + local Neo4j 2026-03-22 01:30:28 +05:30
zep_tools.py feat: migrate knowledge graph from Zep Cloud to Graphiti + local Neo4j 2026-03-22 01:30:28 +05:30