DEV Community

gentic news
gentic news

Posted on • Originally published at gentic.news

Zep AI's Graphiti: Agent Memory Without Schema Is Just Storage

Zep AI's Graphiti enforces Pydantic schemas on LLM entity extraction, preventing generic label collapse and enabling precise querying of agent memory.

Zep AI's Graphiti, an open-source temporal knowledge graph library, tackles agent memory by constraining LLM extraction with Pydantic schemas. The result is a queryable domain model instead of a generic vector store.

Key facts

  • Graphiti uses Pydantic-based ontology definitions.
  • 10 entity types, 10 edge types, 10 fields per type constraint.
  • Temporal resolution invalidates outdated edges automatically.
  • Open-source library from Zep AI.

The default agent memory pipeline hands an LLM raw text and asks it to extract entities and relationships. The model decides the types, the labels, the attributes, all on its own. The result is a knowledge graph that behaves like an expensive vector store, where entity types collapse into generic labels and relationships flatten into a single "RELATES_TO." [According to @akshay_pachaar] The graph has the data, but no query can reach it with precision.

The problem is not retrieval. It is structure. And the fix is the same pattern that already works everywhere else in the AI stack: constrain the output space before generation, not after.

Graphiti introduces three structural primitives:

Entities define what the agent is allowed to remember. Pydantic models with typed fields and descriptive docstrings replace the LLM's guesswork with domain vocabulary it was never trained on.

Edges define how things connect. Source/target constraints on relationship types mean the graph can only form valid connections. If your schema has no edge connecting Project to Competitor, that relationship cannot exist in memory.

Temporal resolution handles what was true versus what is true. Fact resolution invalidates outdated edges while preserving history, so the graph never silently serves stale state.

The schema guides extraction at two points in the pipeline (entity extraction and fact extraction) while resolution and temporal processing run automatically downstream. You define what to look for. The system handles deduplication, contradiction detection, and time-windowing without additional configuration.

A useful constraint: 10 entity types, 10 edge types, 10 fields per type. That forces you to model the 80% that matters rather than attempting completeness. Start with 3-4 of each and expand only when retrieval fails.

Graphiti is fully open-source and available on GitHub. [According to the post] If you are building agent memory with any kind of domain specificity, it is worth looking at before rolling your own.

What to watch

Watch for adoption metrics from Zep AI's GitHub repository—stars, forks, and issue volume will indicate whether the developer community validates this schema-first approach over the prevailing retrieval-optimized memory systems.


Originally published on gentic.news

Top comments (0)