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> |
||
|---|---|---|
| .. | ||
| api | ||
| models | ||
| services | ||
| utils | ||
| __init__.py | ||
| config.py | ||