mem0-context-loader

Searches and injects relevant memories into context before starting a task.

64.5k|7.6k|Updated Jun 20, 2023
One-click install
npx skills add https://github.com/mem0ai/mem0 --skill mem0-context-loader
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mem0-context-loader
Source: https://github.com/mem0ai/mem0/tree/main/integrations/mem0-plugin/.opencode-plugin/opencode-skills/mem0-context-loader
Command: npx skills add https://github.com/mem0ai/mem0 --skill mem0-context-loader

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When starting a new task or switching context, AI coding assistants lack awareness of past project decisions, coding conventions, and known pitfalls. This Skill pre-fetches relevant memories from mem0 so the assistant begins work with the right historical context already loaded.

Core Features & Use Cases

  • Parallel Memory Search: Runs 2-4 parallel search_memories queries across different angles such as feature names, file paths, and error keywords, filtered by user and app IDs.
  • Typed Memory Retrieval: Targets specific memory types including decisions, conventions, and anti-patterns to surface architecture choices, coding patterns, and known pitfalls.
  • Compact Context Output: Deduplicates results by memory ID and outputs a plain-text block of at most 10 memories, staying silent when nothing relevant exists.
  • Use Case: A developer starts work on a payment module; the Skill searches mem0 for prior decisions and conventions about that module and injects a concise summary before any code is written.

Quick Start

Ask the assistant to load context for the feature you are about to work on, for example by saying "load context for the authentication module".

Frequently Asked Questions about mem0-context-loader

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load project context before starting a coding task?

Invoke the context loader at session start or when naming a feature, and it runs parallel search_memories queries against mem0 for decisions, conventions, and anti-patterns. It returns a compact plain-text block of up to 10 relevant memories.

What types of memories does mem0 context search retrieve?

It retrieves three typed categories: decisions for architecture choices, conventions for coding patterns, and anti-patterns for known pitfalls. Queries are filtered by user_id, app_id, and metadata type to keep results scoped to the current project.

Does the context loader modify or delete stored memories?

No, the Skill is strictly read-only. It only runs search_memories queries and never modifies or deletes any stored memory, making it safe to run at any point in a session.

Why does the context loader output nothing sometimes?

It is designed to stay silent when zero relevant memories are found, avoiding noise in the conversation. It only surfaces a context block when search results contain relevant project history.

Can I use this with OpenCode and mem0 together?

Yes, the Skill is built for the OpenCode plugin environment with mem0 as the memory backend. Output is plain text without markdown because the OpenCode TUI renders text verbatim.