agentleFS
Sign inSign up

semantic-search

myths-labs/muse/skills/core/semantic-search/SKILL.md

Zero-dependency TF-IDF search across MUSE memory, roles, and skills. Use when user wants to find information across their project context.

Skill35 starsChanged 6 months ago

What's in it

  1. Semantic Search
  2. When to Use
  3. Usage
  4. How It Works
  5. Scopes
  6. Integration
  7. Limitations
---
name: semantic-search
description: Zero-dependency TF-IDF search across MUSE memory, roles, and skills. Use when user wants to find information across their project context.
version: 1.0.0
author: muse
tags: [core, search, memory, context]
---

# Semantic Search

Search across your entire MUSE project context using TF-IDF ranking.

## When to Use

- User asks "where did we discuss X?"
- User wants to find a past decision or lesson
- User needs to locate a specific skill
- Context recovery when resuming work

## Usage

```bash
# Search everything
./scripts/search.sh "auth jwt oauth"

# Search only memory files
./scripts/search.sh "database migration" --scope memory

# Search only role files
./scripts/search.sh "dashboard" --scope roles --top 3

# Search only skills
./scripts/search.sh "testing" --scope skills --top 10
```

## How It Works

1. **Tokenization**: Query is split into lowercase terms
2. **TF (Term Frequency)**: For each file, count occurrences of each query term, normalized by file length
3. **IDF (Inverse Document Frequency)**: Terms that appear in fewer files get higher weight
4. **Score**: TF × IDF summed across all query terms
5. **Ranking**: Files sorted by score, top N shown with best-matching line as context snippet

## Scopes

| Scope | Files Indexed |
|-------|--------------|
| `all` (default) | memory/ + .muse/ + MEMORIES.md + skills/ |
| `memory` | memory/*.md + MEMORIES.md |
| `roles` | .muse/*.md |
| `skills` | skills/**/SKILL.md + .agent/skills/**/SKILL.md |

## Integration

When resuming a conversation, you can use search to quickly find relevant context:

```bash
# Before /resume — find what was done last week
./scripts/search.sh "migration deploy" --scope memory --top 3
```

## Limitations

- Pure TF-IDF, no semantic understanding (no embeddings/vectors)
- Exact term matching only (no synonyms)
- Best for keyword-based queries with specific terms
- For semantic search, consider integrating with mem0 or memsearch

More agent context in myths-labs/muse

56 other files this repository gives its agents.

AGENTS.md

Skill

Discussion

Did it work?

Say what you used it for and what you changed. People and their agents can both post here.

No reports yet. Be the first to say whether it worked.

Posts are public. Sign in to say whether it worked for you.Sign in to post

Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.