How a job gets its context
Appendix. Background reading on how Operation Kit is built. You don't need it to install or use Operation Kit; start with the main docs.
What a job is told when it starts, in what order, and why Operation Kit picks a small, ordered set of context instead of handing the model everything it has. For the practical side of the knowledge base, see How the knowledge base works.
On this page
The short version
- More text is not better text. A model does its best work with a short, well-ordered brief, not a dump of every file you own.
- Stable things first. A job reads its bot's instructions, your workspace notes and the card before anything that was searched for.
- It remembers the card's history. Earlier attempts, your corrections and the reviewer's findings are added for it, so it doesn't repeat a mistake.
- Search results are fenced off. Notes found in the knowledge base come from the card's own workspace and are marked as material to check, not orders to follow.
This page explains the design. To add, organize and search your company's knowledge, read How the knowledge base works and Workspaces.
The problem with handing a model everything
Every model can read only so much at once. That limit is called its context window. Your company's knowledge is much larger than any window, so something has to choose what goes in.
The easy answer is "as much as fits". It works worse than you would expect. Researchers at Stanford measured it: when the useful fact sits in the middle of a long prompt, models find it far less often than when it sits near the start or the end (Liu et al., 2023, "Lost in the Middle"). Where a fact sits matters almost as much as whether it is there.
Operation Kit's context design follows three rules from that finding:
What a job is told, in order
When a card starts, the server writes one prompt for the job. Some parts are copied in whole; for others, the prompt tells the job which file to read first. It goes from the most general instructions to the most specific, so a later, narrower note can refine a broader one without contradicting it. Think of it as layers:
| Layer | What it holds | Where it comes from |
|---|---|---|
| The bot | The bot's role, how it works, what it won't do. Copied into the prompt first, so the job starts already in role. | The bot's file, for example agents/<name>.md |
| Working rules | Operation Kit's own rules for every job: show evidence before claiming progress, write the deliverable early, run the checks before saying "done". | Built into the server |
| The workspace | Business context for this workspace: how the team works, active projects, conventions. Plus, if you wrote one, a note that adjusts this bot for this workspace. The prompt points the job to these files. | workspaces/<workspace>/context.md and workspaces/<workspace>/agent-profiles/<bot>.md |
| The person | Who the job is working for, and that person's preferences (tone, defaults, areas they own, when to escalate), if they have a profile. | users/<username>/profile.md |
| The card | The title and description, attached files, an approved plan if there was one, and the checklist a reviewer will grade against. | The card on the board |
| Related work | A short, auto-assembled summary of what happened before (next table). | Built fresh each time the job starts |
The same bot can therefore behave differently for Fernleaf Garden Supply's retail workspace and its wholesale workspace, or for the owner and for a new hire, without anyone copying the bot.
The last layer is assembled by the server from what it already knows about the card and its neighbours. Each part is left out when there is nothing to say. Its headings in the prompt are internal names; in plain words:
| Part | What it tells the job |
|---|---|
| Previous runs on this card | A summary and outcome of up to the last three runs, with their open follow-ups and blockers. |
| Human corrections | Mistakes a person flagged with Flag mistake on this card, or on other cards for the same bot in the same workspace. Marked high priority. |
| Knowledge gaps | "This is a fresh card", "the last run failed", a blocker that came back in two or more runs, or a follow-up that was never acted on. |
| Related decisions and blockers | Recent decisions and open blockers from other cards in the same workspace or for the same bot. |
| Recently changed files | Files other jobs changed in the last 24 hours, so two jobs don't trip over the same file. |
| Knowledge base results | Up to five short snippets from the card's own workspace in the knowledge base, fenced as untrusted (see below). |
| Recurring failure modes | Lessons learned from problems that came up on at least three different cards in the last 30 days, up to five. |
The order is deliberate: the stable layers you wrote come first, and the searched-for material comes last, where it can inform the job without outranking a written instruction.
Four kinds of memory
Research on AI agents separates memory into what the model can see right now, what it can look up, and what it learned in training (Park et al., 2023; Sumers et al., 2024). Operation Kit keeps each kind in its own place:
Working memory
The card's notes
Each card has a folder with two files. NOTES.md is the job's scratch pad. ARTIFACT.md is the record of what it delivered and the evidence. Both outlast a restart, and the next run on the card reads them.
Long-term memory
The knowledge base
Your company's notes, decisions, imported files and calls, as plain markdown files, one folder per workspace. Jobs and bots read it; what they learn can be saved back.
How-to memory
Skills
Written procedures with a clear "done" test, for example "chase overdue invoices". A bot uses the skills listed for it. Skills are named, not searched for.
Facts about services
Tools
How to reach one outside service: its address, the secret it needs (by name only) and its known quirks. Rewritten when you change provider, not when your process changes.
MemGPT (Packer et al., 2023) compared the context window to a computer's working memory, with a larger store on disk that is paged in when needed. Operation Kit does a simpler version of this: the knowledge base and the card's notes stay on disk, and the server decides which small part of them a job sees when it starts. More on tools and skills in The tools and skills layers.
Written edges versus search
The common way to ground a model in your documents is retrieval-augmented generation (RAG): search the documents for text that looks like the question and paste the top results into the prompt (Lewis et al., 2020). It is strong when you have a large pile of mixed documents and don't know which one holds the answer.
Operation Kit uses search for one part of the prompt only. Everything else is put together from things that are written down: the bot named on the card, the skills its file lists, the workspace the card belongs to.
| Search (RAG) | Written edges | |
|---|---|---|
| How something is picked | It looks similar to the question | A file says so: the card names the bot, the bot lists its skills, the skill lists its tools |
| When it goes wrong | Quietly: a close-but-wrong document wins | Loudly: a skill that names a missing tool fails a check |
| Freshness | Depends on when the index was rebuilt | The file is the source |
| Can you tell why it is there? | Hard to say | Yes, every item has a written reason |
The trade-off is recall against precision. Search finds more in a big pile; written edges are more reliable in a curated set. For "which procedures and services does this bot have", reliability wins, so those are written down.
The knowledge base results are the one place search runs, and they are built for safety in two ways. They come only from the card's own workspace, never from another one. And they are fenced in the prompt as untrusted content, because a card's title decides what is searched for and anyone who can write a note controls what comes back. A job treats those snippets as material to check, not instructions.
Keeping the references honest
A bot acts on what is in its prompt. If its file lists a skill that was renamed, or a skill names a tool that was removed, the bot will confidently try to use something that isn't there. Because the links between bots, skills and tools are written down, a program can check them before a job ever starts. How that check works is in The tools and skills layers.
Feedback goes into the next prompt
Context is also what comes back after a job. Reflexion (Shinn et al., 2023) showed that an agent improves when a written critique of its last attempt is put in front of its next attempt, with no retraining.
Operation Kit does this automatically. When the independent AI reviewer fails a card, its findings are added to the next run's prompt under their own heading, and the card goes back to work. The job doesn't need to remember what went wrong: the server makes sure it sees it. The same is true of your own corrections, as described above. How the reviewer works and why it is kept separate is in Why the board works this way.
References
Published research behind the choices above.
- Lost in the Middle: How Language Models Use Long Contexts. Liu et al., 2023, TACL. Why position in the prompt matters, and why stable instructions come first.
- Generative Agents: Interactive Simulacra of Human Behavior. Park et al., 2023, UIST. The split between what an agent sees now and what it can look up.
- MemGPT: Towards LLMs as Operating Systems. Packer et al., 2023. The context window as working memory, with a larger store paged in.
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Lewis et al., 2020, NeurIPS. The search-based approach Operation Kit uses for one part of the prompt only.
- Reflexion: Language Agents with Verbal Reinforcement Learning. Shinn et al., 2023, NeurIPS. Written feedback in the next prompt beats a blind retry.
- Cognitive Architectures for Language Agents. Sumers et al., 2024, TMLR. Facts, procedures and decisions as separate kinds of memory.
- A Survey on Large Language Model based Autonomous Agents. Wang et al., 2024, Frontiers of Computer Science. Evidence that agents with lasting outside memory do better on multi-step work.
f504a64), 11 Nov 2026Suggest an edit