DocsAI Agent
Back to Docs

AI Agent

Configure your AI assistant to handle customer support automatically.

Setting Up the AI Agent

1. Go to Dashboard β†’ Settings β†’ AI Agent.
2. Toggle Enable AI Agent to ON.
3. Choose your AI Provider:
   β€’ Google Gemini β€” Recommended. Fast and cost-effective.
     Get your API key from: https://aistudio.google.com
   β€’ OpenAI (ChatGPT) β€” Get your API key from: https://platform.openai.com
4. Select a Model:
   β€’ Gemini: gemini-2.0-flash (recommended), gemini-1.5-pro
   β€’ OpenAI: gpt-4o, gpt-4o-mini, gpt-3.5-turbo
5. Paste your API Key.
6. Write your System Prompt (see next section).
7. Adjust Temperature (0 = precise, 1 = creative) and Max Tokens (response length).
8. Click Save Configuration.

Writing an Effective System Prompt

The System Prompt is the most important part of your AI setup. It defines who the AI is, what it knows, how it should behave, and what it should NOT do.

Example System Prompt:
---
You are Sarah, a friendly customer support agent for TechStore Pakistan.

BUSINESS INFO:
- We sell laptops, phones, and accessories.
- Store hours: Mon-Sat 10am-8pm PKT
- WhatsApp: +92-300-1234567
- Address: Main Boulevard, Lahore

YOUR JOB:
- Answer questions about our products and prices.
- Help track orders using the order number the customer provides.
- Recommend products based on the customer's budget and needs.
- Always respond in the same language the customer uses (Urdu or English).

RULES:
- Never make up prices. Say "Please contact us for the latest price."
- If asked something outside your knowledge, say "Let me connect you with our team."
- Keep responses short and clear (max 3-4 sentences).
- Be warm and professional at all times.
---

Settings Guide:
β€’ Temperature 0.3 β€” More precise, consistent answers (recommended for support).
β€’ Temperature 0.8 β€” More creative, varied responses (good for marketing bots).
β€’ Max Tokens 500 β€” Good for short conversational replies.

Controlling AI in Flows

Use the AI Control node in your Flow Builder to enable or disable the AI at specific points.

Common pattern:
1. User sends message β†’ Fallback trigger fires.
2. Flow sends a greeting and collects their name.
3. AI Control node β†’ ENABLE β€” AI takes over the conversation.

In Live Chat:
β€’ Click the brain icon in the top chat toolbar to toggle AI ON/OFF for that specific chat.
β€’ When AI is OFF, the agent handles the conversation manually.
β€’ When you re-enable it, AI resumes from where it left off.

Note: If a flow session is active, the AI will not interfere until the session ends.