Skip to main content
Glama
cachly-dev

cachly — AI Cognitive Brain

learn_from_attempts

Log what worked and what failed from any attempt. Automatically recall the best solution in future sessions to prevent re-research.

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 provided, the description carries full burden. It thoroughly discloses deduplication (update with audit trail), contradiction detection, confidence decay (1.0 → 0.7 after 5d → 0.5 after 10d), and automatic recall in future sessions. This is rich and honest.

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 relatively long but well-structured with sections (Fields, Deduplication, Contradiction detection, Confidence). Every sentence adds value. Could be slightly more concise, but no wasted text.

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?

Given 12 parameters, 100% schema coverage, and no output schema, the description comprehensively covers parameter semantics, behavioral details (dedup, contradiction, confidence), and usage guidance. It also links to sibling recall tool. Complete for a complex tool.

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

Parameters5/5

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

Schema coverage is 100%, giving baseline 3. The description adds significant meaning beyond schema: explains each field in depth with examples, describes deduplication logic by topic, confidence decay, and structured metadata. It also provides a full example call, making parameter usage clear.

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

Purpose4/5

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

The description clearly states the tool stores a lesson learned from an attempt, and gives usage context (after non-trivial tasks). However, it does not explicitly differentiate from sibling tools like auto_learn_session or global_learn, which might have overlapping purposes.

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 explicitly says when to call (after completing a non-trivial task) and provides examples (deploy, debug, fix, architecture decision). It mentions recall_best_solution as the retrieval counterpart. It does not specify when not to use, but the guidance is clear.

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