Skip to content

docs: add MAI-1 agent contract to AGENTS.md (self-contained, no external URLs)#2817

Open
javierfajardo85-rgb wants to merge 1 commit into
mongodb:masterfrom
javierfajardo85-rgb:mai1-inline-contract
Open

docs: add MAI-1 agent contract to AGENTS.md (self-contained, no external URLs)#2817
javierfajardo85-rgb wants to merge 1 commit into
mongodb:masterfrom
javierfajardo85-rgb:mai1-inline-contract

Conversation

@javierfajardo85-rgb
Copy link
Copy Markdown

Following up after the earlier PR was closed.

The previous version referenced an external URL. This version is entirely self-contained: the MAI-1 contract block lives in this file, no external services are queried, and there are no automatic network calls.

What it adds: a machine-readable block that lets AI coding agents (Claude Code, GitHub Copilot, Cursor, Gemini CLI) discover how to install and invoke this library — without parsing the full README.

{
  "aid": "mongo-python-driver-v1",
  "logic":  { "input_schema": {...}, "output_schema": {...} },
  "trust":  { "reliability_score": 0.0 },
  "action": { "install_cmd": "...", "execute_cmd": "..." }
}

No build step, no dependency, no network call. Maintainers can edit it like any other docs. Feel free to close if it still doesn't fit.

@javierfajardo85-rgb javierfajardo85-rgb requested a review from a team as a code owner May 22, 2026 11:36
@aclark4life
Copy link
Copy Markdown
Contributor

@javierfajardo85-rgb Thanks! What is MAI-1 ?

@javierfajardo85-rgb
Copy link
Copy Markdown
Author

MAI-1 is a compact machine-readable contract that lives inside a repo (in AGENTS.md) so AI coding agents can discover and use a library without parsing the README or hallucinating the API.

It has four sections:

{
  "identity": { "aid": "pymongo-v1" },
  "logic":    { "input_schema": {...}, "output_schema": {...} },
  "trust":    { "reliability_score": 0.91, "latency_ms": 45 },
  "action":   { "install_cmd": "pip install pymongo", "execute_cmd": "from pymongo import MongoClient" }
}

When an agent needs to interact with MongoDB it can read this block directly — correct import, install command, expected input/output — instead of fetching docs or guessing. The contract lives in your repo, no external dependency.

Happy to answer any questions about the format.

@NoahStapp
Copy link
Copy Markdown
Contributor

Can you provide an example use case where this would be helpful @javierfajardo85-rgb? We haven't seen agents have issues with the basic usage of PyMongo that this appears to attempt to fix.

@javierfajardo85-rgb
Copy link
Copy Markdown
Author

The use case is AI coding agents in unfamiliar codebases.

When Claude Code or Copilot hits a project using PyMongo,
it reads AGENTS.md first. The MAI-1 block gives it correct
import, install command, and input/output schema instantly —
instead of parsing docs and hallucinating deprecated APIs
like pymongo.connect() instead of MongoClient().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants