> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modusbrain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install ModusBrain, create a local brain, and run your first operational workflow.

This guide gets you from a terminal to a working local ModusBrain setup. You will install the CLI, create a brain, compile a draft operational skill, approve it, and inspect the audit record.

<Info>
  Use this path for a local setup. You can later connect the same brain to an MCP-compatible agent such as Claude Code or Codex.
</Info>

## Before you begin

* A terminal on macOS, Linux, or Windows.
* [Bun](https://bun.sh) 1.3.10+ or Node.js 18+.
* A folder of notes, docs, or project files you want to use as source material.

## 1. Install the CLI

```bash theme={null}
npm install -g @genthropic/modusbrain
# or
bun install -g @genthropic/modusbrain
```

## 2. Create a local brain

The default setup uses PGLite: an embedded database that runs locally and needs no server.

```bash theme={null}
modusbrain init
modusbrain apply-migrations --yes
modusbrain doctor
```

<Tip>
  `modusbrain doctor` checks your installation and tells you exactly how to fix common configuration problems.
</Tip>

## 3. Add your first source

Import a folder of Markdown files or point ModusBrain at a project you want to search.

```bash theme={null}
modusbrain import ~/my-knowledge
modusbrain search "what is in this knowledge base?"
```

## 4. Create an operational skill

An operational skill turns approved guidance in your brain into a reusable workflow.

```bash theme={null}
modusbrain opskill compile "refund handling" --risk-tier low_stakes
modusbrain opskill show refund-handling
```

## 5. Approve and run it

New skills start as drafts. Review the draft, approve it, then run it with the task context.

```bash theme={null}
modusbrain opskill approve refund-handling --by owner@company.com

modusbrain opskill execute refund-handling \
  --task "Process a $300 refund for order #1204" \
  --context '{"amount":300}'
```

## 6. Review what happened

```bash theme={null}
modusbrain opskill audit --slug refund-handling --json
```

The audit record shows the skill version, inputs, confidence result, and outcome.

## Next steps

<CardGroup cols={2}>
  <Card title="Connect a coding agent" icon="bot" href="/docs/mcp/CODEX">
    Give Codex or another MCP client access to the brain you just created.
  </Card>

  <Card title="Learn the full workflow" icon="workflow" href="/opskill-workflow">
    Understand draft, approval, execution, correction, and audit stages.
  </Card>

  <Card title="Set up a team brain" icon="building-2" href="/for-companies">
    Move from a local setup to shared company knowledge.
  </Card>

  <Card title="Browse every command" icon="terminal" href="/cli-reference">
    Find the CLI commands available in this distribution.
  </Card>
</CardGroup>
