haive.agents.memory.models¶

Memory system Pydantic models for structured extraction and storage.

Inspired by langmem’s memory management approach but built on haive.core store/persistence for async Postgres support.

Classes¶

ConversationSummary

Summary of a conversation for long-term storage.

KnowledgeTriple

A subject-predicate-object knowledge graph triple.

MemoryExtraction

Structured extraction from a conversation - what to remember.

MemoryItem

A single memory stored in the system.

MemorySearchResult

Result from memory search.

MemoryType

Classification of memory types (inspired by cognitive science + langmem).

Module Contents¶

class haive.agents.memory.models.ConversationSummary(/, **data)¶

Bases: pydantic.BaseModel

Summary of a conversation for long-term storage.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.memory.models.KnowledgeTriple(/, **data)¶

Bases: pydantic.BaseModel

A subject-predicate-object knowledge graph triple.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.memory.models.MemoryExtraction(/, **data)¶

Bases: pydantic.BaseModel

Structured extraction from a conversation - what to remember.

The memory extractor agent outputs this to decide what gets stored. Similar to langmem’s MemoryStoreManager extraction but using our SimpleAgent with structured output.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.memory.models.MemoryItem(/, **data)¶

Bases: pydantic.BaseModel

A single memory stored in the system.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.memory.models.MemorySearchResult(/, **data)¶

Bases: pydantic.BaseModel

Result from memory search.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.memory.models.MemoryType¶

Bases: str, enum.Enum

Classification of memory types (inspired by cognitive science + langmem).

Initialize self. See help(type(self)) for accurate signature.