HEL-835: probe seed backfills message_id provenance
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
multica-agent
parent
468f0bbb6c
commit
96cdf07d73
@@ -36,21 +36,25 @@ def seed(db_path: Path) -> dict:
|
||||
(json.dumps(identity, ensure_ascii=False),))
|
||||
rows = []
|
||||
# Target old turn (outside the 20-turn window).
|
||||
store.execute("INSERT INTO chat_message(ts,role,text,turn_id,status) VALUES(?,?,?,?,'sent')",
|
||||
(TS0, "user", "我今天在巷口旧书店买了一本蓝灰色封面的诗集。", TARGET_TURN))
|
||||
mid = store.execute(
|
||||
"INSERT INTO chat_message(ts,role,text,turn_id,status) VALUES(?,?,?,?,'sent')",
|
||||
(TS0, "user", "我今天在巷口旧书店买了一本蓝灰色封面的诗集。", TARGET_TURN),
|
||||
).lastrowid
|
||||
rows.append(("user", "我今天在巷口旧书店买了一本蓝灰色封面的诗集。",
|
||||
"用户在巷口旧书店买了一本蓝灰色封面诗集。", TARGET_TURN))
|
||||
"用户在巷口旧书店买了一本蓝灰色封面诗集。", TARGET_TURN, mid))
|
||||
# Filler turns inside the recent window, same keyword, no poetry books.
|
||||
for i, turn in enumerate(FILLER_TURNS, start=1):
|
||||
text = f" filler topic {i}:雨天通勤和晚饭。"
|
||||
store.execute("INSERT INTO chat_message(ts,role,text,turn_id,status)"
|
||||
" VALUES(?,?,?,?,'sent')", (TS0 + i * 60000, "user", text, turn))
|
||||
rows.append(("user", text, f"合成填充第{i}轮:与诗集无关。", turn))
|
||||
for role, raw, gist, turn in rows:
|
||||
mid = store.execute(
|
||||
"INSERT INTO chat_message(ts,role,text,turn_id,status)"
|
||||
" VALUES(?,?,?,?,'sent')", (TS0 + i * 60000, "user", text, turn),
|
||||
).lastrowid
|
||||
rows.append(("user", text, f"合成填充第{i}轮:与诗集无关。", turn, mid))
|
||||
for role, raw, gist, turn, mid in rows:
|
||||
store.execute(
|
||||
"INSERT INTO mem_episodic(ts,role,raw,gist,salience,affect,source,accessibility,"
|
||||
"turn_id,message_id) VALUES(?,?,?,?,0.5,NULL,'chat',1,?,NULL)",
|
||||
(TS0, role, raw, gist, turn),
|
||||
"turn_id,message_id) VALUES(?,?,?,?,0.5,NULL,'chat',1,?,?)",
|
||||
(TS0, role, raw, gist, turn, mid),
|
||||
)
|
||||
store.execute("INSERT INTO life_control(key,value) VALUES('memory_search','on')"
|
||||
" ON CONFLICT(key) DO UPDATE SET value='on'")
|
||||
|
||||
Reference in New Issue
Block a user