Skill站外收录 @skilllib/skill-2117939930272410392
searching-messages
通过语义与关键词结合的方式检索历史对话内容,支持按时间范围、相关性或跨代理主体进行信息定位,可精准回溯先前讨论的上下文、确认过往陈述细节,并能识别特定话题的参与方,适用于需要恢复长期记忆或追溯决策过程的场景。
数据与分析 AI 技能
Skills.MD
# Searching Messages
This skill helps you search through past conversations to recall context that may have fallen out of your context window.
## When to Use This Skill
- User asks "do you remember when we discussed X?"
- You need context from an earlier conversation
- User references something from the past that you don't have in context
- You want to verify what was said before about a topic
- You need to find which agent discussed a specific topic (use with `finding-agents` skill)
## Script Usage
The scripts are located in the `scripts/` subdirectory of this skill. Use the **Skill Directory** path shown above when loading this skill.
```bash
npx tsx <SKILL_DIR>/scripts/search-messages.ts --query <text> [options]
```
Replace `<SKILL_DIR>` with the actual path from the `# Skill Directory:` line at the top of this loaded skill.
### Options
| Option | Description |
|--------|-------------|
| `--query <text>` | Search query (required) |
| `--mode <mode>` | Search mode: `vector`, `fts`, `hybrid` (default: hybrid) |
| `--start-date <date>` | Filter messages after this date (ISO format) |
| `--end-date <date>` | Filter messages before this date (ISO format) |
| `--limit <n>` | Max results (default: 10) |
| `--all-agents` | Search all agents, not just current agent |
| `--agent-id <id>` | Explicit agent ID (for manual testing) |
### Search Modes
- **hybrid** (default): Combines vector similarity + full-text search with RRF scoring
- **vector**: Semantic similarity search (good for conceptual matches)
- **fts**: Full-text search (good for exact phrases)
## Companion Script: get-messages.ts
Use this to expand around a found needle by message ID cursor:
```bash
npx tsx <SKILL_DIR>/scripts/get-messages.ts [options]
```
| Option | Description |
|--------|-------------|
| `--after <message-id>` | Get messages after this ID (cursor) |
| `--before <message-id>` | Get messages before this ID (cursor) |
| `--order <asc\|desc>` | Sort order (default: desc = newest first) |
| `--limit <n>` | Max results (default: 20) |
| `--agent-id <id>` | Explicit agent ID |
## Search Strategies
### Strategy 1: Needle + Expand (Recommended)
Use when you need full conversation context around a specific topic:
1. **Find the needle** - Search with keywords to discover relevant messages:
```bash
npx tsx <SKILL_DIR>/scripts/search-messages.ts --query "flicker inline approval" --limit 5
```
2. **Note the message_id** - Find the most relevant result and copy its `message_id`
3. **Expand before** - Get messages leading up to the needle:
```bash
npx tsx <SKILL_DIR>/scripts/get-messages.ts --before "message-xyz" --limit 10
```
4. **Expand after** - Get messages following the needle (use `--order asc` for chronological):
```bash
npx tsx <SKILL_DIR>/scripts/get-messages.ts --after "message-xyz" --order asc --limit 10
```
### Strategy 2: Date-Bounded Search
Use when you know approximately when something was discussed:
```bash
npx tsx <SKILL_DIR>/scripts/search-messages.ts --query "topic" --start-date "2025-12-31T00:00:00Z" --end-date "2025-12-31T23:59:59Z" --limit 15
```
Results are sorted by relevance within the date window.
### Strategy 3: Broad Discovery
Use when you're not sure what you're looking for:
```bash
npx tsx <SKILL_DIR>/scripts/search-messages.ts --query "vague topic" --mode vector --limit 10
```
Vector mode finds semantically similar messages even without exact keyword matches.
### Strategy 4: Find Which Agent Discussed Something
Use with `--all-agents` to search across all agents and identify which one discussed a topic:
```bash
npx tsx <SKILL_DIR>/scripts/search-messages.ts --query "authentication refactor" --all-agents --limit 10
```
Results include `agent_id` for each message. Use this to:
1. Find the agent that worked on a specific feature
2. Identify the right agent to ask follow-up questions
3. Cross-reference with the `finding-agents` skill to get agent details
**Tip:** Load both `searching-messages` and `finding-agents` skills together when you need to find and identify agents by topic.
## Search Output
Returns search results with:
- `message_id` - Use this for cursor-based expansion
- `message_type` - `user_message`, `assistant_message`, `reasoning_message`
- `content` or `reasoning` - The actual message text
- `created_at` - When the message was sent (ISO format)
- `agent_id` - Which agent the message belongs to
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「searching-messages」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次