Skip to content

Commit 8c17800

Browse files
committed
Attempt fix
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
1 parent 2529351 commit 8c17800

11 files changed

Lines changed: 86 additions & 13 deletions

File tree

.github/workflows/installation-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
shell: bash
7474
run: |
7575
set -eo pipefail
76+
python -m pip install "$(ls *common*.whl)"
7677
whl_name=$(ls *server*.whl)
7778
python -m pip install --find-links . "$whl_name"
7879
@@ -105,6 +106,7 @@ jobs:
105106
run: |
106107
set -eo pipefail
107108
export PYTHONUTF8=1
109+
python -m pip install "$(ls *common*.whl)"
108110
whl_name=$(ls *server*.whl)
109111
python -m pip install --find-links . "$whl_name"
110112
@@ -124,6 +126,7 @@ jobs:
124126
shell: bash
125127
run: |
126128
set -eo pipefail
129+
python -m pip install "$(ls *common*.whl)"
127130
whl_name=$(ls *server*.whl)
128131
python -m pip install --find-links . "$whl_name"
129132

.github/workflows/test-python-client-package.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ jobs:
5959
shell: bash
6060
run: |
6161
set -eo pipefail
62+
# Install common first to ensure the freshly built version is used
63+
common_whl=$(python -c "import pathlib; d=sorted(pathlib.Path('dist').glob('memmachine_common-*.whl')); print(d[0] if d else '')")
64+
if [ -z "$common_whl" ]; then
65+
echo "No common wheel found" >&2
66+
exit 1
67+
fi
68+
python -m pip install "$common_whl"
69+
6270
whl_name=$(python -c "import pathlib; d=sorted(pathlib.Path('dist').glob('memmachine_client-*.whl')); print(d[0] if d else '')")
6371
if [ -z "$whl_name" ]; then
6472
echo "No client wheel found" >&2

.github/workflows/test-server-package.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ jobs:
5252
shell: bash
5353
run: |
5454
set -eo pipefail
55+
# Install common first to ensure the freshly built version is used
56+
common_whl=$(ls dist/memmachine_common-*.whl | head -1)
57+
pip install "$common_whl"
58+
5559
whl_name=$(ls dist/memmachine_server-*.whl | head -1)
5660
pip install --find-links dist/ "$whl_name"
5761
@@ -85,9 +89,10 @@ jobs:
8589
print('MemoryType enum values correct')
8690
8791
# Test ALL_MEMORY_TYPES
88-
assert len(ALL_MEMORY_TYPES) == 2
92+
assert len(ALL_MEMORY_TYPES) == 3
8993
assert MemoryType.Semantic in ALL_MEMORY_TYPES
9094
assert MemoryType.Episodic in ALL_MEMORY_TYPES
95+
assert MemoryType.Event in ALL_MEMORY_TYPES
9196
print('ALL_MEMORY_TYPES correct')
9297
"
9398

packages/common/common_tests/test_event_memory_data_types.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Tests for common event memory data types, formatting, and unification."""
22

3-
from datetime import UTC, datetime, timedelta, timezone
3+
from datetime import datetime, timedelta, timezone
44
from uuid import uuid4
55

66
import pytest
@@ -32,7 +32,7 @@ def _make_segment(
3232
event_uuid=event_uuid or uuid4(),
3333
index=index,
3434
offset=offset,
35-
timestamp=timestamp or datetime(2026, 1, 15, 10, 30, tzinfo=UTC),
35+
timestamp=timestamp or datetime(2026, 1, 15, 10, 30, tzinfo=timezone.utc),
3636
context=context,
3737
block=EventMemoryText(text=text),
3838
properties=properties or {},
@@ -42,7 +42,7 @@ def _make_segment(
4242
class TestSegmentRoundTrip:
4343
def test_serialize_deserialize(self):
4444
seg = _make_segment(
45-
properties={"count": 42, "ts": datetime(2026, 1, 1, tzinfo=UTC)},
45+
properties={"count": 42, "ts": datetime(2026, 1, 1, tzinfo=timezone.utc)},
4646
)
4747
seg2 = EventMemorySegment.model_validate(seg.model_dump(mode="json"))
4848
assert seg.uuid == seg2.uuid
@@ -90,7 +90,7 @@ def test_continuation_same_event_and_index(self):
9090
def test_timezone_formatting(self):
9191
tz = timezone(timedelta(hours=9))
9292
seg = _make_segment(
93-
timestamp=datetime(2026, 1, 15, 10, 30, tzinfo=UTC),
93+
timestamp=datetime(2026, 1, 15, 10, 30, tzinfo=timezone.utc),
9494
text="test",
9595
)
9696
opts = EventMemoryFormatOptions(timezone=tz, show_timezone_label=True)
@@ -133,7 +133,7 @@ def _make_scored_context(self, num_segments=3, score=0.5):
133133
event_uuid=event_uuid,
134134
index=0,
135135
offset=0,
136-
timestamp=datetime(2026, 1, 15, 10, 30, tzinfo=UTC),
136+
timestamp=datetime(2026, 1, 15, 10, 30, tzinfo=timezone.utc),
137137
block=EventMemoryText(text="seed"),
138138
properties={},
139139
)
@@ -181,10 +181,10 @@ def test_deduplication(self):
181181

182182
def test_chronological_order(self):
183183
seg1 = _make_segment(
184-
timestamp=datetime(2026, 1, 15, 10, 0, tzinfo=UTC), text="first"
184+
timestamp=datetime(2026, 1, 15, 10, 0, tzinfo=timezone.utc), text="first"
185185
)
186186
seg2 = _make_segment(
187-
timestamp=datetime(2026, 1, 15, 11, 0, tzinfo=UTC), text="second"
187+
timestamp=datetime(2026, 1, 15, 11, 0, tzinfo=timezone.utc), text="second"
188188
)
189189
ctx = EventMemoryScoredSegmentContext(
190190
seed_segment_uuid=seg2.uuid,
@@ -226,11 +226,11 @@ class TestPropertiesRoundTrip:
226226
{"name": "test"},
227227
{"ratio": 3.14},
228228
{"flag": True},
229-
{"ts": datetime(2026, 1, 15, tzinfo=UTC)},
229+
{"ts": datetime(2026, 1, 15, tzinfo=timezone.utc)},
230230
{
231231
"count": 42,
232232
"name": "test",
233-
"ts": datetime(2026, 1, 15, tzinfo=UTC),
233+
"ts": datetime(2026, 1, 15, tzinfo=timezone.utc),
234234
},
235235
],
236236
)

packages/common/src/memmachine_common/api/event_memory/properties.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"""
1616

1717
from collections.abc import Mapping
18-
from datetime import UTC, datetime, timedelta, timezone
18+
from datetime import datetime, timedelta, timezone
1919
from typing import Final
2020

2121
PropertyValue = bool | int | float | str | datetime
@@ -46,7 +46,7 @@
4646
def _ensure_tz_aware(dt: datetime) -> datetime:
4747
"""Return an aware datetime; treat naive datetimes as UTC."""
4848
if dt.tzinfo is None:
49-
return dt.replace(tzinfo=UTC)
49+
return dt.replace(tzinfo=timezone.utc)
5050
return dt
5151

5252

@@ -70,7 +70,7 @@ def encode_properties(
7070
if isinstance(value, datetime):
7171
aware_value = _ensure_tz_aware(value)
7272
encoded[key] = {
73-
PROPERTY_VALUE_KEY: aware_value.astimezone(UTC).isoformat(),
73+
PROPERTY_VALUE_KEY: aware_value.astimezone(timezone.utc).isoformat(),
7474
PROPERTY_TYPE_KEY: type_name,
7575
PROPERTY_TIMEZONE_OFFSET_KEY: _utc_offset_seconds(value),
7676
}

packages/server/server_tests/memmachine_server/episodic_memory/short_term_memory/test_short_term_memory.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ async def update_session_episodic_config(
117117
) -> None:
118118
pass
119119

120+
async def get_event_memory_conf(self, session_key: str):
121+
return None
122+
123+
async def set_event_memory_conf(self, session_key: str, conf=None):
124+
pass
125+
120126

121127
T = TypeVar("T")
122128

packages/server/server_tests/memmachine_server/main/test_memmachine_delete_session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ class _SD:
142142
conf = MagicMock()
143143
conf.episodic_memory.enabled = False
144144
conf.semantic_memory.enabled = False
145+
conf.event_memory_store = None
146+
conf.event_memory = None
145147

146148
resources = MagicMock()
147149
resources.get_episode_storage = AsyncMock(return_value=episode_store)

packages/server/server_tests/memmachine_server/server/api_v2/test_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def _make_empty_memmachine() -> AsyncMock:
3232
empty = MagicMock()
3333
empty.episodic_memory = None
3434
empty.semantic_memory = None
35+
empty.event_memory = None
3536

3637
memmachine.query_search.return_value = empty
3738
memmachine.list_search.return_value = empty

sample_configs/episodic_memory_config.cpu.sample

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ episodic_memory:
1414
llm_model: openai_model
1515
message_capacity: 500
1616

17+
# Event memory (optional — omit this section to disable event memory)
18+
# Requires a VectorStore and SegmentStore backend (not yet available in all deployments).
19+
#
20+
# event_memory_store:
21+
# vector_store: my_vector_store_id
22+
# segment_store: my_segment_store_id
23+
#
24+
# event_memory:
25+
# embedder: openai_embedder
26+
# reranker: my_reranker_id # optional — omit to use embedding scores
27+
# properties_schema: # optional — user-defined filterable properties
28+
# source_role: str
29+
# target_id: str
30+
# derive_sentences: false
31+
# max_text_chunk_length: 2000
32+
1733
retrieval_agent:
1834
llm_model: openai_model
1935
reranker: my_reranker_id

sample_configs/episodic_memory_config.gpu.sample

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ episodic_memory:
1414
llm_model: openai_model
1515
message_capacity: 500
1616

17+
# Event memory (optional — omit this section to disable event memory)
18+
# Requires a VectorStore and SegmentStore backend (not yet available in all deployments).
19+
#
20+
# event_memory_store:
21+
# vector_store: my_vector_store_id
22+
# segment_store: my_segment_store_id
23+
#
24+
# event_memory:
25+
# embedder: openai_embedder
26+
# reranker: my_reranker_id # optional — omit to use embedding scores
27+
# properties_schema: # optional — user-defined filterable properties
28+
# source_role: str
29+
# target_id: str
30+
# derive_sentences: false
31+
# max_text_chunk_length: 2000
32+
1733
retrieval_agent:
1834
llm_model: openai_model
1935
reranker: my_reranker_id

0 commit comments

Comments
 (0)