Skip to content

memory_graph

Memory Graph Metadata ORM Model

This module defines the MemoryGraph class, which represents a hierarchy of agent memories.

Attributes

Classes

MemoryGraph

Bases: Base

Associative table for AI agent memory graph

Attributes

__table_args__ class-attribute instance-attribute
__table_args__ = {'comment': __doc__}
__tablename__ class-attribute instance-attribute
__tablename__ = 'memory_graph'
child class-attribute instance-attribute
child: Mapped[Memory] = relationship(
    foreign_keys=[child_pkid],
    back_populates="parent_associations",
)
child_pkid class-attribute instance-attribute
child_pkid: Mapped[str] = mapped_column(
    ForeignKey("memory.pkid", ondelete="CASCADE"),
    primary_key=True,
    comment="Child memory ID reference",
)
create_ts class-attribute instance-attribute
create_ts: Mapped[datetime] = mapped_column(
    server_default=now(), doc="Record create timestamp"
)
parent class-attribute instance-attribute
parent: Mapped[Memory] = relationship(
    foreign_keys=[parent_pkid],
    back_populates="child_associations",
)
parent_pkid class-attribute instance-attribute
parent_pkid: Mapped[str] = mapped_column(
    ForeignKey("memory.pkid", ondelete="CASCADE"),
    primary_key=True,
    comment="Parent memory ID reference",
)
update_ts class-attribute instance-attribute
update_ts: Mapped[datetime] = mapped_column(
    server_default=now(),
    onupdate=current_timestamp(),
    doc="Record update timestamp",
)