# AI and memory

> AI settings, classifier guidance, memory, the sandbox and compliance research.

MCP toolset: `ai` (https://app.getoatmilk.com/api/mcp?toolset=ai)

## agents

- [`agents.overview`](https://app.getoatmilk.com/docs/api/agents.overview.md) — List the platform's agents (Autopilot, receipt reader, matcher, mail router, inbox scanner, bank sync and others) with what each checks for, its triggers, schedule, models and safeguards, and its live status: running now with the current step, needs attention, scheduled with the next run, or idle, plus the last run and the 24-hour run count, success rate and median duration. Follow a run with runs.get.

## agents.playground

- [`agents.playground.match`](https://app.getoatmilk.com/docs/api/agents.playground.match.md) — Dry run of the receipt matcher for one receipt entry (entryId): return the shortlisted bank and card candidates in ranked order and the matcher's judgement with the organization's saved model and thresholds. Nothing is saved or matched.

- [`agents.playground.receipt`](https://app.getoatmilk.com/docs/api/agents.playground.receipt.md) — Dry run of the receipt reader: read a sample receipt (filename, mimeType, contentBase64 of up to 2 MB; JPEG, PNG, WebP, HEIC, PDF or .eml) the same way intake does and return the extracted facts and validation flags. Nothing is saved: no submission, evidence, entry or run.

## ai.keys

- [`ai.keys.get`](https://app.getoatmilk.com/docs/api/ai.keys.get.md) — Which AI providers this organization brought its own keys for (TypeSafe, Vercel AI Gateway, OpenAI, Google Gemini, Z.ai), each with the key's last four characters and when it was checked, never the key itself; whether Oatmilk's own AI credits are on for it; and whether its keys cover decisions (categorizing, matching, sorting) and reading documents.

- [`ai.keys.remove`](https://app.getoatmilk.com/docs/api/ai.keys.remove.md) — Remove this organization's key for one AI provider, at the current revision. Features that need it ask for a key again unless Oatmilk's AI credits are on. Administrators only, from the dashboard.

- [`ai.keys.save`](https://app.getoatmilk.com/docs/api/ai.keys.save.md) — Save or replace this organization's key for one AI provider, at the current revision (0 for the first key). Oatmilk checks the key with the provider first and saves it encrypted. Administrators only, from the dashboard.

## ai.models

- [`ai.models.list`](https://app.getoatmilk.com/docs/api/ai.models.list.md) — List the decision models the receipt-matching and mail-routing classifiers can run on: AI Gateway's live list of evaluation models (id, name, provider, description, context window, input price per million tokens, whether the provider trains on the data, and whether Oatmilk has tested it), or the install's own model server when it runs local models. Falls back to Oatmilk's tested models when the gateway can't be reached. A model Oatmilk hasn't tested must pass ai.sandbox.evaluate before it is saved.

## ai.sandbox

- [`ai.sandbox.evaluate`](https://app.getoatmilk.com/docs/api/ai.sandbox.evaluate.md) — Evaluate a supplied fixture against saved or draft automation settings without writing anything. kind routing classifies an email fixture; kind matching scores a receipt against bank candidates; kind document reads a real file exactly as the inbox does (file {filename, mimeType, contentBase64}, up to 2 MB: a receipt, invoice or statement as a PDF, image, office or text document, or an original .eml email, which is classified first): every page is turned into images with logos and signature graphics set aside, read twice with vision and settled by the stronger model when the readings disagree, and checked as the books would take it. It returns the classifier answer, the facts, the vision check, the entry or flags for each document, and the parts read. kind record reads a kept-record file (file as for document, recordKind tax_document, company_document or other) exactly as Tax › Records reads one, with the same pages, model, prompt and schema, and returns its fields, warnings, model, prompt version and parts; for a company record also describesCompany, wouldFill (filled, nothing_new, other_company or needs_admin) and the profile fields it fills or differs on. kind email runs the email-sorting classifier on an email already in the company inbox (messageId), rebuilt from what was stored when it arrived, and returns the new decision with what was decided at the time (example.stored). kind receipt runs the matcher on a receipt entry (entryId) against its current bank and card candidates (draft may also set autoApply). Both accept the same draft model and thresholds as routing and matching. Nothing is saved. Use it to test the pipeline without the dashboard, and to test custom models before saving them.

## ai.settings

- [`ai.settings.get`](https://app.getoatmilk.com/docs/api/ai.settings.get.md) — Read the organization's effective matching and routing automation settings, including models, thresholds, and revision.

- [`ai.settings.update`](https://app.getoatmilk.com/docs/api/ai.settings.update.md) — Revise matching and routing models, thresholds, and automatic matching with revision and idempotency checks. Changes apply to future evaluations only; stored decisions keep their recorded provenance.

## chiefOfStaff.channels

- [`chiefOfStaff.channels.update`](https://app.getoatmilk.com/docs/api/chiefOfStaff.channels.update.md) — Set rules for one Discord channel and its threads: how the Chief of Staff replies there (or that it stays out), its profile, tools turned on or off, and instructions. Pass reset to clear the channel's rules. Pass the channel's revision as expectedRevision (0 the first time). Only the platform owner's workspace has a Chief of Staff. Administrator access required.

## chiefOfStaff.general

- [`chiefOfStaff.general.update`](https://app.getoatmilk.com/docs/api/chiefOfStaff.general.update.md) — Change the Chief of Staff's settings that apply everywhere: pause it, turn direct messages on or off, turn tools off everywhere, or replace the list of people it never replies to. Takes effect on its next message. Pass expectedRevision from chiefOfStaff.settings.get. Only the platform owner's workspace has a Chief of Staff. Administrator access required.

## chiefOfStaff.people

- [`chiefOfStaff.people.find`](https://app.getoatmilk.com/docs/api/chiefOfStaff.people.find.md) — Find people in the Chief of Staff's Discord server by Discord id or part of their name, to add them to a rule or the ignored list. Only the platform owner's workspace has a Chief of Staff. Finance access required.

## chiefOfStaff.rules

- [`chiefOfStaff.rules.delete`](https://app.getoatmilk.com/docs/api/chiefOfStaff.rules.delete.md) — Remove a rule for people. Pass its revision as expectedRevision. History can put it back. Only the platform owner's workspace has a Chief of Staff. Administrator access required.

- [`chiefOfStaff.rules.save`](https://app.getoatmilk.com/docs/api/chiefOfStaff.rules.save.md) — Add or change a rule for some people: by Discord person or role, optionally only in some channels, give them tools, take tools away, answer them with a profile, or add instructions. A tool turned off anywhere else stays off. Pass id and expectedRevision to change a rule. Only the platform owner's workspace has a Chief of Staff. Administrator access required.

## chiefOfStaff.schedules

- [`chiefOfStaff.schedules.update`](https://app.getoatmilk.com/docs/api/chiefOfStaff.schedules.update.md) — Pause or resume one of the Chief of Staff's scheduled posts. A paused post skips its turns and resumes at its next one, without catching up. Only the platform owner's workspace has a Chief of Staff. Administrator access required.

## chiefOfStaff.servers

- [`chiefOfStaff.servers.list`](https://app.getoatmilk.com/docs/api/chiefOfStaff.servers.list.md) — List the Discord servers the Chief of Staff can see, with each connected server's channels (grouped by category) and roles, read live from Discord. Pass refresh to skip the one-minute cache. Only the platform owner's workspace has a Chief of Staff. Finance access required.

- [`chiefOfStaff.servers.update`](https://app.getoatmilk.com/docs/api/chiefOfStaff.servers.update.md) — Change how the Chief of Staff behaves in one Discord server: turn it on or off there, choose how it replies in channels that don't say otherwise, a default profile, and instructions for the whole server. Pass the server's revision as expectedRevision (0 the first time). Only the platform owner's workspace has a Chief of Staff. Administrator access required.

## chiefOfStaff.settings

- [`chiefOfStaff.settings.get`](https://app.getoatmilk.com/docs/api/chiefOfStaff.settings.get.md) — Read every Chief of Staff setting with its revision: whether it is paused, direct messages, tools turned off everywhere, ignored people, each Discord server's and channel's rules (who it answers, profile, tools and instructions), rules for people and roles, and paused scheduled posts. Only the platform owner's workspace has a Chief of Staff. Finance access required.

## chiefOfStaff

- [`chiefOfStaff.status`](https://app.getoatmilk.com/docs/api/chiefOfStaff.status.md) — Read how the Chief of Staff (the Oatmilk agent in Discord) is set up: the Discord server it serves, whether its Gateway and scheduled posts run on this deployment, its recent activity, which integrations are connected, its profiles and their tools, the channel names that pick a profile, and its scheduled posts. Only the platform owner's workspace has a Chief of Staff. Finance access required.

## classifier.mailboxes

- [`classifier.mailboxes.list`](https://app.getoatmilk.com/docs/api/classifier.mailboxes.list.md) — List organization email types, receiving addresses, and classifier guidance.

- [`classifier.mailboxes.save`](https://app.getoatmilk.com/docs/api/classifier.mailboxes.save.md) — Create a receiving email type or revise its routing and category classifier guidance with revision and idempotency checks. Credential screening and human review remain mandatory.

## complianceLibrary.entries

- [`complianceLibrary.entries.create`](https://app.getoatmilk.com/docs/api/complianceLibrary.entries.create.md) — Platform administrators only: write a new compliance library entry (title, topic, and optional summary, keyPoints, meaning and markdown notes). A person's entry is protected: an agent's later change to it is proposed, never applied.

- [`complianceLibrary.entries.update`](https://app.getoatmilk.com/docs/api/complianceLibrary.entries.update.md) — Platform administrators only: edit a compliance library entry's title, topic, summary, keyPoints, meaning or markdown notes at its current revision, archive or restore it (archived), or mark it looked at (resolved). Editing protects the entry from agent overwrites.

## complianceLibrary.files

- [`complianceLibrary.files.confirm`](https://app.getoatmilk.com/docs/api/complianceLibrary.files.confirm.md) — Platform administrators only: confirm an uploaded library file. Oatmilk checks its size, hash and type, then an agent reads it as untrusted data, summarises it, links it to the right entry or suggests a new one, and flags entries it may affect.

- [`complianceLibrary.files.prepare`](https://app.getoatmilk.com/docs/api/complianceLibrary.files.prepare.md) — Platform administrators only: prepare a private upload of a PDF, Word document, text file or picture (up to 25 MB) for the library. Returns a signed uploadUrl; then call complianceLibrary.files.confirm.

## complianceLibrary

- [`complianceLibrary.get`](https://app.getoatmilk.com/docs/api/complianceLibrary.get.md) — One compliance library guide by id or slug with its official sources and check dates and its history. The platform's administrators also see the changes waiting for a person and the links and files added to it.

- [`complianceLibrary.list`](https://app.getoatmilk.com/docs/api/complianceLibrary.list.md) — The compliance library Oatmilk keeps for every organization: guides by topic on hiring, contractors, agreements, employment standards, payroll, privacy and taxes, each with its plain-words summary, key points, what it means for a company, status (Current, Needs a look or Out of date) and when its official sources were last checked. editable says whether this member keeps the library; only the platform's administrators also see what was recently added and suggested new entries.

## complianceLibrary.inputs

- [`complianceLibrary.inputs.addUrl`](https://app.getoatmilk.com/docs/api/complianceLibrary.inputs.addUrl.md) — Platform administrators only: add an official government page to the library. An agent reads it, links it to the right entry or updates it with the page as its source. Pages that are not on an official government host are refused. The page is untrusted data.

- [`complianceLibrary.inputs.retry`](https://app.getoatmilk.com/docs/api/complianceLibrary.inputs.retry.md) — Platform administrators only: read again a link or file that failed to be read.

## complianceLibrary.proposals

- [`complianceLibrary.proposals.decide`](https://app.getoatmilk.com/docs/api/complianceLibrary.proposals.decide.md) — Platform administrators only: accept or dismiss a change an agent proposed to an entry a person edited, or a suggested new entry from an uploaded document. Accepting applies the before-and-after shown and its official sources.

## compliancePortal

- [`compliancePortal.overview`](https://app.getoatmilk.com/docs/api/compliancePortal.overview.md) — The compliance portal's home for this member: topics with how many library guides each has, recently updated guides, rules from official sources coming into force soon, what waits for a decision (this organization's regulation updates for administrators; for the platform's administrators also changes only an Oatmilk update can follow and library changes), and the search index. platformAdmin says whether this member runs research for the platform.

- [`compliancePortal.search`](https://app.getoatmilk.com/docs/api/compliancePortal.search.md) — Search the compliance portal in plain words: library guides, rules from official sources, decisions waiting for this member and topics. Word matching shortlists candidates and a fast classifier (Jev) ranks what the person means. Optional kinds (entry, rule, item, topic) narrows it, limit up to 20. Each hit has its kind, title, the passage that matched and how relevant the classifier judged it.

## complianceResearch.chat

- [`complianceResearch.chat.ask`](https://app.getoatmilk.com/docs/api/complianceResearch.chat.ask.md) — Platform administrators only: ask the research agent about official tax sources, look up recent changes, or explicitly start the full compliance research flow. Ad-hoc answers do not change organization settings or tax calculations.

- [`complianceResearch.chat.history`](https://app.getoatmilk.com/docs/api/complianceResearch.chat.history.md) — Platform administrators only: read your own recent compliance research conversation and cited official sources.

## complianceResearch.findings

- [`complianceResearch.findings.update`](https://app.getoatmilk.com/docs/api/complianceResearch.findings.update.md) — Platform administrators only: mark a finding (usually a platform notice) acknowledged, done or dismissed.

## complianceResearch

- [`complianceResearch.overview`](https://app.getoatmilk.com/docs/api/complianceResearch.overview.md) — Platform administrators only (the platform's own organization): the compliance research agent's schedule, official sources, memory of verified facts with their effective dates and sources, and findings, each an organization suggestion or a platform notice with its status and how organizations decided.

- [`complianceResearch.run`](https://app.getoatmilk.com/docs/api/complianceResearch.run.md) — Platform administrators only: start a compliance research run now. It reads the official sources, remembers new facts, suggests setting changes to the organizations they apply to and tells platform administrators about changes only code can make. Returns the runId to follow with runs.get.

## complianceResearch.settings

- [`complianceResearch.settings.update`](https://app.getoatmilk.com/docs/api/complianceResearch.settings.update.md) — Platform administrators only: turn scheduled compliance research on or off (enabled) and set how often it runs (intervalDays, 7 to 365; 30 by default).

## complianceResearch.sources

- [`complianceResearch.sources.add`](https://app.getoatmilk.com/docs/api/complianceResearch.sources.add.md) — Add an https page on an official Canadian or U.S. federal, provincial, state or territorial government host, a label and its jurisdiction (CA, US, CA-ON or US-TX style). Facts found on an organization's own source are suggested to that organization only.

- [`complianceResearch.sources.remove`](https://app.getoatmilk.com/docs/api/complianceResearch.sources.remove.md) — Stop reading one of this organization's compliance research sources.

## complianceResearch.suggestions

- [`complianceResearch.suggestions.decide`](https://app.getoatmilk.com/docs/api/complianceResearch.suggestions.decide.md) — Decide a regulation update: accept applies it through the usual audited action (autopilot.settings.update, categories.addRecommended and categories.update, or tax.gifi.update); decline or keep leaves the setting as it is.

- [`complianceResearch.suggestions.list`](https://app.getoatmilk.com/docs/api/complianceResearch.suggestions.list.md) — Regulation updates for this organization: open suggestions to change a setting (receipt minimum, recommended category, GIFI line), each with the current and suggested value, whether a person set the current value, and its official source, plus recent decisions and this organization's own sources.

## memory

- [`memory.list`](https://app.getoatmilk.com/docs/api/memory.list.md) — List organization-wide remembered facts that guide future classification.

- [`memory.save`](https://app.getoatmilk.com/docs/api/memory.save.md) — Create or revise an organization-wide remembered fact with revision and idempotency checks. Applies to future classification only.
