live-retrieval
# live-retrieval This Claude Code skill proactively surfaces relevant notes from an Open Brain knowledge base during conversations by searching at session start and when topic shifts occur, using brief contextual notes appended to responses only when results score above 0.6. Use it to maintain continuity with previous thoughts and observations without interrupting the user's current task.
git clone --depth 1 https://github.com/NateBJones-Projects/OB1 /tmp/live-retrieval && cp -r /tmp/live-retrieval/recipes/live-retrieval/live-retrieval. ~/.claude/skills/live-retrievallive-retrieval.skill.md
# Live Retrieval
Surface relevant Open Brain thoughts when context signals suggest they would help.
Silent when nothing is found. Brief when something is.
## When to Fire
This skill fires proactively (not on command) at two moments:
### 1. Session Start
When a new session begins, pull recent context:
```
search_thoughts({ "query": "ACT NOW", "match_count": 3 })
list_thoughts({ "limit": 5 })
```
Surface as a brief note at the top of your first response:
"OB1 context: [1-2 line summary of what's recent]"
If nothing relevant, say nothing.
### 2. Topic Shift Detection
When the user's message contains a recognizable entity (person name, project name,
technology, concept) that differs from what was being discussed, search:
```
search_thoughts({ "query": "[detected entity or topic]", "match_count": 3 })
```
**How to detect topic shifts:**
- A person's name appears that wasn't in the previous 3 messages
- A project or product name is mentioned for the first time in the session
- A technology or framework is referenced that wasn't part of the current task
- The user explicitly says "let's talk about X" or "switching to X"
Do NOT fire on:
- Every message (too noisy)
- Generic words ("the", "code", "fix")
- Topics already being discussed (no shift detected)
- The same entity twice in one session (dedup)
## How to Surface Results
**On hit (score > 0.6):**
Append a brief note to your response. Maximum 3 lines. Do not interrupt flow.
Format:
```
[OB1: Found 2 related thoughts]
- "ACT NOW: [summary]" (captured March 14)
- "[observation about this topic]" (captured March 11)
```
**On miss (no results or score < 0.6):**
Say nothing. The user should never know a search happened and failed.
## Rules
1. **Silent on miss.** No "I searched Open Brain and found nothing." Ever.
2. **Brief on hit.** 3 lines max. The user's task is the priority, not the retrieval.
3. **Dedup within session.** Track which thought IDs you've surfaced. Never show the same one twice.
4. **No more than 3 retrievals per session.** After 3, stop searching. If you're hitting 3 before the session is half over, your topic detection is too sensitive.
5. **Never interrupt.** Context is appended to your response, not injected as a standalone message.
6. **Log every search.** Append to the retrieval log (see below) so you can track hit rate over time.
## Retrieval Log
After each search (hit or miss), log it. This data tells you if the skill is working.
Create or append to `.claude/live-retrieval-log.jsonl` in the project root:
```json
{"timestamp": "2026-03-19T10:30:00Z", "query": "project kickoff meeting", "results": 2, "surfaced": true, "score_max": 0.82}
{"timestamp": "2026-03-19T10:45:00Z", "query": "React server components", "results": 0, "surfaced": false, "score_max": 0.0}
```
After 10 sessions, review the log:
- Hit rate below 20%? Broaden your topic detection.
- Hit rate above 80%? You're probably searching too aggressively. Narrow the triggers.
- Average score below 0.5 on hits? Raise the threshold or improve query terms.
## What This Is NOT
- Not a pre-meeting briefing system (that's Life Engine's job)
- Not a brainstorm context loader (Panning for Gold handles that in Phase 2)
- Not a full-text search tool (the user can call search_thoughts directly if they want that)
This is the ambient, automatic, silent layer that makes Open Brain feel like it's thinking with you instead of just storing for you.
## Failure Behavior
| Failure | What Happens |
|---------|-------------|
| search_thoughts MCP unavailable | Skip silently. Do not mention it. |
| Search returns error | Log the error, skip silently. |
| Search times out | Skip silently. 5-second timeout max. |
| Results are all low-score (< 0.6) | Treat as miss. Silent. |Use Nate Jones OB1 Agent Memory from OpenClaw with provenance, scope, review, and use-policy discipline.
Continuous learning system that extracts reusable knowledge from work sessions. Triggers: (1) /aiception command, (2) 'save this as a skill' or 'extract a skill from this', (3) 'what did we learn?', (4) after non-obvious debugging or trial-and-error discovery. Creates new skills when valuable reusable knowledge is identified. Integrates with Open Brain to prevent duplicates.
Morning digest of yesterday's Open Brain thoughts, drafted to Gmail
Generate infographic images from any research doc, Open Brain thoughts, or analysis. Auto-chunks content, writes prompts, generates images via Gemini API (free tier), and saves to media/. Use --premium for better text rendering.
Use when processing voice transcripts, brain dumps, stream-of-consciousness notes, or any raw multi-topic capture. Extracts every idea thread, then evaluates each one with deep brainstorming, then captures results to Open Brain. Trigger on transcripts, exports, "process this", "pan for gold", "brain dump", "what did I say", or multi-topic markdown files.
|
|