Skip to content
C.W.K.
Stream
Lesson 04 of 04 · published

Keywords Become Memory

~10 min · keywords, tags, search, normalization

Level 0Dry Nib
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"The words that open the well may later become handles, never grades."

What actually persists

Keywords begin as a small way to draw a passage from the well. After generation, the same words can help the collection remember itself. They become tags and search handles without turning into a ranking signal.

Views are queries

Trim and collapse whitespace, lowercase the result, and keep that canonical value as the keyword. Current Inkwell deliberately does not store a second display form. A many-to-many relation lets an entry carry several keywords and one keyword lead back to many entries.

What ambiguity costs

Discarding keywords after prompt assembly loses useful provenance. Flattening them into one comma string makes exact matching brittle. Ranking the writer by keyword novelty would again turn memory into performance.

Collection principle. The words that open the well may later become handles, never grades.

See one entry through four windows

Test “Keywords Become Memory” by viewing one entry through Today, 7 days, 30 days, and calendar. State whether each view copies data or applies another predicate, and separate the questions answered by device-local date and absolute timestamp. Creating fake rows for blank days means the model has begun storing obligation.

Query it

Normalize three whitespace-and-case variants, prove they become one canonical keyword, and query every live entry connected to it. Then explain how use_count and last_used_at support reuse without becoming a score.

Memory should lead back

Dates and keywords make return paths without judging the writing. When search reads the same original and transcribed state and tags retain prompt provenance, one collection truly owns its history.

Code

Use the canonical keyword itself·sql
CREATE TABLE keywords (
  keyword TEXT PRIMARY KEY,
  use_count INTEGER NOT NULL DEFAULT 0,
  last_used_at TEXT NOT NULL
);
CREATE TABLE entry_keywords (
  entry_id TEXT NOT NULL REFERENCES entries(id),
  keyword TEXT NOT NULL REFERENCES keywords(keyword),
  PRIMARY KEY(entry_id, keyword)
);
SELECT e.id, e.original_text
FROM entries AS e
JOIN entry_keywords AS ek ON ek.entry_id = e.id
WHERE ek.keyword = :keyword AND e.status = 'live';

External links

Exercise

Normalize three whitespace-and-case variants and prove they become one canonical keyword.
Hint
Check the primary key, join rows, use_count, and last_used_at.

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.