Skip to main content
Glama
cachly-dev

Cachly — AI Cognitive Brain

learn_from_attempts

Store lessons from successes and failures to automatically recall the best solution in future sessions.

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
tagsNoTopic tags for filtering (e.g. ["bash", "deploy", "env"])
groupNoOptional team scope — restricts this lesson to a named group/sub-team (e.g. "backend", "security"). Only members of that group (managed via team_grant_scope) and admins see it in smart_recall. Orthogonal to visibility: a team-wide lesson has no group; a private lesson is author-only regardless of group.
topicYesShort slug, e.g. "deploy:web", "debug:redis-tls", "fix:generate-series"
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. Also powers brain_who_knows and team_expertise_map.
contextNoAdditional context, error messages, root cause (optional)
outcomeYesDid it work?
serviceNoThe service or system this lesson concerns (e.g. "prometheus", "cachly-web", "auth-service"). Builds a Service node in the knowledge graph linking the people who operate it and the files that run in it. Powers brain_service_map for instant incident triage.
commandsNoCommands that worked or failed (e.g. ["rsync -avz ...", "docker compose up -d"])
severityNoImpact severity: critical (blocks work/deploy), major (significant slowdown), minor (nice to know). Default: major.
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.
file_pathsNoFiles involved in this lesson (e.g. ["infra/deploy.sh", ".env"])
visibilityNoWho can see this lesson. "team" (default) = all team members. "private" = only accessible via exact recall_best_solution, never surfaced in smart_recall or team_recall. "public" = same as team (public syndication planned).
instance_idYesUUID of the cache instance
what_failedNoWhat did NOT work (optional but valuable)
what_workedYesWhat solved the problem or what approach succeeded
service_kindNoWhether `service` is an application service ("service", default) or infrastructure ("system", e.g. prometheus, kubernetes, redis). Shown as 🛰️/🖥️ in brain_service_map.
Behavior5/5

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

With no annotations provided, the description fully discloses behavioral traits: deduplication (updates existing topic with audit trail), contradiction detection (warns on conflicting outcomes), confidence decay (1.0 → 0.7 after 5d → 0.5 after 10d), and structured metadata handling. This is comprehensive and leaves no major behavioral ambiguity.

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 moderately long (multiple paragraphs) but well-structured: it starts with purpose and when-to-call, then lists key fields, behavior details, and an example. Every sentence adds value, though the example and some behavioral notes could be slightly trimmed. It is front-loaded with the most critical information.

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

Completeness4/5

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

Given 16 parameters (4 required), no output schema, and no annotations, the description covers purpose, usage, parameter highlights, deduplication, contradiction detection, and confidence decay. However, it does not describe what the tool returns (e.g., confirmation, error messages) or any error states, which is a minor gap. Overall, it is nearly complete for the tool's complexity.

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 description coverage is 100%, so baseline is 3. The description adds value by summarizing key fields (topic, outcome, what_worked, what_failed, context) and providing an example that demonstrates usage patterns. It also connects parameters to behavioral features like deduplication (topic) and confidence (outcome), enhancing semantic understanding beyond the schema.

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 clearly states the tool stores a lesson learned from attempts, with a specific verb ('Store') and resource ('lesson'). It distinguishes from sibling tools by explicitly mentioning recall_best_solution for future recall, and provides concrete usage scenarios ('deploy, debug, fix, architecture decision').

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 any non-trivial task') and explains that lessons will be recalled automatically via recall_best_solution. However, it does not explicitly state when not to use this tool versus alternatives like team_learn or global_learn, which are present in the sibling list.

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