add-memory-strategy

Implement thread-safe AgentMemory strategies for persistence, caching, TTL, and analytics.

1|Updated Jul 28, 2025
One-click install
npx skills add https://github.com/anoopg87/KAgentic --skill add-memory-strategy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-memory-strategy
Source: https://github.com/anoopg87/KAgentic/tree/main/.claude/skills/add-memory-strategy
Command: npx skills add https://github.com/anoopg87/KAgentic --skill add-memory-strategy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill enables you to design and integrate custom memory strategies for KAgentic agents by implementing the AgentMemory interface, enabling persistent, cached, or specialized conversation state management.

Core Features & Use Cases

  • Implement any memory strategy by implementing the AgentMemory interface to manage stores, retrievals, and full history in a thread-safe manner.
  • Support special keys such as "user_input" and "agent_response" to automatically build and update conversation history, plus a "history" view for formatted outputs.
  • Leverage a range of patterns (in-memory, file persistence, Redis, databases) to suit persistence, scalability, and performance needs.
  • Enable advanced capabilities like TTL-based expiration, metrics, and search over conversation history for analytics and debugging.
  • Typical use cases include persistent conversation history across restarts, multi-instance agent coordination, and custom memory behaviors for specialized workflows.

Quick Start

Create a simple custom memory by implementing AgentMemory and wiring it into an AgentFramework to track user inputs and agent responses.

Frequently Asked Questions about add-memory-strategy

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

FAQPage Schema
How do I implement custom agent memory strategies for persistent conversation history?

You implement custom agent memory by defining a class that satisfies the AgentMemory interface, specifically its store, retrieve, and getHistory methods. This allows you to manage conversation state using in-memory, file, Redis, or database-backed adapters.

Does KAgentic support thread-safe memory storage for concurrent agent operations?

Thread-safe memory storage is supported by applying a Mutex within your custom AgentMemory implementation. This ensures concurrency safety during simultaneous read and write operations across multi-instance agent coordination.

Can I use Redis for agent memory persistence and TTL-based expiration?

Redis is fully supported as an adapter for agent memory persistence, enabling TTL-based expiration and multi-instance agent coordination. You implement the AgentMemory interface with Redis to manage state expiration and analytics.

What is the best way to automatically build conversation history in AI agents?

The best way to build conversation history is by supporting special keys like user_input and agent_response within your AgentMemory implementation. The interface uses these keys to automatically track and format the history view for outputs.

What are the limitations of using in-memory patterns for multi-instance agent coordination?

In-memory patterns limit multi-instance agent coordination because state is lost on restarts and not shared across instances. For persistent coordination, you must implement file, Redis, or database-backed adapters to synchronize state.