nao init
The nao init command sets up your context repository with all necessary files and structure.
Run nao init
The command will guide you through an interactive setup:
1. Project Name
What is the name of your project?
> my-analytics-agent
2. Database Connection (Optional)
Do you want to connect a database? [y/N]
> y
Select your database type:
1. Snowflake
2. BigQuery
3. Databricks
4. PostgreSQL
5. Redshift
6. MySQL
If you select yes, youβll be prompted for connection details specific to your database type.
3. Repository Context (Optional)
Do you want to add a repository to your agent context? [y/N]
> y
Repository URL:
> https://github.com/your-org/dbt-project
Path within repo (optional):
> models/
4. LLM API Key (Optional)
Do you want to add an LLM key? [y/N]
> y
Select your LLM provider:
1. OpenAI
2. Anthropic
3. Azure OpenAI
4. Other
5. Slack Integration (Optional)
Do you want to setup a Slack connection? [y/N]
> y
You can skip any optional step and configure it later by editing nao_config.yaml.
What Gets Created
After running nao init, youβll have a folder with the architecture of your context:
my-analytics-agent/
βββ nao_config.yaml # Main configuration file
βββ RULES.md # Agent behavior rules
βββ agent/ # Agent tools and integrations
β βββ mcps/ # Model Context Protocols
β βββ tools/ # Custom tools
βββ databases/ # Database schemas (populated after sync)
βββ docs/ # Documentation files
βββ queries/ # Example queries
nao sync
Once initialized, populate your context with actual content:
This will:
- Connect to configured databases and pull schemas
- Clone configured repositories
- 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
project_name: my-analytics-agent
# Database Connections
databases:
- name: bigquery-prod
type: bigquery
project_id: my-project
dataset_id: analytics
credentials_path: /path/to/credentials.json
accessors:
- columns
- preview
- description
- profiling
include: []
exclude: []
sso: false
location: null
# Repository Integrations
repos:
- name: dbt
url: https://github.com/your-org/dbt-project.git
branch: main
# LLM Configuration
llm:
provider: anthropic
api_key: ${ANTHROPIC_API_KEY}
# Slack Integration (optional)
slack:
bot_token: ${SLACK_BOT_TOKEN}
signing_secret: ${SLACK_SIGNING_SECRET}
post_message_url: https://slack.com/api/chat.postMessage
Environment Variables
Never commit sensitive credentials to Git! Always use environment variables for secrets.
Store sensitive values in environment variables:
# .env file (add to .gitignore)
OPENAI_API_KEY=sk-...
SNOWFLAKE_USER=my_user
SNOWFLAKE_PASSWORD=my_password
SLACK_BOT_TOKEN=xoxb-...
SLACK_SIGNING_SECRET=...
Reference them in your config:
api_key: ${OPENAI_API_KEY}
user: ${SNOWFLAKE_USER}
password: ${SNOWFLAKE_PASSWORD}
Next Steps