Deja · agent context layer · built on HydraDB

Your agent has 2,000 tools.
Load the ones it will actually call.

Deja remembers, in a HydraDB graph, which tools past tasks actually needed: each task and the tools it used, which words led to which tools, and which tools get used together. A new task pulls the tools its most similar past tasks used; that memory is what beats tool search. Every task it serves makes the next loadout sharper. It learns only from tool calls that worked, says so when nothing in the catalog fits, and reads the live tool catalog from the graph, so a removed tool never comes back.

Gets sharper the more it is used

Share of tasks where every tool the agent ended up calling was already in its first loadout (2,000-token budget). Prequential: each task is scored before Deja learns from it. Buckets are log-spaced so the cold start is visible; band = 3 shuffles of the stream.

What does the work

This ablation learns from and scores every called tool. (The served model learns only from calls that worked; see the next section.) Memory of past tasks does most of the lifting. Deja keeps it in HydraDB as (:Task)-[:USED]->(:Tool): the 20 nearest past tasks to the task and to each of its steps vote for the tools they used. Votes only, that one-step lookup alone, already beats tool search by a wide margin. The full model adds two multi-step graph reads, a word hop and a co-use hop: about 0.5–1 point overall (shuffle 1: +0.8, 95% CI +0.5 to +1.2). In v4 the hops added 2.5 points; recalling each step of a task, which we gave the baseline too, now finds much of what the word hop used to. So the rest of the graph's job isn't ranking. It keeps the memory, every call's outcome, the quarantine and the live catalog in one store that the server, the learner and every planner read and write together. That is why loadouts rarely carry a broken tool and a removed tool is never served.

All 8,612 tasks
Tasks that called tools on 2+ MCP servers (31%)

Same comparison at other token budgets (shuffle 1)

Learns only from calls that worked

12–15% of recorded tool calls returned an error (HTTP 4xx/5xx, missing API keys, crashes), and 21% of tasks contain a call that never succeeded. Counting those as "the tool this task needed" teaches Deja to recommend broken tools. The served model records each call's outcome as the edge type, (:Task)-[:USED]->(:Tool) for successes and (:Task)-[:FAILED]->(:Tool) for failures, and only successes vote. Scored on the tools that worked, it's as good or slightly better, and loadouts carrying a chronically broken tool (fails in ≥ 80% of the ≥ 10 tasks that call it) drop by more than half. It no longer loads tools whose calls failed, so the "every called tool" number falls; both are shown. Mean of 3 shuffles.

Knows when nothing fits

Toucan has no "no suitable tool" tasks, so we built them: hold out whole clusters of near-duplicate servers (3 seeds, ~37 servers each) and keep their tasks, but only where no remaining tool resembles any tool the task needed (a hand-checked substitute threshold). The abstain rule was fit on seed 1 and tested on seeds 2 and 3. Honest result: the signal is how close the nearest past task is. The graph signals we tried (vote agreement, server spread, co-use coherence) added nothing. What does help is remembering the tasks it couldn't serve: mostly when the same missing capability is asked for again, less for a brand-new gap. That needs a signal that a task went unserved, which the live demo doesn't have, so the page's abstain rule is the similarity one.

Tools come and go

The catalog itself is graph state: (:Catalog)-[:LISTS]->(:Tool). When a server drops a tool from tools/list, Deja deletes one edge, bumps the catalog's version so the server re-reads it, and every read stops returning that tool, whatever memory says.

Try it

Pick one of 200 tasks Deja never learned from (green = a tool that worked in the recorded run, red border = called but failed), click an example, or type your own. Left: Deja's loadout from HydraDB. Right: plain tool search, same budget.

The catalog is 2,236 tools from 367 community MCP servers: weather and time, calculators, Word documents, memory and note stores, image generation, research search (PubMed, Semantic Scholar, arXiv), Unity, Figma, games and trivia. No GitHub-issues or Slack servers, so tasks about those won't find much.

Use it with your agent

proxy.py is an MCP server in front of your real MCP servers. Your agent gets two tools: deja_load_tools(task) returns the loadout for the task, and deja_call(tool, arguments) forwards the call. Deja learns from the real calls into HydraDB: tools whose calls worked get USED edges, ones that only failed get FAILED and count toward quarantine, and the catalog is re-read from every server's tools/list at the start of each task. Tested end to end over stdio (learning, quarantine, a dropped tool, a restart) and in front of real servers; no real agent traffic has gone through it yet. Setup is in the README.

How it works

(:Task) -[:USED]-> (:Tool)                                    every past task and the tools that worked for it
(:Task) -[:FAILED]-> (:Tool)                                  calls that errored (recorded, never vote)
(:Catalog) -[:LISTS]-> (:Tool)                                the live tool catalog
(:Term {df}) -[:LED]-> (:Link {n}) -[:TO]-> (:Tool {uses})    a word in past tasks → the tool that solved them
(:Tool) -[:CO]-> (:CoLink {n}) -[:TO]-> (:Tool)               tools used together in one task

With an agent in the loop

Under load

What we measured and threw away