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

# Ask Sourcebot

`ask_codebase` is only available when a [language model is configured](https://docs.sourcebot.dev/docs/configuration/language-model-providers.md).

## `ask_codebase`

Ask a natural language question about the codebase. This tool uses an AI agent to autonomously search code, read files, and find symbol references/definitions to answer your question. Returns a detailed answer in markdown format with code references, plus a link to view the full research session in the Sourcebot web UI.

Parameters:

| Name | Required | Description |
| :- | :- | :- |
| `query` | yes | The query to ask about the codebase. |
| `repos` | no | The repositories that are accessible to the agent during the chat. If not provided, all repositories are accessible. |
| `languageModel` | no | The language model to use for answering the question. Object with `provider` and `model`. If not provided, defaults to the first model in the config. Use `list_language_models` to see available options. |
| `visibility` | no | The visibility of the chat session (`'PRIVATE'` or `'PUBLIC'`). Defaults to `PRIVATE`. Set to `PUBLIC` to make the chat viewable by anyone with the link (useful in shared environments like Slack). |

## `list_language_models`

Lists the available language models configured on the Sourcebot instance. Use this to discover which models can be specified when calling `ask_codebase`.

Parameters:

This tool takes no parameters.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.