AI Agents and knowledge sources
Create role-specific AI assistants and enrich them with documents for more grounded answers.
An AI Agent defines the role, response behaviour, and knowledge boundaries for a specific AI assistant in Odoo. The AI App module provides the interface to manage agents, topics, default prompts, and AI provider configuration.
When combined with RAG (Retrieval-Augmented Generation), the agent can use your internal documents instead of relying only on general model knowledge. Knowledge sources are automatically indexed and referenced by the agent when responding. If you have not completed the foundation yet, read Odoo AI configuration first; if you want deeper document grounding, continue with AI Knowledge.
Create a new AI Agent
Access the AI menu from the main application bar, then go to Agents → Agents to manage AI assistants. Each agent represents a specific business role such as Sales Assistant, Customer Support, or Internal Helper.
Steps
1. Go to AI → Agents → Agents (or Settings → General Settings → AI → AI Agents).
2. Click New to create a new agent.
3. Fill in Name (agent name, e.g., Sales Coach), Subtitle (short description).
4. Choose LLM Model (GPT-4o, GPT-4.1, GPT-4.1 Mini, Gemini 2.5 Pro, Gemini 2.5 Flash).
5. Select Response Style: Analytical (detailed analysis), Balanced (balanced), or Creative (flexible and creative).
6. Enter System Prompt to define the agent role and behaviour.
7. Enable Restrict to Sources if answers must stay within attached knowledge sources.
8. Click Save to save the agent.
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Name | Tên | The visible name of the agent, such as Sales Assistant or Support Agent. |
| Subtitle | Mô tả | A short explanation of what the agent is for, helping users quickly understand its purpose. |
| System Prompt | Hướng dẫn hệ thống | The instruction that defines the agent role and behaviour. Should be clear, concise, and include examples. |
| Response Style | Phong cách trả lời | Choose output style: Analytical (precise, logical), Balanced (balanced), Creative (creative, diverse). |
| LLM Model | Mô hình LLM | The AI model used to generate responses: GPT-4o (best), GPT-4.1 Mini (fast), Gemini 2.5 Flash (fast). |
| Restrict to Sources | Chỉ dùng nguồn | If enabled, the agent only answers based on attached knowledge sources, not general knowledge. |
| Topics | Chủ đề | Assign topics to provide instructions and AI tools to the agent. |
Effective system prompt examples
A good system prompt should clearly define the role, be concise, and provide examples of desired responses. Avoid overly long or vague prompts.
Example for Sales Assistant: "You are a professional sales assistant. Help users find the right products, stay polite and clear, and say explicitly when information is unavailable."
Example for Customer Support: "You are a customer service specialist. Respond politely, empathetically, and provide specific solutions. If unsure, guide customers to contact the appropriate department."
Test the Agent
After creating an agent, test it before wide deployment. In the Agent form, click the Test button to open a trial chat session. Evaluate response quality, accuracy, and response style.
Steps
1. Open the AI Agent you just created.
2. Click the Test button in the top corner.
3. The system opens a trial chat session with the agent.
4. Type sample questions to check responses.
5. Adjust System Prompt or Response Style if needed.
6. Save after you are satisfied with the results.
Add Topics
Topics help group business objectives, response guidelines, and appropriate AI tool sets. Then assign Topics to Agents to reuse logic faster. For example, a "Customer Service" topic might contain instructions about polite tone and order lookup tools.
Steps
1. Go to AI → Agents → Topics to manage topics.
2. Click New to create a new topic.
3. Fill in Name (topic name), Description (short description).
4. Enter Instructions (detailed instructions for the agent when using this topic).
5. Select Tools (AI tools allowed to use) if needed.
6. Click Save to save the topic.
7. Return to the Agent, find the Topics field, click Add a line and select the topic you just created.
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Name | Tên | Topic name, e.g., Customer Service, Sales Support, Internal Help. |
| Description | Mô tả | Brief summary of what this topic is for. |
| Instructions | Hướng dẫn | Detailed instructions for the agent when applying this topic. |
| Tools | Công cụ | List of AI tools the agent is allowed to use in this topic. |
Add knowledge sources from files or URLs
Knowledge sources (Sources) allow the agent to reference internal documents when responding. Binary sources work well for PDFs, images, spreadsheets, and text documents. URL sources work well for publicly accessible web pages.
When a source is processing, the form displays a warning: "Processing your sources, this may take a few minutes…". Monitor source status regularly and use Retry if it fails.
Steps
1. Open the AI Agent and switch to the Sources tab.
2. Click Add a line to add a new source.
3. Select Type as Binary (file) or URL (link).
4. If Binary: click Upload and select a file from your computer.
5. If URL: enter the web page address in the URL field.
6. Click Save so the system can begin indexing.
7. Check status: Processing (processing), Indexed (ready), Failed (error).
8. If Failed, click Retry to try again or Reprocess to re-index a successful URL source.
Indexing states and supported formats
The system automatically extracts content from files, splits it into chunks, creates vector embeddings, and indexes for semantic search. This process may take a few minutes depending on document size.
Source statuses
| Status | Meaning | Action |
|---|---|---|
| Processing | The source is being indexed, wait a moment. | Wait for completion, no action needed. |
| Indexed | The source is ready for the agent to use. | Agent can reference this source. |
| Failed | The source failed and needs review or Retry. | Click Retry or check the file/URL. |
Supported file formats
| Type | Format | Notes |
|---|---|---|
| Keep compact, roughly up to 5 pages for small documents. Very large files may fail. | ||
| Images | PNG, JPG, JPEG, WEBP, GIF | Supports OCR to extract text from images. |
| Spreadsheets | Excel, CSV, ODS | Extracts data from spreadsheets for agent reference. |
| Text | TXT, Markdown | Plain text format, easiest to process. |
Smart source management
Key points
• Only add quality, updated documents relevant to the agent role.
• Monitor source status regularly, especially after adding new sources.
• If a source fails, use Retry before deleting. Check if the file format or URL is valid.
• Split long documents into smaller parts with clear headings so the agent can search easily.
• Do not add sensitive documents to knowledge sources without checking access permissions.
Configure Default Prompts
Default Prompts allow system administrators to configure rules for calling agents based on context. For example, when composing an email to a customer, automatically call "Customer Success Agent" with the default prompt "Keep tone polite, clear, and concise".
Steps
1. Go to AI → Configuration → Default Prompts (system admin only).
2. Click New to create a new rule.
3. Fill in Rule Name (rule name).
4. Select When users need to (interface_key): trigger context (e.g., mail composer).
5. Select On the Model (focused_models): model to apply (e.g., res.partner) or leave blank for all.
6. Select Call the Agent (ai_agent): agent to be called.
7. Enter Default Prompt: additional default prompt.
8. Add Buttons: list of quick prompts for users (e.g., "Write thank you email", "Write apology email").
9. Click Save to save the rule.
Configure Providers (API Key)
To use AI, you need to configure API keys from OpenAI or Google Gemini. API keys are entered as passwords (hidden characters) and only system administrators can view/edit them. Do not share keys via internal chat/email.
Steps
1. Go to AI → Configuration → Settings (system admin only).
2. In the Providers block, find Use your own ChatGPT account or Use your own Google Gemini account.
3. Enable the corresponding checkbox.
4. Enter Key (API key from OpenAI or Google).
5. Click Save to save the configuration.
6. Try the AI feature again to verify the key works.
Search and filter Agents
In the Agents screen, you can search by name or description, filter Archived, group by Model (LLM model) or Topics. You can also search by Sources (source name, file name, URL).
Key points
• Search: type agent name or description in the search bar.
• Filter Archived: show only archived or active agents.
• Group by Model: group agents by LLM model (GPT-4o, Gemini 2.5 Pro, etc.).
• Group by Topics: group agents by assigned topics.
• Search by Sources: find agents with specific knowledge sources.
Tips for effective Agent design
Key points
• Set a clear business Name (e.g., "Sales Coach", "Support Assistant") so users can easily identify it.
• Write a short Subtitle so users quickly understand the purpose without opening details.
• Assign the right Topic expertise, avoid one agent doing everything. Each agent should have a clear scope.
• Use Default Prompts to standardize tone and create Buttons for frequently used commands.
• Test with the Test button before wide deployment to ensure quality.
• Review keys periodically and rotate when needed for security.