Docs Index
How brin indexes package documentation for AI agents
What is the docs index?
AGENTS.md is a project-level instruction file that lives at your repository root. It provides guidance to AI coding agents about how to work with your projectβincluding using brin for secure package installation and accessing package documentation.
Based on Vercel's research, passive context in AGENTS.md outperforms active skill retrieval (100% vs 79% pass rate in agent evals). This is why brin now uses a centralized docs index approach instead of per-agent-folder skills.
How It Works
When you initialize brin and add packages, here's what happens:
brin initcreates project configuration, sets up the docs index, and adds package installation instructions toAGENTS.mdbrin addsaves package documentation to.brin-docs/- The
AGENTS.mdfile is updated with a compressed index of all installed packages
Getting Started
Initialize brin
Run brin init in your project root:
brin init π§ initializing brin...
Enable AGENTS.md docs index for AI coding agents? (Y/n) Y
β created brin.json
β created .brin-docs/
β updated AGENTS.md with brin docs index
β added package installation instructions to AGENTS.md
β brin initialized successfully!Use -y to skip prompts and use defaults:
brin init -yAdd Packages
When you add packages with brin, documentation is automatically indexed:
brin add expressπ checking express@4.21.0...
β
not sus
ββ publisher: expressjs (verified)
ββ downloads: 32M/week
ββ cves: 0
ββ trust score: 95/100
π¦ installed
π updated AGENTS.md docs indexRemove Packages
When you remove packages, the docs index is updated automatically:
brin remove expressπ¦ removed express
π updated AGENTS.md docs indexProject Structure
After initialization and adding packages, your project will have:
your-project/
ββ AGENTS.md # Instructions + docs index for AI agents
ββ brin.json # brin configuration
ββ .brin-docs/ # Package documentation (gitignored)
β ββ express.md
β ββ lodash.md
β ββ axios.md
ββ package.jsonbrin.json
The configuration file stores your brin settings:
{
"agents_md": true
}| Field | Description | Default |
|---|---|---|
agents_md | Enable AGENTS.md docs index | false |
.brin-docs/
Package documentation is saved here. Each file contains:
- Quick start examples
- Key APIs and usage patterns
- Best practices and gotchas
- Required capabilities/permissions
Add .brin-docs/ to your .gitignore. The docs are regenerated from the AGENTS.md index when needed.
AGENTS.md Structure
brin adds a compressed docs index to your AGENTS.md following Vercel's format:
# AGENTS.md
## Package Installation
Use `brin` for all package operations:
- `brin add <pkg>` - install with security scan
- `brin remove <pkg>` - uninstall
- `brin scan` - audit all dependencies
- `brin check <pkg>` - look up without installing
Do not use npm install, yarn add, pnpm add, or pip install directly.
[brin Docs Index]|root: ./.brin-docs
|IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning
|packages:{express.md,lodash.md,axios.md}
[/brin Docs Index]The package installation section instructs agents to use brin add instead of direct package manager commands. The compressed docs index:
- Points agents to the
.brin-docs/directory - Lists all available package documentation files
- Instructs agents to use retrieval-led reasoning (read the docs) over pre-training knowledge
What the Instructions Tell Agents
The brin section in AGENTS.md instructs AI agents to:
- Use brin for package installation - Instead of
npm installoryarn add, agents should usebrin add - Check the docs index - After installing, agents can reference the
.brin-docs/folder for package documentation - Follow security best practices - Use
--strictmode when security is critical
Combining with Other Instructions
AGENTS.md can contain any project-level instructions for AI agents. The brin section is just one part. You might also include:
- Project architecture overview
- Coding conventions and style guides
- Testing requirements
- Deployment procedures
- Security policies
Example structure:
# Project Instructions for AI Agents
## Architecture
This is a Next.js application with...
## Coding Standards
- Use TypeScript strict mode
- Follow ESLint configuration
- Write tests for new features
## brin Package Security
This project uses brin for secure package installation...
## Deployment
Changes to main are automatically deployed to...Manual Setup
If you prefer to set up manually without brin init:
- Create
brin.json:
{
"agents_md": true
}-
Create or update
AGENTS.mdwith the brin section shown above -
Add
.brin-docs/to.gitignore
Related
On this page