# Knowledge and code

> Why DevHub keeps knowledge in vaults and code in a repository index, and which one an agent should ask first.

DevHub answers two different questions in two different places.

## Knowledge: why and what is the rule

Notes in a vault hold what is not obvious from the code: decisions, rules, how a feature should behave and why, verified fixes. An agent asks them with `knowledge_search`, reads one with `vault_file_read` and finds a note by a word with `vault_files_search`. [Business Context](/devhub/features/business-context/index.md) is the same search for you.

## Code: where is it and what does it touch

The Repository Index reads a folder's code and keeps symbols and their relations. An agent asks it with tools such as `repo_symbol_search`, `repo_callers` and `repo_impact`, which tell where a function is, who calls it and what a change would break. The index is built for each MCP folder; see [Organizations and projects](/devhub/features/organizations-projects/index.md).

## Which first

For how something behaves and why, ask the vault first. For where something is and what depends on it, ask the index. If the two disagree, the code shows what is true now; the note should then be corrected.

## Giving an agent both

Put the notes and symbols it needs in the [AI Context](/devhub/features/ai-context/index.md) queue, and the agent takes them in one call at the start of a task.

## Related

- [Vaults](/devhub/features/vaults/index.md)
- [Catalog of DevHub tools](/devhub/reference/mcp-tools/index.md)
