Skip to content

Schema

Pydantic models for the gllm-memory library.

This module contains all Pydantic models used throughout the library, providing data validation and serialization.

Authors

Budi Kurniawan (budi.kurniawan1@gdplabs.id)

GetMemoryParams

Bases: BaseModel

Get memory parameters for memory retrieval operations.

This model represents the parameters used for retrieving memories, including version, pagination options, and filter conditions.

Attributes:

Name Type Description
page int | None

Page number for pagination.

page_size int | None

Number of items per page.

filters dict[str, Any]

Filter conditions for the search.

version str

API version to use.

Mem0Message

Bases: BaseModel

Pydantic model for Mem0 message format.

This model ensures type safety and validation for Mem0 API message format. It represents the structure expected by the Mem0 API for message data.

Attributes:

Name Type Description
role Literal['user', 'assistant', 'system']

The role of the message sender.

content str

The content of the message.

SearchParams

Bases: BaseModel

Search parameters for memory retrieval operations.

This model represents the parameters used for searching memories, including query, version, filters, and pagination options.

Attributes:

Name Type Description
query str

Search query string.

version str

API version to use.

top_k int | None

Maximum number of results to return.

threshold float | None

Minimum similarity threshold for results.

filters dict[str, Any]

Filter conditions for the search.