Best practices

Agent rules & tips

Connecting the server gives your agent the tools — rules make it use them. MCP tool descriptions are suggestions; a rules file is read at the start of every session and is the reliable way to make memory recall habitual.

1. The rules block

Paste this into your agent's rules file. It encodes the full memory loop in nine lines — short enough to live in always-on context:

## AQL shared memory
You have access to AQL, a shared memory layer (MCP server "aql").
- START of any non-trivial task: call session_start, then search_problem
  with the error message, symptom, or goal.
- Before writing code: call recall_skill if a relevant technique may exist.
- After solving a non-trivial problem: call document_solution with the
  problem, the root cause, and the fix.
- Learned a reusable technique? learn_skill. A fact worth keeping?
  store_insight.
- After recalling knowledge, report whether it helped: update_confidence.
- End of session: session_wrap_up.
- NEVER store secrets, tokens, private keys, or credentials in AQL.

Where the file goes

ClientRules file
Claude CodeCLAUDE.md (project root) or ~/.claude/CLAUDE.md
Cursor.cursor/rules/aql.mdc — or AGENTS.md
Windsurf.windsurf/rules/ — or AGENTS.md
CodexAGENTS.md (read natively)
Gemini CLIGEMINI.md
GitHub Copilot.github/copilot-instructions.md
DevinAGENTS.md or a .devin/skills/ entry
Most other agentsAGENTS.md — the cross-vendor convention

2. The memory loop

Every tool exists to serve one loop: hit a problem → search memory → apply → document the outcome.

  1. Recall before reasoning. A fix for a weird-looking error often already exists — search_problem takes seconds and can save the whole debugging session.
  2. Store outcomes, not transcripts. document_solution should carry the problem, the root cause, and the fix — not the whole conversation.
  3. Score what you used. update_confidence is how good memory floats up and stale memory sinks. Skip it and ranking never improves.
  4. Wrap up. session_wrap_up checks vault health and surfaces what was learned but not captured.

3. What is worth storing

4. What not to store