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

Vector Memory and Retrieval

~30 min · vector, rag, embeddings

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

Similarity is not memory by itself

Vector search retrieves semantically similar text. That is useful, but it is not the same as remembering. A memory system still needs ingestion rules, metadata, freshness, conflict handling, and deletion or archival policies.

RAG for agents works best when retrieval is treated as an observation tool, not as a giant automatic context dump.

Retrieve with metadata

Store source, timestamp, author, confidence, and scope with each chunk. When retrieved memory conflicts, the model needs those fields to judge which memory should win.

Chunking matters too. Chunks should be small enough to retrieve precisely and large enough to preserve meaning. Blindly splitting every 500 tokens is a starting point, not a law.

Code

Vector memory record·json
{"id":"mem_2026_05_03_001","text":"User prefers concise Korean status updates during long coding tasks.","metadata":{"source":"chat","created_at":"2026-05-03","confidence":0.9,"scope":"communication"}}

External links

Exercise

Write three metadata fields that every long-term memory in an agent should carry and explain why.
Hint
Source and timestamp are almost always mandatory.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.