Guides

Building an Agent

How scripts, knowledge bases, and voice settings come together to make a working agent.

Core concepts

An agent in Samwad is made up of four pieces:

  • Script — the instructions and conversation flow the agent follows.
  • Knowledge base — documents, FAQs, or pricing sheets the agent can pull answers from.
  • Voice & language — how the agent sounds and which language(s) it speaks in.
  • Call flow — routing rules for transfers, voicemail, and fallback to a human.

Writing the script

The script is plain language, not code. Describe the agent's goal, its tone, and how it should react in a few common situations. Think of it as onboarding a new phone rep, not writing a state machine.

Good starting structure

  • Opening line — who the agent is and why it's calling or answering.
  • Primary goal — the one outcome that counts as a win (booked demo, answered question, qualified lead).
  • Guardrails — topics to avoid, and what to say when asked something outside scope.
  • Handoff condition — when to transfer to a human or take a message instead.
Write the way you'd brief a new hire on their first call, not the way you'd write a script for a play. Rigid, word-for-word scripts tend to sound robotic when the caller goes off-script.

Knowledge base

Upload documents — pricing sheets, product FAQs, policy pages — under Agent → Knowledge Base. The agent references these when a caller asks something the script doesn't cover directly, instead of guessing or going silent.

Keep source documents current — the agent is only as accurate as what it's given. Stale pricing or outdated policies in the knowledge base will surface in live calls.

Voice & language

Pick a voice and default language per agent. Samwad supports Hindi, English, and code-mixed conversation, and will follow the caller if they switch languages mid-call. Adjust speaking pace and tone (formal, friendly, brisk) to match how your business already talks to customers.

Call flow & routing

Configure what happens at the edges of a conversation:

  • Human handoff — transfer to a live number when the caller asks, or when the agent can't resolve the request.
  • Voicemail detection — leave a pre-set message or retry later for outbound calls.
  • Business hours — route after-hours calls to voicemail, a message, or a different agent.
  • Escalation keywords — trigger an immediate transfer on specific phrases (e.g. a complaint or legal mention).

Testing before you publish

Run test calls from the agent editor before flipping to live — covering the happy path, an off-script question, and the handoff condition. See the Quickstart for how to trigger a test call from the API as well.