LeoYeAI/agent-master-skills / skills/agent-memory
agent-memory
VerifiedPersistent memory system for AI agents. Remember facts, learn from experience, and track entities across sessions.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 5.5 KB |
| SKILL.md | skill md | 1.5 KB |
| cli/entity.py | script | 3.5 KB |
| cli/fact.py | script | 3.4 KB |
| cli/learn.py | script | 2.3 KB |
| examples/basic_usage.py | script | 2.8 KB |
| requirements.txt | manifest | 48 B |
| src/__init__.py | script | 212 B |
| src/memory.py | script | 21.6 KB |
| tests/test_memory.py | script | 5.1 KB |
cli/learn.py
View on GitHub#!/usr/bin/env python3
"""CLI wrapper for AgentMemory lesson operations."""
import sys
import argparse
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
from memory import AgentMemory
def main():
parser = argparse.ArgumentParser(description="Manage agent lessons learned")
parser.add_argument("--db", help="Database path", default=None)
subparsers = parser.add_subparsers(dest="command", required=True)
# add command
add_p = subparsers.add_parser("add", help="Record a lesson learned")
add_p.add_argument("action", help="What was done")
add_p.add_argument("context", help="Situation/topic")
add_p.add_argument("outcome", choices=["positive", "negative", "neutral"], help="Result")
add_p.add_argument("insight", help="What was learned")
# list command
list_p = subparsers.add_parser("list", help="List lessons")
list_p.add_argument("--context", "-c", help="Filter by context")
list_p.add_argument("--outcome", "-o", choices=["positive", "negative", "neutral"])
list_p.add_argument("--limit", "-n", type=int, default=20)
# apply command
apply_p = subparsers.add_parser("apply", help="Mark a lesson as applied")
apply_p.add_argument("lesson_id", help="ID of lesson to mark applied")
args = parser.parse_args()
mem = AgentMemory(db_path=args.db)
if args.command == "add":
lesson_id = mem.learn(
action=args.action,
context=args.context,
outcome=args.outcome,
insight=args.insight
)
emoji = {"positive": "✅", "negative": "❌", "neutral": "➖"}[args.outcome]
print(f"{emoji} Lesson [{lesson_id}]: {args.insight[:60]}...")
elif args.command == "list":
lessons = mem.get_lessons(context=args.context, outcome=args.outcome, limit=args.limit)
if not lessons:
print("No lessons found.")
for l in lessons:
emoji = {"positive": "✅", "negative": "❌", "neutral": "➖"}[l.outcome]
print(f"{emoji} [{l.id}] {l.context}: {l.insight}")
print(f" Action: {l.action} | Applied: {l.applied_count}x")
elif args.command == "apply":
mem.apply_lesson(args.lesson_id)
print(f"📝 Marked lesson {args.lesson_id} as applied")
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |