Skip to main content

nao init

The nao init command sets up your context repository with all necessary files and structure. Run nao init
If nao_config.yaml already exists, nao init runs an update flow and lets you adjust existing configuration values instead of starting from scratch. nao init keeps the interactive setup to the essentials - project name, one database, one LLM, and one git repository. Everything else (extra databases and repos, Slack, Notion, MCP servers, skills, profiling) is configured afterwards by editing nao_config.yaml. 1. Project Name
The project name defaults to the current folder name - press Enter to accept it, or type a different name. 2. Database Connection (Optional)
If you say yes, you’ll be prompted for the connection details specific to your database type. The database is scaffolded with the columns and preview templates (plus ai_summary when you configure an LLM); profiling and query_history are written as commented-out options you can enable later. See Databases for the full template and connection reference. 3. LLM API Key (Optional)
If you use the Ollama provider you can skip the API key, as Ollama does not require one. To offer several providers or models, add them to the llm.providers list in nao_config.yaml afterwards - see LLM providers and models. 4. Git Repository (Optional)
nao init sets up a single database, LLM, and repo. To add more, or to configure Slack, Notion, MCP servers, or skills, edit nao_config.yaml directly - re-running nao init on an existing project opens an update flow instead of starting over.
What Gets Created After running nao init, you’ll have a folder with the architecture of your context:
MCP servers are configured via the agent/mcps/mcp.json file, while skills are defined as markdown files in the agent/skills/ folder. Both are part of your project context and are discovered automatically by the agent.

nao sync

Once initialized, populate your context with actual content:
This will:
  • Connect to configured databases and pull schemas
  • Clone configured repositories
  • Sync configured Notion pages into markdown files under docs/notion/
  • Generate structured context files
  • Index content for your agent

nao debug

Verify your configuration:
This checks:
  • Configuration file syntax
  • Database connectivity
  • LLM API access
  • Environment variables
  • File permissions

nao_config.yaml

The nao_config.yaml file is the central configuration for your analytics agent. You can always edit it and re-launch a sync with this configuration. Basic Structure
Every key is documented in the configuration reference. The llm block is detailed in LLM providers and models below, and the test block in Evaluation. Environment Variables
Never commit sensitive credentials to Git! Always use environment variables for secrets.
Store sensitive values in environment variables (examples for different providers and warehouses):
Reference them in your config:
Warehouse Credentials For Warehouse credentials, you can use either method: Method 1: credentials_path (local development)
Method 2: credentials_json (cloud deployments)
Use credentials_json for cloud deployments (Cloud Run, GitHub Actions, etc.) where you store the full JSON content in an environment variable or secret manager. Use credentials_path for local development with credential files.
When using credentials_json, the environment variable must contain the entire JSON content of your service account key file, not just the path.

LLM providers and models

The llm block holds a list of providers under providers, and each provider lists the models it exposes. Use it to offer your users a choice of models, to expose models nao doesn’t know about (a proxy alias, a fine-tune, a model released after your nao version), and to price each of them.
A provider can appear only once, and only one model per provider can be the default. Leave models out to expose the provider’s built-in model list, which is what nao init writes. Every provider you declare is picked up by nao chat, nao debug and nao test. The chat server reads the block directly, so models, display names, inference settings and prices reach the app without any extra environment variable.
Providers declared in nao_config.yaml show up in the admin UI under Settings -> Project -> Models, badged nao_config.yaml. Editing one there saves an override in the database that keeps winning over the file until you delete it, so the file remains the durable source of truth. Resolution order per provider is admin UI -> nao_config.yaml -> environment variables. See Choose LLM models.

Provider credentials

AWS Bedrock with a bearer token:
AWS Bedrock with IAM credentials:
Bedrock also accepts aws_profile to use a named AWS CLI profile, such as an SSO one, instead of inline keys. Google Vertex AI, authenticating with Application Default Credentials, an inline service account or a key file:

OpenAI-compatible proxy (LiteLLM)

To route the agent through an LLM proxy such as LiteLLM, keep the underlying provider and add base_url pointing at the proxy endpoint:
base_url is supported on the openai, anthropic, and openrouter providers. nao debug runs its connectivity check against this base URL, so the test reflects the endpoint your agent actually calls. Because a proxy exposes model IDs nao has no price for, list them under models with their costs to keep cost tracking accurate.

Model costs

nao ships a price table for the models it knows and computes the cost of every call from it. A costs block on a model overrides that table token type by token type:
All four fields are optional and expressed in US dollars per million tokens; the ones you leave out fall back to nao’s table. These prices feed the usage dashboard, the budgets, and the cost column of nao test.

Migrating an older config

Before multiple providers were supported, the llm block declared a single provider inline:
That shape still loads — nao reads it as a one-entry providers list — but it prints a deprecation warning and cannot express several providers or per-model costs. Rewrite it with:
The command only touches the llm block and rewrites it as text, so comments and {{ env('...') }} references survive untouched.
llm.meta.costs is deprecated. Prices declared there apply to every model, which gets misleading as soon as you run more than one. Move them to the costs of the matching model.
Next Steps

Context Synchronization

Learn how to sync and update your agent’s context

Context Principles

Learn how to optimize your context for reliability, speed, and cost