smithery.ai

memory-retrieve

Intelligent memory search with automatic method selection. Supports semantic (vector), keyword, and recent queries. Includes fallback strategies and optional summary inclusion.

First seen Apr 10, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0
Allowed toolsBash(bun:*)
Declared agents opencode
More metadata
subagent
summarizer
version
1.0
category
memory-management

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,985 B
  • docs SUMMARY.md 199 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Hybrid Memory Retrieval

Search memories using the optimal strategy based on query analysis.

State Machine

START → PARSE_QUERY → CLASSIFY
     ├→ NO_QUERY ────→ GET_RECENT ────────────────────┐
     ├→ RECENT ──────→ GET_RECENT_N ──────────────────┤
     ├→ KEYWORD ─────→ KEYWORD_SEARCH ────────────────┤
     └→ SEMANTIC ────→ VECTOR_SEARCH ──┬→ RESULTS ────┤
                                       └→ FALLBACK ───┤
                                                      ▼
                              INCLUDE_SUMMARIES? → FORMAT → END

Query Classification

Pattern Type Example Strategy
Empty none "" Recent memories
Temporal recent "last 5", "recent" Recent N memories
Short specific keyword "JWT token" Keyword match
Question/conceptual semantic "How does auth work?" Vector + fallback

Execution

Path A: Subagent (preferred)

Task(
  subagent_type: "summarizer",
  prompt: "Search memories in project PROJECT_ID for: QUERY"
)

Path B: Direct script

bun .opencode/skills/memory-retrieve/scripts/retrieve-memories.ts PROJECT_ID [QUERY] [OPTIONS]

Commands

Main Retrieval

# Recent memories (no query)
bun .opencode/skills/memory-retrieve/scripts/retrieve-memories.ts PROJECT_ID

# Semantic search
bun .opencode/skills/memory-retrieve/scripts/retrieve-memories.ts PROJECT_ID "authentication flow"

# With summaries
bun .opencode/skills/memory-retrieve/scripts/retrieve-memories.ts PROJECT_ID "JWT" --include-summaries

# JSON output
bun .opencode/skills/memory-retrieve/scripts/retrieve-memories.ts PROJECT_ID "auth" --format json --limit 10

Individual Scripts

# Classify query type
bun .opencode/skills/memory-retrieve/scripts/classify-query.ts "QUERY"

# Recent only
bun .opencode/skills/memory-retrieve/scripts/get-recent-memories.ts PROJECT_ID --limit 10

# Vector search
bun .opencode/skills/memory-retrieve/scripts/search-vector.ts PROJECT_ID "QUERY" --limit 20

# Keyword fallback
bun .opencode/skills/memory-retrieve/scripts/search-keyword.ts PROJECT_ID "QUERY" --limit 20

Options

Option Default Description
--limit N 20 Max results
--include-summaries false Include project summaries
`--format json\ text` text Output format
--quiet false JSON only, no progress

Exit Codes

Code Meaning
0 Success
1 Error
2 No results (search scripts only - triggers fallback)

Output

Text Format

## Summaries

### coding_session (1/8/2026)
OBJECTIVE: Implement authentication...

## Memories

- **fact** [0.92]: Implemented JWT verification...
- **fact** [0.89]: Added refresh token logic...

JSON Format

{
  "success": true,
  "memories": [...],
  "summaries": [...],
  "searchMethod": "vector",
  "totalTokens": 2340,
  "count": 8
}

Environment Variables

Variable Default Description
BRAINYAPIURL http://localhost:3000 API endpoint
BRAINYPROJECTID 3afb861a-... Default project if not specified
RETRIEVERECENTLIMIT 10 Default limit for recent queries
RETRIEVESEARCHLIMIT 20 Default limit for search queries
RETRIEVEMINSIMILARITY 0.5 Min similarity for vector results