Skip to main content
Glama
cachly-dev

Cachly — AI Cognitive Brain

learn_from_attempts

Avoid repeating mistakes by storing lessons from each attempt. Future sessions automatically recall successful solutions to accelerate problem-solving.

Instructions

Store a lesson learned from a failed or successful attempt. Call this AFTER completing any non-trivial task (deploy, debug, fix, architecture decision). The lesson will be recalled automatically in future sessions via recall_best_solution. Fields: topic (short slug like "deploy:web"), outcome ("success"|"failure"), what_worked (what solved it), what_failed (what did NOT work), context (extra details). Supports structured metadata: severity, file_paths (files involved), commands (working commands), tags. Deduplication: if a lesson for this topic already exists, it is updated with full audit trail. Contradiction detection: warns if new outcome conflicts with existing lesson outcome. Confidence: lesson starts at 1.0, decays after 5d (→0.7) and 10d (→0.5) without recall. Example: learn_from_attempts(topic="deploy:api", outcome="success", what_worked="nohup docker compose up -d --build", what_failed="docker compose up hangs on SSH timeout", severity="critical", commands=["nohup docker compose up -d --build"])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesUUID of the cache instance
topicYesShort slug, e.g. "deploy:web", "debug:redis-tls", "fix:generate-series"
outcomeYesDid it work?
what_workedYesWhat solved the problem or what approach succeeded
what_failedNoWhat did NOT work (optional but valuable)
contextNoAdditional context, error messages, root cause (optional)
severityNoImpact severity: critical (blocks work/deploy), major (significant slowdown), minor (nice to know). Default: major.
file_pathsNoFiles involved in this lesson (e.g. ["infra/deploy.sh", ".env"])
commandsNoCommands that worked or failed (e.g. ["rsync -avz ...", "docker compose up -d"])
tagsNoTopic tags for filtering (e.g. ["bash", "deploy", "env"])
depends_onNoPrerequisites this lesson depends on (e.g. ["node:>=20", "docker:running", "wireguard:active"]). When a dependency is marked stale, all dependent lessons get needs_review.
authorNoName or handle of the person storing this lesson (e.g. "alice", "bob"). Used for Team Telepathy — teammates see each other's lessons in session_start.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden and excels: it discloses deduplication (updates existing lesson), contradiction detection (warns on conflicting outcome), confidence decay (starts at 1.0, decays after 5d and 10d), and structured metadata (severity, file_paths, commands, tags).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is thorough but efficiently structured: purpose first, then usage, then field descriptions, then behavioral details. Every sentence serves a purpose, though it could be slightly more concise given the length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description covers tool lifecycle: what happens on call (update/dedup/contradiction), decay behavior, and integration with recall. All 12 params are documented via schema and description context, making it complete for a knowledge storage tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all 12 parameters, raising baseline. The description adds context beyond schema: example usage, explanation of deduplication/update behavior, and default values (e.g., severity default 'major').

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Store a lesson learned from a failed or successful attempt' and specifies when to use it: 'Call this AFTER completing any non-trivial task.' It differentiates from sibling tools like recall_best_solution by noting that lessons stored here are automatically recalled there.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance on when to use the tool ('after completing any non-trivial task') and what happens to the stored data (recalled via recall_best_solution). It implies context but does not explicitly list when not to use it or compare to alternatives like brain_search.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cachly-dev/cachly-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server