AgentSkillsCN

status

检查 mem0 的配置状态并测试连接。当用户希望验证 mem0 是否正常运行、核对 API 密钥,或查看已存储的记忆时,这一功能将为您提供可靠支持。

SKILL.md
--- frontmatter
name: status
description: Check mem0 configuration status and test the connection. Use when the user wants to verify mem0 is working, check their API key, or see stored memories.

mem0 Status Skill

Check the current mem0 configuration and test the connection.

Steps

  1. Check environment configuration

    • Look for .env file in project root
    • Check for MEM0_API_KEY environment variable
    • Report current configuration values (mask the API key)
  2. Verify dependencies

    • Check if mem0ai package is installed
    • Report version if installed
  3. Test connection

    • Attempt to connect to mem0 API
    • Run a simple search query
    • Report success or error details
  4. Show memory stats (if connected)

    • Show recent memories for the current user
    • Display total memory count if available

Test Script

Run this to test the connection:

python
import os
from mem0 import MemoryClient

api_key = os.environ.get("MEM0_API_KEY")
user_id = os.environ.get("MEM0_USER_ID", "claude-code-user")

client = MemoryClient(api_key=api_key)
results = client.search("recent activity", filters={"user_id": user_id}, top_k=3)

print(f"Connection: OK")
print(f"User ID: {user_id}")
print(f"Recent memories: {len(results)}")
for r in results:
    print(f"  - {r.get('memory', '')[:50]}...")

Output Format

code
mem0 Status
===========
API Key: ****...****abcd (configured)
User ID: claude-code-user
Package: mem0ai 0.1.x installed

Connection Test: SUCCESS
Recent Memories: 5 found

Recent memories:
- User prefers TypeScript...
- Working on e-commerce project...