# Using code context in AI chat

Once a repository is connected and indexed, the AI assistant draws on your project's code
as context — so it can answer questions about the implementation, too.

## Prerequisites

1. A [connected repository](https://lalabase.com/docs/en/guides/repositories/connect) whose indexing has finished.
2. The AI assistant is enabled for your organisation.
3. AI features are enabled for your organisation.

## Using it in chat

1. Open the **Chat** in your project.
2. Ask a question about the code, e.g. "Where is the invoice number generated?".
3. The answer points to the code it drew on, so you can look it up in the repository.

<div class="docs-callout docs-callout--info">
  <div class="docs-callout__title">Current after every change</div>
  <p>The index updates on every push when a webhook is set up — otherwise you trigger a re-index manually. Only indexed states are available in the chat.</p>
</div>

## Learn more

For chat basics, see [Personal assistant](https://lalabase.com/docs/en/guides/ai/assistant).
