<!--
Sitemap:
- [Installation](/installation)
- [Upgrading](/upgrading): Version-specific steps for upgrading an existing Bento install.
- [Concepts](/concepts)
- [Build your first pipeline](/tutorials/pipeline-args)
- [Target a specific issue or PR from a URL](/tutorials/url-targeting)
- [Keep state across runs](/tutorials/pipeline-state)
- [Fire a pipeline on a schedule or on demand](/tutorials/schedule-and-fire)
- [Deploy a box to Railway](/tutorials/deploy-to-railway)
- [Operate a hosted daemon](/tutorials/operate-a-hosted-daemon)
- [Configuration](/configuration)
- [Members](/members)
- [Knowledge base](/knowledge-base/)
- [Method and delivery](/knowledge-base/modes)
- [Config](/knowledge-base/config)
- [MCP](/knowledge-base/mcp)
- [Pipeline configuration reference](/pipelines/config)
- [Filters](/pipelines/filters)
- [Triggers](/triggers/)
- [GitHub trigger](/triggers/github)
- [Linear trigger](/triggers/linear)
- [Webhook trigger](/triggers/webhook)
- [Schedule trigger](/triggers/schedule)
- [Manual trigger](/triggers/manual)
- [Traces](/pipelines/traces)
- [Slack](/integrations/slack)
- [Public access](/public-access)
- [Context engineering](/context-engineering)
- [Best practices](/best-practices)
- [Troubleshooting](/troubleshooting)
- [Architecture](/architecture/vision)
- [Workspaces](/workspaces)
- [Authentication](/authentication)
- [Identity](/identity)
- [Security](/security)
- [References](/references)
- [Changelog](/changelog): Bento release history.
- [CLI reference](/cli/)
- [Setup](/cli/setup)
- [Secrets](/cli/secrets)
- [Lifecycle](/cli/lifecycle)
- [Sandbox image](/cli/image)
- [Sandboxes](/cli/sandbox)
- [Observability](/cli/observability)
- [Diagnostics](/cli/diagnostics)
- [Triggers](/cli/triggers)
- [Workbench](/cli/workbench)
- [Auth](/cli/auth)
- [Knowledge](/cli/knowledge)
- [Evals](/cli/evals)
- [Bento](/index)
- [Runtime wrapper](/architecture/runtime-wrapper)
- [Skill evolve](/architecture/skill-evolve)
-->

# Knowledge base

The knowledge base is a set of markdown files. The daemon indexes them at startup and makes them available to agents and to people through search, MCP tools, and [MCP resources](https://modelcontextprotocol.io/specification/2025-11-25/server/resources).

## Source directories

Three directories, each with a distinct role:

| Directory | Purpose |
|-----------|---------|
| `wiki/` | How the org works, architecture, decisions |
| `blueprints/` | What correct looks like |
| `recipes/` | Step-by-step how to do things |

Add a Markdown file to one of these directories. Then restart the daemon.

## Frontmatter

All fields are optional. The daemon also indexes files without frontmatter.

```yaml
---
title: Git Workflow # display title; defaults to the first H1, then the filename slug
editable: true # allow propose_edit to target this doc (default false)
category: conventions # tree position under the doc's URI scheme — single level
tags: [git, process] # cross-cutting topic labels, lowercase-kebab
description: How the team manages Git branches and changes # retrieval description
---
```

`category` groups docs into a branch in `bento kb`. Uncategorized docs sit at the scheme root. `tags` render as a suffix in the listing, filter via `bento kb --tag <t>`, and improve retrieval context. `description` provides a short retrieval summary when the document uses QMD or Chroma.

## Method and delivery

The [`knowledge:` block](/pipelines/config#knowledge) configures how knowledge reaches an agent run, one pipeline at a time. It has two settings: `method`, which sets how the daemon retrieves, and `delivery`, which sets how results reach the agent. Both compose with a `search` escape hatch. See [Method and delivery](/knowledge-base/modes) for the full reference.

## Querying the knowledge base

Bento offers three ways to query the knowledge base.

1. Through MCP on your harness, such as Claude Code or Codex:

   ```bash
   (claude) "how do we handle git branches"

   => Returns LLM response
   ```

2. Through the command line, with `bento ask`:

   ```bash
   bento ask "how do we handle git branches"
   bento ask "how do we handle git branches"

   => Returns LLM response
   ```

3. Directly, as MCP resources:

   ```bash
   "Do we have any git resources in the wiki?"

   => Returns LLM list of wiki resources, e.g.:
   - wiki://git-workflow
   - wiki://git-commit-message-standards
   ```

:::warning
A connected client injects MCP resources into the context without showing you, under the `wiki://`, `blueprint://`, and `recipe://` URI schemes. Account for that context cost when you query. The same behavior is what lets you structure and link knowledge across documents.
:::

## Why the separation

The three methods give you a fast feedback loop, and they let you confirm that both a person and an agent retrieve the same knowledge consistently.

Use them as a test. If no method here retrieves a document you know exists, an agent fails to surface it too when it counts, such as mid-run in a pipeline.

## Notes

* **Docs are indexed at startup, not on save.** Adding or editing a file requires `bento daemon restart` to take effect.
* **Prefer prose over tables for searchable content.** Tables and bullet lists embed poorly as standalone chunks. A prose sentence covering the same convention surfaces more reliably for natural-language queries.
* See [MCP](/knowledge-base/mcp) for detailed information.
