Authoring¶
Notes are plain Markdown files you can write in any editor and version in Git. Brain Framework adds three light conventions on top: YAML frontmatter for metadata, optional heading anchors for surgical reads, and links that tie decisions back to evidence.
Organizing notes¶
By default, notes live in three folders declared under notes: in bf.yaml:
| Folder | Best for | Examples |
|---|---|---|
concepts/ |
Durable knowledge, conventions, and standards | concepts/architecture.md, concepts/style-guide.md |
projects/ |
Ongoing initiatives, goals, and key decisions | projects/launch.md, projects/q4-migration.md |
actions/ |
Scoped requests, reviews, and deliverables | actions/security-audit.md, actions/launch-checklist/index.md |
Flat files vs folder bundles¶
Start with a flat file (projects/launch.md). When a note needs attachments, drafts, datasets, or helper scripts beside it, turn it into a folder bundle (actions/launch-checklist/index.md).
bf build compiles only index.md and leaves every sibling file and subdirectory untouched.
Keep dates out of filenames
Use clean semantic slugs (actions/launch-review.md) and put dates in frontmatter (created: 2026-11-15). Your links stay intact if work gets rescheduled.
Frontmatter and freshness¶
Start every note with a YAML frontmatter block:
---
type: concept
status: stable
created: 2026-11-10
updated: 2026-11-15
stale_after: 90d
tags: [agents, protocols]
links:
- bf:///concepts/welcome.md?rel=follows#conventions
description: Open standards governing agent protocols and tool integrations.
---
# Agentic AI Foundation
- Freshness tracking:
updated(orcreatedif omitted) and optionalstale_after(a duration like14dor90d, or an ISO date) drivebf review. A note becomes stale when a review window expires or when linked evidence has a newer timestamp. Setreview_aliases: falseon hub notes whoseentity:/aliases:should not trigger incomingnewer_evidencechecks (person:/actor:identity aliases are skipped automatically). - Custom metadata: Any extra frontmatter fields you add pass straight into the compiled JSONL record so you can filter or query them with
jqand DuckDB.
Reserved computed keys
Keys generated by bf build (id, ref, source, kind, text, headings, tasks, sha256, ingested_at) are rejected in frontmatter.
Section anchors and checklists¶
Add #id anchors to important headings so you or your coding agent can read one exact section even if you later rename the heading title. Standard Markdown checklists feed the open task count in bf review.
## Model Context Protocol {#mcp owner=platform}
Standard wire protocol for tools and context. See [Welcome](welcome.md#conventions){rel=follows}.
- [ ] Audit server permissions.
Separate anchor attributes with spaces ({#mcp owner=platform}), not ?. When a section grows past ~100 lines or ~8 KiB (such as a dense table or long activity log), subdivide it with ### {#id} subheadings or archive superseded entries so bf read --outline and #anchor reads stay sharp and token-efficient.
Connecting notes, records, and brains¶
Authored notes and ingested records share one unified link format. You can link across prose or frontmatter links::
| Target | Example in Markdown prose | Notes |
|---|---|---|
| Local note or section | [MCP](../concepts/aaif.md#mcp) |
Relative path, same-file #anchor, or bf:/// from the current brain root |
| Source record | [Issue 7](github-issues:7){rel=cites} |
Uses <source>:<id> from memories/ |
| Tracked file in this brain | [AGENTS](../AGENTS.md) or bf:///bf.yaml |
Non-private files outside logs/, memories/, and private dotfiles |
| Sibling brain | bf://team-brain/concepts/policy.md#retention |
Declare team-brain under brains: in bf.yaml |
| External URL | [OpenSpec](https://openspec.dev) |
Supports https://, http://, mailto:, urn: |
Attach relationship metadata in three interchangeable ways:
- In Markdown prose: put
{rel=cites}right after the closing parenthesis. - In YAML frontmatter
links:: append?rel=followsto the link URI, or use a{to, meta}object. - In sensor JSON records: emit
{to, meta}objects insidelinks.
Relationship metadata also controls bf review staleness tracking:
- Evidence links (
rel=cites,rel=depends-on,rel=follows, or unmarked):bf reviewflagsnewer_evidencewhenever a linked note or record has a newer timestamp. - Cross-navigation (
rel=related-to):bf query --links-toandbf checkstill index and validate the link, whilebf reviewskips it so routine navigation links do not cascadenewer_evidencestaleness.
Optional domain schemas¶
Every note and ingested record is always validated against the built-in record schema (bf schema record).
bf init also scaffolds starter schemas in schemas/ (concepts.json, projects.json, actions.json) to keep status values consistent across your notes. Add a schemas/<source>.json file for a memory source only when you want extra domain validation beyond the core schema.
Build and verify¶
After editing notes, run bf build to compile changed files incrementally and refresh the search cache, then verify read-only with bf check:
bf build
bf check --only notes --format text
Use bf check --only notes for fast feedback while writing (it skips scanning historical memory JSONL files), --only config|loops|memories for targeted checks, and bf check --strict in CI to fail on warnings too. Next, search and read your notes in Retrieval, or see Authoring contracts for YAML 1.2 details and link confinement rules.