When using knowledge graphs for AI agent memory, letting the LLM freely decide entity types and relationship labels produces generic, unqueryable graphs where everything becomes a 'Topic' with 'RELATES_TO' edges. Zep's Graphiti library solves this by letting developers define a typed ontology using Pydantic models — custom entity types (e.g., Project, Technology) and edge types (e.g., WORKS_ON, USES_TECHNOLOGY) with structured attributes and source/target constraints. The extraction pipeline then classifies against these definitions rather than guessing. This enables multi-hop reasoning that flat vector retrieval can't support, typed filtering by attributes, and bi-temporal tracking of facts. Zep enforces a 10/10/10 limit (10 entity types, 10 edge types, 10 fields each) to keep schemas focused. Context templates then assemble typed, temporally annotated facts into prompt-ready blocks for agents.

8m read timeFrom blog.dailydoseofds.com
Post cover image
Table of contents
An open-source alternative to Claude (29k+ stars)!Agent memory is only as good as its schema

Sort: