HNSW & Token Tuning
Sizing Neo4j JVM Heap & Page Cache for Mem0g & Zep Graphiti
Balance Neo4j heap, off-heap page cache, and transaction memory when running bi-temporal entity graphs alongside Qdrant.
55% Heap / 45% PageCache · -Xms == -Xmx · Bolt Pool <= 64
Separating Heap Execution From Graph Storage Cache
Neo4j stores nodes and relationships off-heap in the page cache while using JVM heap only for active Cypher query execution and transaction state. Over-allocating heap starves page cache and triggers disk thrashing.
Indexing Entity Name + user_id Constraints
Ensure composite indexes exist on (Entity.user_id, Entity.name) so Mem0g and Zep Graphiti MERGE queries avoid full label scans as entity counts cross 500,000.
Measured Thresholds & Vector Stack Parameters
| Fact + Entity Scale | Neo4j Heap (-Xmx) | Neo4j Page Cache |
|---|---|---|
| 100k - 500k Facts | 1 GB | 1 GB |
| 1M - 3M Facts | 2 GB | 2 GB |
| 5M - 10M Facts | 4 GB - 6 GB | 4 GB - 6 GB |