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

# AI Settings

> Configure AI capabilities and behavior for your organization

Control how the AI agent behaves across your organization. These settings are available to admins only.

* **Allow LLM to See Data**: Enable the AI to view sample data from tables for better context and more accurate analysis.
  <Note>If false, the system will use metadata only </Note>

* **Allow File Upload**: Let users upload spreadsheets (xls/csv) and PDFs. The AI will parse and incorporate the data into analysis.
  <Note>When file upload is allowed, the LLM will see the data of the file (for indexing) - this cannot be avoided.</Note>

* **Allow Users to Edit and Execute LLM Generated Code**: Users can view, edit, and run the SQL or Python code generated by the AI. Useful for advanced users who want more control.

* **Enable LLM Judge**: The AI evaluates query quality for accuracy, efficiency, and best practices. Provides feedback to improve results over time.

* **Autogenerate Instructions**: Automatically suggest saving user clarifications as instructions. For example: "Active users should exclude test accounts" becomes a suggested instruction.
  <Note>Suggested instructions require admin approval before becoming active.</Note>

* **Validate Code**: Automatically validate AI-generated code for syntax errors, security issues, and schema correctness before execution.

* **Limit Analysis Steps** (Default: 6): Controls how many sequential steps (queries, visualizations, calculations) the AI can take to answer a question.

* **Limit Code Retries** (Default: 3): Limits how many times the AI can retry code generation after failures to prevent infinite loops.

* **Top K schema**: Set how many schema tables are expanded and included in the initial system prompt.

* **Top K metadata resources**: Set how many metadata resources (dbt, markdown, etc.) are expanded and shown in the initial system prompt.
