Skip to content
Back to skills

Memory Service

ASecurity

记忆检索服务。让 Agent 自主决定是否需要回忆过去的对话。 **使用场景**: 1. 用户问"之前我们讨论过什么"、"上次说的那个..." 2. 需要参考之前的上下文来回答当前问题 3. 用户提到某个之前讨论过的主题 **不要滥用**:简单问题(如写代码、解释概念)不需要检索记忆

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
ai-agentspythondocker

Works with

  • cli

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill memory-service --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memory Service?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memory Service
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-memory-service-claude-skill-registry/badge)](https://www.skillsdirectory.com/skills/majiayu000-memory-service-claude-skill-registry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: memory_service
description: |
  记忆检索服务。让 Agent 自主决定是否需要回忆过去的对话。
  **使用场景**:
  1. 用户问"之前我们讨论过什么"、"上次说的那个..."
  2. 需要参考之前的上下文来回答当前问题
  3. 用户提到某个之前讨论过的主题
  **不要滥用**:简单问题(如写代码、解释概念)不需要检索记忆
client_class: MemoryServiceClient
default_method: search
---

## 功能

使用 **Rerank + LLM** 两阶段检索,让 Agent 可以:
- 智能搜索与当前问题相关的历史对话
- LLM 理解上下文和指代关系(如"上次说的那个")
- 按时间范围筛选记忆

## 调用方式

```python
from services.memory_service.client import MemoryServiceClient

client = MemoryServiceClient()

# 语义搜索相关记忆
results = client.search(
    query="用户之前问过关于 Docker 的问题",
    session_id="current_session_id",  # 必填:限定在当前会话内搜索
    limit=5  # 返回最相关的 5 条
)

# 获取最近的对话历史
recent = client.get_recent(
    session_id="session_id",
    limit=10
)
```

## 检索流程

```
1. 从数据库获取最近 50 条消息
        ↓
2. Rerank 模型初筛 → top 10 候选
        ↓
3. LLM 精选 + 整合 → 最相关的 N 条
        ↓
4. 返回结果(含相关性评分)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.