C.W.K.
Stream
Lesson 04 of 05 · published

Structured Memory: Facts, Preferences, Procedures

~28 min · sql, facts, preferences

Level 0Observer
0 XP0/40 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

어떤 기억은 table이 필요해

embedding은 fuzzy recall에 좋아. 정확한 constraint에는 약해. 사용자 preference, project status, permission, deadline, durable procedure는 structured storage에 들어가는 게 맞는 경우가 많아.

structured memory가 있으면 agent가 similarity search가 우연히 맞는 문단을 가져오길 빌지 않고 fact를 query할 수 있다.

진실마다 다른 저장소를 써

preference는 key-value record일 수 있고, project는 status와 owner를 가진 row일 수 있고, procedure는 version이 있는 markdown document일 수 있고, conversation episode는 source와 연결된 event record일 수 있어.

핵심은 당장 거창한 DB를 만들라는 게 아니야. vector store 하나가 memory의 만능 답이라는 착각을 버리라는 거야. 아니거든.

Code

SQLite facts table·sql
CREATE TABLE agent_facts (
  subject TEXT NOT NULL,
  predicate TEXT NOT NULL,
  object TEXT NOT NULL,
  confidence REAL NOT NULL DEFAULT 1.0,
  source TEXT NOT NULL,
  updated_at TEXT NOT NULL,
  PRIMARY KEY (subject, predicate)
);

External links

Exercise

agent가 정확히 저장해야 하는 fact 다섯 개를 골라. 각각 key-value, SQL, markdown, vector memory 중 어디에 둘지 정해.
Hint
낡은 데이터가 위험하면 structured storage가 대체로 이겨.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.