Store schema
Classes:
Name | Description |
---|---|
DistanceMetric |
Supported distance metrics for vector similarity. |
MemoryRecord |
Comprehensive memory record for storage (Pydantic model). |
MemorySearchResult |
Result from a memory search operation (Pydantic model). |
MemoryType |
Types of memories that can be stored. |
RetrievalStrategy |
Memory retrieval strategies. |
Classes¶
DistanceMetric
¶
Bases: Enum
Supported distance metrics for vector similarity.
Attributes:
Name | Type | Description |
---|---|---|
COSINE |
|
|
DOT_PRODUCT |
|
|
EUCLIDEAN |
|
|
MANHATTAN |
|
Source code in pyagenity/store/store_schema.py
21 22 23 24 25 26 27 |
|
MemoryRecord
¶
Bases: BaseModel
Comprehensive memory record for storage (Pydantic model).
Methods:
Name | Description |
---|---|
from_message |
|
validate_vector |
|
Attributes:
Name | Type | Description |
---|---|---|
category |
str
|
|
content |
str
|
|
id |
str
|
|
memory_type |
MemoryType
|
|
metadata |
dict[str, Any]
|
|
thread_id |
str | None
|
|
timestamp |
datetime | None
|
|
user_id |
str | None
|
|
vector |
list[float] | None
|
|
Source code in pyagenity/store/store_schema.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
Attributes¶
Functions¶
from_message
classmethod
¶
from_message(message, user_id=None, thread_id=None, vector=None, additional_metadata=None)
Source code in pyagenity/store/store_schema.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
validate_vector
classmethod
¶
validate_vector(v)
Source code in pyagenity/store/store_schema.py
78 79 80 81 82 83 84 85 |
|
MemorySearchResult
¶
Bases: BaseModel
Result from a memory search operation (Pydantic model).
Methods:
Name | Description |
---|---|
validate_vector |
|
Attributes:
Name | Type | Description |
---|---|---|
content |
str
|
|
id |
str
|
|
memory_type |
MemoryType
|
|
metadata |
dict[str, Any]
|
|
score |
float
|
|
thread_id |
str | None
|
|
timestamp |
datetime | None
|
|
user_id |
str | None
|
|
vector |
list[float] | None
|
|
Source code in pyagenity/store/store_schema.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
Attributes¶
content
class-attribute
instance-attribute
¶
content = Field(default='', description='Primary textual content of the memory')
score
class-attribute
instance-attribute
¶
score = Field(default=0.0, ge=0.0, description='Similarity / relevance score')
Functions¶
validate_vector
classmethod
¶
validate_vector(v)
Source code in pyagenity/store/store_schema.py
55 56 57 58 59 60 61 62 |
|
MemoryType
¶
Bases: Enum
Types of memories that can be stored.
Attributes:
Name | Type | Description |
---|---|---|
CUSTOM |
|
|
DECLARATIVE |
|
|
ENTITY |
|
|
EPISODIC |
|
|
PROCEDURAL |
|
|
RELATIONSHIP |
|
|
SEMANTIC |
|
Source code in pyagenity/store/store_schema.py
30 31 32 33 34 35 36 37 38 39 |
|
Attributes¶
RetrievalStrategy
¶
Bases: Enum
Memory retrieval strategies.
Attributes:
Name | Type | Description |
---|---|---|
GRAPH_TRAVERSAL |
|
|
HYBRID |
|
|
RELEVANCE |
|
|
SIMILARITY |
|
|
TEMPORAL |
|
Source code in pyagenity/store/store_schema.py
11 12 13 14 15 16 17 18 |
|