How getnao/nao works
nao is an agentic BI product: teams build and evaluate governed context, then users ask data questions and turn results into shareable stories through the web app or integrations. The backend routes requests to agent, query, and story services, with project and chat state persisted in its database. The CLI supports context setup and synchronization; README also documents offline evaluation, deployment, usage observation, and recommendation workflows. Relationships below use only shown calls and README-described capabilities; several product branches have directory-level paths because their implementation was not sampled.
Main entry points: agent.ts Agent runtime · local-query.service.ts Query tools · main.tsx Web app · chat.queries.ts Chat history
Components 26
Context tooling
- nao CLI
cli/nao_core/main.py - Context sync
cli/nao_core/commands/sync - Context templates
cli/nao_core/templates/engine.py - Offline evaluation
cli/nao_core/commands/test - Live context review
apps/backend/src/services/context-explorer-git/live-context.service.ts
Analysis experience
- Web app
apps/frontend/src/main.tsx - Agent API
apps/backend/src/routes/agent.ts - Agent runtime
apps/backend/src/services/agent.ts - Semantic query editor
apps/frontend/src/components/side-panel/semantic-query-editor.tsx - Query tools
apps/backend/src/services/local-query.service.ts - Query result paging
apps/backend/src/services/query-rows.service.ts - Stories and dashboards
apps/backend/src/services/custom-story.ts
Backend platform
- Chat history
apps/backend/src/queries/chat.queries.ts - Project access
apps/backend/src/queries/project.queries.ts - Application database
apps/backend/src/db/db.ts - File storage
apps/backend/src/services/storage/index.ts - API server
apps/backend/src/app.ts
External channels
- MCP endpoint
apps/backend/src/mcp/routes.ts - Messaging channels
apps/backend/src/routes
Other components
- Data team
- Company analyst
- Context repository
- Analytics warehouse
- MCP client
- Messaging user
- LLM provider
Connections 26
- Data team → nao CLI: sets up
README.md - nao CLI → Context sync: runs sync
cli/nao_core/main.py - Context sync → Context repository: writes context
README.md - Data team → Offline evaluation: evaluates changes
README.md - Data team → Live context review: reviews updates
- Company analyst → Web app: asks questions
README.md - Web app → API server: sends requests
apps/frontend/src/main.tsx - API server → Agent API: registers routes
apps/backend/src/app.ts - Agent API → Agent runtime: runs agent
- Agent runtime → LLM provider: requests generation
- Agent runtime → Query tools: invokes queries
- Query tools → Analytics warehouse: queries data
- Query tools → File storage: opens files
apps/backend/src/services/local-query.service.ts - Semantic query editor → Web app: supports authoring
apps/frontend/src/components/side-panel/semantic-query-editor.tsx - Query result paging → Chat history: loads saved output
apps/backend/src/services/query-rows.service.ts - Query result paging → Agent runtime: checks active run
apps/backend/src/services/query-rows.service.ts - Agent runtime → Chat history: persists conversation
- Project access → Application database: reads and writes
apps/backend/src/queries/project.queries.ts - Chat history → Application database: stores history
- Stories and dashboards → Company analyst: shares stories
- MCP client → MCP endpoint: calls tools
README.md - MCP endpoint → Agent runtime: creates server
- Messaging user → Messaging channels: asks questions
README.md - Messaging channels → Agent runtime: routes requests
- Context templates → LLM provider: generates text
cli/nao_core/templates/engine.py - Live context review → Context repository: reads updates
apps/backend/src/services/context-explorer-git/live-context.service.ts