Agent Memory and Skills System

Summary

The Sokrates agent utilizes a dual-layered persistence system to maintain context across sessions: Memory for factual data and Skills for procedural workflows. This system is governed by strict character limits and requires specific user triggers to update the agent’s long-term state.

Details

The agent’s persistence architecture is divided into two distinct functional categories to optimize how information is retrieved and applied during interactions.

Memory vs. Skills

  • Memory: This component is dedicated to storing static facts and environmental context. It includes details such as project locations, developer preferences, environment variables, and specific project configurations (e.g., “our CI uses GitHub Actions with the deploy.yml workflow”). Memory is primarily stored in two files: MEMORY.md and USER.md.
  • Skills: These are encoded procedures and multi-step workflows. A skill is created when a task requires five or more steps and is expected to be executed repeatedly. Skills act as reusable recipes, such as a deploy-staging sequence, allowing the agent to execute complex operations without needing the user to re-explain the steps in every session.

Capacity and Management

The memory system is intentionally bounded to ensure the system prompt remains efficient and within context window limits.

  • MEMORY.md: Limited to approximately 2,200 characters.
  • USER.md: Limited to approximately 1,375 characters.

When these limits are reached, the agent must consolidate entries or the user must request a cleanup (e.g., “clean up your memory”). Users are encouraged to proactively manage these files by requesting updates to outdated information, such as updating a language version from Python 3.9 to 3.12.

Persistence Lifecycle

Updates to the Memory and Skills system do not take effect immediately within the active session. The agent’s state is a “frozen snapshot” loaded at the start of a session. Consequently, any information saved via the “remember this for next time” command or through skill creation will only appear in the system prompt starting with the next session.

To ensure high-quality persistence, users are advised to be specific when requesting the agent to remember information, providing clear context about what should be saved and why it is relevant for future tasks.