agentleFS
NVIDIAKnown publisherNVIDIA/xr-ai/AGENTS.md

xr-ai

AGENTS.md93 starsChanged 4 months agoApache-2.0View on GitHub

This file contains the repository-wide constraints for humans and agents. Read the nearest package or sample README for its entry point and canonical-doc links. User-facing docs live only under docs/source/. Building an application? Read docs/source/guides/building-your-app.md. - One hub serves many clients and agents. It fans inbound messages to subscribed ProcessorEndpoints and routes return traffic only to the originating client. - Agents communicate with the hub through xr_ai_hub IPC. LiveKit is internal to the hub and must not appear in agent…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository5 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    All model HTTP goes through the typed services and factories in xr_ai_models.

    line 42
  2. Very specific:

    When preparing a repository sample, refer to Adding a sample and the simple-vlm-example reference.

    line 104
  3. Very specific:

    After changing a pyproject.toml outside apps/, run uv run --script .github/scripts/generate_dependency_map.py.

    line 120
  4. Very specific:

    Do not hand-edit the generated section in DEPENDENCIES.md.

    line 123
  5. Very specific:

    Never put API keys or tokens in source files.

    line 140
  6. Distinctive:

    Do not add an abstraction until two concrete use cases need it.

    line 142
  7. Very specific:

    When a sample's behavior is driven by an LLM prompt, changing a rule in its system.txt requires a corresponding eval case.

    line 143
  8. Distinctive:

    Follow the authoritative documentation style for customer-facing Markdown and reStructuredText.

    line 159
  9. Very specific:

    When documentation exists in both locations, consolidate it into docs/source/ and replace the README copy with a link.

    line 180
  10. Distinctive:

    Use these canonical references when working in their area:

    line 187

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md
<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 -->

xr-ai working contract

This file contains the repository-wide constraints for humans and agents. Read the nearest package or sample README for its entry point and canonical-doc links. User-facing docs live only under docs/source/.

Building an application? Read docs/source/guides/building-your-app.md.

Repository map

client-samples/  Platform clients
agent-sdk/       Agent runtime, hub IPC, model, tool, and voice libraries
agent-samples/   Runnable agent stacks
model-server-samples/  Shared model-server launch samples
apps/            Application workspaces outside repository sample tooling
services/        Hub, model servers, and typed capability services
utils/           Launcher, logging, VAD, vLLM, and voice-gate utilities
tests/           Cross-package and integration tests
docs/source/     User and contributor documentation
third_party_licenses/  Unmodified third-party license and attribution texts
skills/          Skill bank that sets coding agents up

Architecture boundaries

  • One hub serves many clients and agents. It fans inbound messages to subscribed ProcessorEndpoints and routes return traffic only to the originating client.
  • Agents communicate with the hub through xr_ai_hub IPC. LiveKit is internal to the hub and must not appear in agent APIs.
  • The hub owns client readiness. Agents report only their own _agent.status. Readiness participation is opt-in with announces_readiness=True, applies only to subscribed participants, and must never be published directly by a worker.
  • agent-sdk/xr-ai-hub/ depends only on pyzmq and msgpack.
  • All model HTTP goes through the typed services and factories in xr_ai_models. Do not add vendor SDKs or hand-written model HTTP clients to workers or services. One scoped exception: Riva speech NIMs expose only gRPC, so the optional riva extra adds nvidia-riva-client behind kind: riva_grpc, with the import deferred into make_stt/make_tts; the base install stays httpx-only.
  • Workers never import device_io_hub or xr_ai_launcher. Use public SDK packages and task-specific libraries.
  • Tools are native, in-process Tool or AsyncTool instances from xr_ai_tools. Every execution passes through NeMo Relay. The repository does not ship MCP compatibility servers.
  • Agents call another agent's tools directly with execute() or stream(). xr_ai_runtime provides typed publish/fan-out and owns only its delivery tasks. Agents own their state, resources, lifecycle, background tasks, and concurrency policy.
  • Application-specific capabilities stay with their application. Shared process boundaries use typed msgpack over ZMQ services, not MCP.
  • Image selection and visual inference are separate tools. Selection returns lightweight image references; single-image, multi-image, and timestamped video-frame query tools resolve them through VLMService. Raw media remains on the hub path and out of tool results. Latest recorded windows need only a duration; historical frame and video selection share an absolute start_us.

The authoritative dependency graph and enforced package limits are in DEPENDENCIES.md.

Process and sample layout

Each agent sample contains a stdlib-style orchestrator and a separately packaged worker. Optional application-specific capability processes sit beside them.

agent-samples/<kebab-name>/
  main.py
  pyproject.toml
  README.md
  yaml/
  worker/
    pyproject.toml
    <snake_name>_worker/
      __init__.py
      __main__.py

Applications that are not repository samples use the same internal layout under apps/<kebab-name>/. Repository dependency, lint, SPDX, sample catalog, and test discovery exclude that top-level directory.

  • Orchestrators depend on xr-ai-launcher, declare PROCESSES, and call run_stack.
  • Stack items start in declaration order; members of a Parallel item start concurrently. The launcher waits for each item to signal ready, and fails the stack if any process exits.
  • device_io_hub always runs as its own process.
  • Raw IPC workers keep hub addresses as module constants, use async callbacks, cancel tasks before ProcessorEndpoint.stop() and .close(), and move CPU-bound work to an executor.
  • Voice workers delegate readiness, signals, pipeline cancellation, and cleanup to VoiceAgent; its media session is private.
  • New worker code is a named package with relative internal imports and an explicit __main__.py.

When preparing a repository sample, refer to Adding a sample and the simple-vlm-example reference.

Change contract

  • Public Python API names, signatures, types, defaults, and field behavior live in __all__, declarations, and co-located docstrings; Sphinx generates their reference pages. Update narrative README or docs/source/ content only when concepts, workflows, operations, or architecture change. Breaking changes also require a migration entry.
  • Top-level sample commands and options live in their [project.scripts] and argparse declarations; Sphinx generates the user-facing CLI reference.
  • Sample configuration values and field guidance live in checked-in YAML/JSON and adjacent YAML comments. Files under a top-level sample's yaml/ tree or beside a direct capability subproject are generated into the config reference.
  • After changing a pyproject.toml outside apps/, run uv run --script .github/scripts/generate_dependency_map.py; the pre-commit hook normally regenerates the Python inventory automatically and CI rejects drift. Do not hand-edit the generated section in DEPENDENCIES.md. Regenerate the affected project's gitignored uv.lock locally to verify resolution.
  • The root uv.toml limits registry artifacts to the last dependency qualification timestamp. Advance it only in a dedicated dependency refresh, resolve every project's gitignored uv.lock with uv --config-file uv.toml lock --upgrade --project <directory> from the repository root, and run the full test suite. uv stops upward config discovery at a nearer [tool.uv] table; most nested projects define one through [tool.uv.sources], so pass the root config explicitly. Do not commit per-project lockfiles; the locks under dependency-manifest/ are the exception, and uv.lock there is produced by uv run --script .github/scripts/generate_dependency_manifest.py (pre-commit runs it when uv.toml is staged). Regenerate dependency-manifest/ for a uv.toml qualification refresh or a targeted dependency security refresh, and commit the generated project and lock in the same change. Do not regenerate it for ordinary dependency or project changes, even when a new project is missing from it.
  • Never put API keys or tokens in source files. Use environment variables or the credential store documented in docs/source/getting_started/credentials.md.
  • Do not add an abstraction until two concrete use cases need it.
  • When a sample's behavior is driven by an LLM prompt, changing a rule in its system.txt requires a corresponding eval case. Do not reuse worked-example specifics in the eval fixture.
  • New source files outside apps/ need the repository SPDX header. File-type rules and exceptions are in SPDX headers.
  • Preserve unrelated work in a dirty tree. Never use destructive Git commands to discard user changes.

Comments and documentation

Comments explain a non-obvious invariant or failure mode. Do not narrate the code, debugging history, rejected alternatives, or plans. Keep architectural docs about the current system; issue trackers and Git history hold proposals and past decisions.

Follow the authoritative documentation style for customer-facing Markdown and reStructuredText. Match the surrounding document and keep edits scoped.

docs/source/ is the canonical home for user-facing concepts, architecture, workflows, operations, troubleshooting, and reference material. Do not duplicate that content in a README. A README is a concise repository entry point: state what the directory contains, link to the canonical documentation, and keep only the minimum local information needed before following that link. A top-level sample README under agent-samples/ or model-server-samples/ additionally keeps the exact commands needed to start that sample. State the sample directory as the working directory and write every command relative to it, including commands that invoke another sample such as ../../model-server-samples/model-servers from an agent sample. It also includes a compact configuration entry point: name the sample-owned YAML or JSON files, describe the common settings they own, and show one representative edit. Put exhaustive field descriptions, precedence, path resolution, architecture, behavior, artifact contracts, extension instructions, and eval methodology in the sample's docs/source/ guide. Nested READMEs may contain only artifact-local instructions that are not useful in the published documentation.

When documentation exists in both locations, consolidate it into docs/source/ and replace the README copy with a link. When moving README content, preserve any still-valid operational detail in the destination page; do not delete unique guidance merely to shorten the README. Package API details remain in declarations and co-located docstrings and are rendered into the generated Python reference rather than repeated in either narrative location.

Use these canonical references when working in their area:

TopicDocument
Architecturedocs/source/overview/architecture.md
Processesdocs/source/components/launcher-and-process-model.md
Agent SDKdocs/source/components/agent-sdk.md
AI servicesdocs/source/components/ai-services.md
Credentialsdocs/source/getting_started/credentials.md
Networkingdocs/source/getting_started/networking.md
Testingdocs/source/guides/testing.md
Documentation styledocs/source/guides/documentation-style.md
Troubleshootingdocs/source/guides/troubleshooting.md
xr-render-demodocs/source/reference/xr-render-demo.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.