---
title: "Context-aware code advisor"
method: POST
path: "/advisor"
tags: ["Advisor"]
---

# Context-aware code advisor

`POST /advisor`

Analyze codebase context against Nia's indexed documentation to get tailored recommendations.

## Request body

- AdvisorRequest — Request model for advisor endpoint.
  - `query` string, required — User's question
  - `codebase` CodebaseContext, required — Structured codebase context from the user.
    - `files` object — Map of file_path -> file_content
    - `file_tree` string, nullable — Directory structure (from tree command or similar)
    - `dependencies` object, nullable — Dependency files: package.json, requirements.txt, etc.
    - `git_diff` string, nullable — Git diff for migration/upgrade scenarios
    - `summary` string, nullable — High-level description of the codebase
    - `focus_paths` string[], nullable — Paths to prioritize in analysis
  - `search_scope` SearchScope — Scope for searching Nia's indexed sources.
    - `repositories` string[], nullable — Repository identifiers to search
    - `data_sources` string[], nullable — Documentation source IDs to search
  - `output_format` 'explanation' | 'checklist' | 'diff' | 'structured' — Output format

## Response `200`

Successful Response

- AdvisorResponse — Response model for advisor endpoint.
  - `advice` string, required — Tailored advice
  - `sources_searched` integer — Number of sources searched
  - `output_format` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nozomio-labs/apis/nia-ai-api.md) · [All operations](https://skmtc.net/nozomio-labs/apis/nia-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nozomio-labs/nia-ai-api/versions/dbb602a3ef17/schema)
