<!--
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)
- [Configuration](/configuration)
- [Knowledge Base](/knowledge-base/)
- [Method & 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](/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)
- [Lifecycle](/cli/lifecycle)
- [Sandbox Image](/cli/image)
- [Observability](/cli/observability)
- [Diagnostics](/cli/diagnostics)
- [Triggers](/cli/triggers)
- [Workbench](/cli/workbench)
- [Auth](/cli/auth)
- [Knowledge](/cli/knowledge)
- [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 at startup and makes available to agents and users via 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 |

Drop a markdown file in any of these directories and restart the daemon.

## Frontmatter

All fields are optional; a file with no frontmatter indexes fine.

```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
---
```

`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 appear in the doc's MCP resource description.

## Method & delivery

How knowledge reaches an agent run is configured per pipeline with the [`knowledge:` block](/pipelines/config#knowledge): two knobs — `method` (how the daemon retrieves) and `delivery` (how results reach the agent), composable with a `search` escape hatch. See [Method & delivery](/knowledge-base/modes) for the deep dive.

## Querying the knowledge base

Bento offers three ways to query the knowledge base.

1. Via MCP on your harness (claude, codex, etc)

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

=> Returns LLM response
```

2. Via the CLI using the `bento ask` command

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

=> Returns LLM response
```

3. Directly as MCP resources\*\*

:::warning
\*\*Caution: MCP resources are invisibly injected into the context when connected as `wiki://`, `blueprint://`, and `recipe://` URIs.
Something to be aware of when querying of from a context pollution perspective, but also a powerful way to structure and link knowledge.
:::

```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
```

## Why the separation?

Create a fast feedback loop to ensure knowledge can be retrieved consistently for both Humans and Agents.

If you are unable to retrieve a known document to statement via any of these methods, then
it's also unlikely that Agent will be unable to surface and use that knowledge when it counts (e.g. 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.
