memory
Autonomous user preference detection, storage and injection. The agent detects preferences from conversation, saves them to Postgres, and loads active ones at the start of every flow.
galiprandi · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add galiprandi/job-seeker --skill memoryAbout this skill
name: memory description: Autonomous user preference detection, storage and injection. The agent detects preferences from conversation, saves them to Postgres, and loads active ones at the start of every flow. trigger: memory
Memory — Autonomous preference management
This skill implements Gold Rule 3 (user preferences always up to date). The agent proactively detects, stores, and injects user preferences without being asked.
When it runs
Always. This is not a flow triggered by a keyword. It is a background behavior that runs during every interaction:
- Detection: after every user message, evaluate whether a preference was stated, implied, or corrected
- Injection: at the pre-flight of every flow, load active preferences into context
Detection
After every user message, scan for 3 signal types:
| Signal | Example | Confidence | Source |
|---|---|---|---|
| Explicit | "no quiero empresas de crypto" | 1.0 | explicit_statement |
| Implicit | "respondeme corto" | 0.7 | inferred |
| Correction | "actualmente busco roles de IC, no manager" | 1.0 | correction |
Save vs skip checklist
Save (proactively, no need to ask):
- Job search preferences (roles, industries, locations, work mode, salary)
- Communication preferences (language, tone, length, format)
- Compensation criteria (range, equity, benefits)
- Tooling/workflow preferences (which platforms, how to apply)
- Corrections to anything previously stored
- Explicit requests: "recordá que..." / "remember that..."
- Strategy level changes. When the user's situation changes (employment status, urgency), detect and propose a strategy level change. See AGENTS.md "Strategy levels"
Skip:
- Trivial/obvious info ("user asked about Python")
- Already in CV or
users.data.profile(don't duplicate) - Already in
users.data.style_profile - Re-discoverable facts (can web search)
- Session-specific ephemera (temporary file paths, one-off debugging)
- Already in AGENTS.md or other context files
Storage
All preferences live in the preferences table, accessed via scripts/db.js:
preferences (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id),
category TEXT NOT NULL, -- job_search, communication, compensation, tooling, workflow
key TEXT NOT NULL, -- e.g. "avoid_industries", "reply_language", "salary_min"
value TEXT NOT NULL, -- e.g. "crypto,gambling", "spanish", "5000"
confidence REAL DEFAULT 1.0, -- 1.0 explicit, 0.7 inferred, 0.5 auto-summarized
source TEXT DEFAULT 'explicit_statement', -- explicit_statement | inferred | correction
status TEXT DEFAULT 'active', -- active | superseded
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE(user_id, category, key)
)
Categories
| Category | Examples |
|---|---|
job_search | avoid_industries, target_roles, location_preference, work_mode, visa_requirements |
communication | reply_language, reply_tone, reply_length, greeting_style, avoid_bullets |
compensation | salary_min, salary_max, currency, equity_expectation, required_benefits |
tooling | preferred_platforms, apply_method, browser_mode |
workflow | application_batch_size, follow_up_timing, auto_apply_threshold, strategy_level |
Save a new preference
node scripts/db.js "INSERT INTO preferences (user_id, category, key, value, confidence, source) VALUES (<user_id>, '<category>', '<key>', '<value>', <confidence>, '<source>') ON CONFLICT (user_id, category, key) DO UPDATE SET value = EXCLUDED.value, confidence = EXCLUDED.confidence, source = EXCLUDED.source, updated_at = NOW()" --write
The ON CONFLICT clause handles updates: if the preference already exists, it replaces the value and bumps updated_at. No need to check first.
Correction handling
When a correction is detected (user contradicts a stored preference), the same INSERT with ON CONFLICT DO UPDATE handles it. The old value is replaced, source becomes correction, and updated_at is bumped. The old value is not preserved (single user, no audit trail needed).
Strategy level detection
The agent must detect signals that the user's job search situation has changed and propose a strategy level adjustment. This is Gold Rule 3 applied to urgency/aggressiveness.
| Signal | Example | Proposed level |
|---|---|---|
| Lost job / fired | "me despidieron", "me quedé sin trabajo", "lost my job" | active |
| About to lose job | "me van a despedir", "termina mi contrato en X", "my contract ends" | active |
| Desperation | "necesito algo ya", "urgentísimo", "need a job now" | aggressive |
| Found a job | "encontré trabajo", "acepté una oferta", "got the job" | passive |
| Employed, casually looking | "estoy viendo opciones", "open to opportunities" | selective |
| Wants more aggressive | "aplica más agresivo", "send more applications" | bump up one level |
| Wants less aggressive | "frená un poco", "too many applications" | bump down one level |
When a strategy change is detected:
- Propose the change to the user (never change without asking)
- Explain what will change (batch sizes, match threshold, relax rules)
- Wait for confirmation
- Save to
preferences(workflow.strategy_level) andusers.data.strategy - Report: "Estrategia actualizada: "
Injection
At the pre-flight of every flow, load active preferences:
node scripts/db.js "SELECT category, key, value, confidence, source FROM preferences WHERE user_id = <user_id> AND status = 'active' ORDER BY category, key"
Inject the result into the flow's context. Treat preferences as constraints:
job_search.*→ filter jobs, discard non-matchingcommunication.*→ shape drafts (language, tone, length)compensation.*→ filter by salary, negotiatetooling.*→ choose platforms and methodstooling.browser_mode→ controls browser visibility in all flows that use