scope episodic memory enrichment by session_id

This commit is contained in:
2026-03-16 00:33:11 +01:00
parent fae9efee0d
commit 02a9684cd6
3 changed files with 58 additions and 9 deletions

View File

@@ -230,7 +230,12 @@ async def _handle_home_request(
# ── Memory: enrich context before LLM call ────────────────────────
async with async_session() as db:
memory = MemoryMiddleware(db)
memory_context = await memory.enrich_context(user_id, message, trace_id=request_id)
memory_context = await memory.enrich_context(
user_id,
message,
trace_id=request_id,
session_id=session_id,
)
context: dict = {
"conversation_history": frame.get("conversation_history", []),
@@ -294,7 +299,12 @@ async def _handle_floating_request(
# ── Memory: enrich context before LLM call ────────────────────────
async with async_session() as db:
memory = MemoryMiddleware(db)
memory_context = await memory.enrich_context(user_id, message, trace_id=request_id)
memory_context = await memory.enrich_context(
user_id,
message,
trace_id=request_id,
session_id=session_id,
)
context: dict = {
"scope": scope,