AQL 0.13: One Read, Thirteen Verbs
AQL 0.13 replaces seven rounds of additions with one smaller language. One read verb, branches as namespaces, aliases instead of entity merges, and about 60 keywords.
Smaller on purpose
AQL is how an agent talks to its memory. From v0.6 to v0.12, every version only added to it: time travel, graph walks, subscriptions, live queries, scopes, branches, entity merges. Each addition made sense on its own. Together they left four read verbs, two words for the same direction, and verbs that only worked on one memory type.
That matters more for a query language agents write than for one people write. An LLM picking between SCAN, RECALL, LOOKUP and LOAD has four chances to choose the wrong one. Every extra keyword is something the model has to remember, and a place a plausible-looking query can fail.
So AQL 0.13 is a clean break. It replaces v0.5 and all the v0.6–v0.12 additions with one smaller language: 13 verbs, each on every memory type, and about 60 keywords. The engine works out how from what is asked.
One read
RECALL is the only read verb. SCAN, LOOKUP and LOAD are gone, and the engine picks the access path from the question:
| You write | The engine does |
|---|---|
RECALL FROM SEMANTIC WHERE key = "person:ada" | an exact lookup by key |
RECALL FROM SEMANTIC WHERE key = "org:acme" FOLLOW LINKS TYPE "works_at" | what is linked to a record |
RECALL FROM EPISODIC WHERE pod = "payments" ORDER BY created_at DESC LIMIT 10 | a filtered read |
RECALL FROM SEMANTIC LIKE $question CONFIDENCE 0.7 | similarity, by vector and words |
RECALL FROM PROCEDURAL LIKE "pod OOMKilled restart" | the best-matching procedures |
RECALL FROM TOOLS WHERE task = "bidding" LIMIT 3 | the tools ranked for a task |
RECALL FROM WORKING WINDOW LAST 30s | the session’s current state, newest first |
RECALL FROM ALL WHERE url = "example.com" | every memory type at once |
A key is no longer special syntax: KEY x = v is just WHERE x = v. Similarity is LIKE with text or a variable, and CONFIDENCE replaces both THRESHOLD and MIN_CONFIDENCE. “The top three by attention” is ordinary ORDER BY attention_weight DESC LIMIT 3.
Branches are namespaces
v0.11 added memory branches as a BRANCH "b" modifier on reads and writes. 0.13 drops the modifier and makes a branch what it really is: a namespace with a base. Three verbs work on namespaces:
BRANCH FROM "crm" INTO "crm-try" -- crm as it is now, nothing copied
BRANCH FROM "crm" INTO "crm-before-import" AS OF "2026-11-01T09:00:00Z"
FORK FROM "crm" INTO "crm-copy" -- a full, independent copy
MERGE FROM "crm-try" INTO "crm" -- the branch's changes into crm
MERGE FROM "crm" INTO "crm-try" -- crm's newer changes into the branch
MERGE FROM "crm-try" INTO "crm" PREFER SOURCE -- on conflicts, the branch wins
FORGET FROM ALL NAMESPACE "crm-try" -- drop the branch
BRANCHmakes a new namespace that reads through its base at a point in time, plus its own writes. Writes stay in the branch.FORKis a branch with a full copy. Later changes to the base, or dropping it, don’t reach the fork, but it remembers where it came from, so it can still be merged either way.MERGEapplies one side’s changes since the two parted to the other, in one write. When both changed the same record it fails and lists the conflicts, unlessPREFER SOURCEorPREFER TARGETsays which side wins. Merging the base into its branch is what “rebase” used to be.
Because a branch is just a namespace, everything else already works on it: reads, writes, links, subscriptions, and FORGET to drop it. This is the memory half of Agents as Repos, now in the language itself.
Aliases instead of entity merges
Two keys often turn out to name one thing: person:ada and person:ada-lovelace. v0.10 had MERGE ENTITY to fold one into the other. 0.13 does it with two ordinary statements:
UPDATE INTO SEMANTIC WHERE key = "person:ada" (aliases = ["person:ada-lovelace"]) NAMESPACE "crm";
FORGET FROM SEMANTIC WHERE key = "person:ada-lovelace" NAMESPACE "crm"
A record’s aliases are other keys for it. A read by an alias, a LINK naming one, and links stored to or from an alias all reach the survivor. Nothing is rewritten, so either order is safe, and a failure between the two statements leaves nothing half-done.
No facts, just records and links
Earlier versions had a separate kind of semantic memory for facts, with STORE INTO SEMANTIC FACT and VALID AT. In 0.13, a relationship is a LINK and a value is a field:
LINK FROM SEMANTIC WHERE key = "person:ada" INTO SEMANTIC WHERE key = "org:acme" TYPE "works_at"
UPDATE INTO SEMANTIC WHERE key = "person:ada" (age = 36)
UPDATE keeps the old version, so memory can still be read as it was, and a record’s versions listed:
RECALL FROM SEMANTIC WHERE key = "person:ada" AS OF "2026-10-01T00:00:00Z"
RECALL FROM SEMANTIC WHERE key = "person:ada" WITH HISTORY BETWEEN "2026-01-01T00:00:00Z" AND "2026-06-30T00:00:00Z"
LINK on a link that already exists sets its weight, so UPDATE LINK is gone too.
Name the namespace once
Every statement works in one namespace. Writing NAMESPACE "crm" on each one is noise, so 0.13 adds USE and scripts: statements separated by ; are one request, and a USE gives the statements after it a namespace when they don’t name their own.
USE "crm";
RECALL FROM SEMANTIC WHERE key = "person:ada";
STORE INTO EPISODIC (event = "called", customer = "person:ada");
RECALL FROM EPISODIC WHERE pod = "x" NAMESPACE "ops"
The last statement names "ops" itself, and its own NAMESPACE wins. A script’s answer is its last statement’s; a failing statement stops the script and is named by position. Over a connection that keeps state, such as MCP, the USE lasts for the session.
A read may also span namespaces, ranking their records together:
RECALL FROM SEMANTIC LIKE $q NAMESPACE ("crm", "kb") LIMIT 5
Writes, links and topics stay in one namespace.
Everything else that changed
| Before 0.13 | In 0.13 |
|---|---|
SCAN, LOOKUP, LOAD | RECALL |
KEY x = v | WHERE x = v |
PATTERN … THRESHOLD t, MIN_CONFIDENCE | LIKE "text" CONFIDENCE t |
LINK … TO … | LINK … INTO … |
MIN_WEIGHT, OUTBOUND, INBOUND, BOTH | WEIGHT (a minimum); links are read both ways |
TYPE IN ("a", "b") | TYPE ("a", "b") |
WINDOW TOP n BY f | ORDER BY f DESC LIMIT n |
AS OF 2d AGO | AS OF "<timestamp>" |
REFLECT … THEN STORE … | a PIPELINE whose last stage writes |
UPDATE LINK | LINK |
MERGE ENTITY | UPDATE … (aliases = […]) + FORGET |
STORE … FACT, VALID AT | links and fields |
WATCH, UNWATCH | SUBSCRIBE RECALL …, UNSUBSCRIBE |
ACK, DEBOUNCE, FROM OFFSET, KINDS | the server’s API and settings |
SCOPE private | shared | cluster | NAMESPACE and IN SCOPE |
BRANCH "b" modifier | BRANCH, FORK, MERGE on namespaces |
TIMEOUT on any statement | TIMEOUT on PIPELINE only |
The pattern is the same throughout: one way to say each thing, and delivery details (acknowledgements, offsets, re-run rates) moved out of the language into the server, where they belong.
REFLECT is the one that may surprise people who read Agent Memory Needs a Query Language. Consolidation is still there; it is just a pipeline that reads the experience and writes the lesson last:
PIPELINE learn
RECALL FROM EPISODIC WHERE incident_id = {current}
| RECALL FROM PROCEDURAL WHERE pattern_id = {matched}
| STORE INTO PROCEDURAL (pattern_id = "learned", steps = "step1, step2", confidence = 0.6)
What it means if you use AQL
0.13 is not compatible with earlier versions: statements change form. The v0.13 specification maps every old form to its new one in §9. The conformance suites were rewritten in 0.13: 34 suites and 406 tests, with new suites for branch, fork and merge, and for USE and namespaces.
AQL, Explained now follows 0.13. Open any verb there for every clause, with an example that parses with the 0.13 parser, as does every 0.13 example in this post.
Sources
- AQL on GitHub: the grammar (
grammar/aql.pest), the parser and the conformance suites - AQL v0.13 specification
- Changelog