Skip to content

pkgs/store/graph

pkgs/store/graph defines entity/relation graph abstraction and provides KVGraph implementation built on pkgs/store/kv. It is used for Agent memory and recall capabilities that require adjacency and relation traversal.

Go API References

Core structure and main function

SymbolFunction
EntityStores graph entity identity, type and metadata.
RelationExpress source, target, relation type and metadata.
GraphDefine entity/relation write, read, delete and adjacency queries.
KVGraphUse namespaced KV keys to save graph data and indexes.
NewKVGraphCreate graph with KV Store, prefix and optional separator.

Ownership Boundary

Graph package does not define Agent memory ontology, nor does it determine the business meaning of relation. Entity type, relation type, metadata schema, and traversal strategies belong to the calling domain. KVGraph relies on the caller to provide KV lifecycle and does not open, migrate or close the physical database.