---
name: masheev-ai-agents
description: >-
  Use when configuring Masheev AI agents — system prompts, model selection, tool assignment, knowledge base integration, guardrails, escalation triggers, and voice agent setup with ElevenLabs. Covers the AI agent entity, how agents connect to inboxes, prompt engineering for support agents, and the relationship between AI agents (intelligence) and voice agents (TTS/STT). Use this skill when someone asks to "set up an AI agent", "configure the chatbot", "write a system prompt", "add tools to the agent", "connect knowledge base", or "set up voice AI".
license: Apache-2.0
metadata:
  author: masheev
  version: "0.1.0"
title: masheev-ai-agents
canonical_url: https://skilld.dev/gh/masheev/skills/masheev-ai-agents
last_updated: 2026-11-12T05:30:47.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/prompts.md](https://skilld.dev/api/skills-raw/masheev/skills/masheev-ai-agents/references/prompts.md), [references/tools.md](https://skilld.dev/api/skills-raw/masheev/skills/masheev-ai-agents/references/tools.md).
>
> If the user asked to install this Skill, run `npx skilld install masheev/skills/masheev-ai-agents`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/masheev-ai-agents`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/masheev/skills/masheev-ai-agents) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/masheev-ai-agents`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/masheev-ai-agents --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/masheev-ai-agents --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Masheev AI Agents

AI Agents are the intelligence layer behind Masheev conversations. An agent defines what the AI knows, what tools it can use, when to escalate, and how it behaves.

## Architecture

```
Inbox (channel endpoint)
  └── AI Agent (intelligence)
        ├── System prompt
        ├── Tools (built-in + integration + client)
        ├── Knowledge base sources
        ├── Guardrails
        └── Voice config → Voice Agent (ElevenLabs TTS/STT)
```

- **Inbox** = where conversations arrive (chat, WhatsApp, email, etc.)
- **AI Agent** = the brain (prompt, tools, knowledge, rules)
- **Voice Agent** = the voice (text-to-speech, speech-to-text via ElevenLabs)
- One inbox has one AI agent. One AI agent can serve multiple inboxes.

## Managing AI Agents

### Via Dashboard

**Settings > AI Agents > Create Agent**

### Via API

```typescript
import { apiClient } from "@masheev/client/server";

// Create
const agent = await apiClient.aiAgents.create.mutate({
  name: "Support Bot",
  model: "claude-sonnet-4-5",
  instructions: "You are a helpful support agent for Acme Inc...",
});

// Assign to inbox
await apiClient.inboxes.update.mutate({
  id: "inb_...",
  aiAgentId: agent.id,
});

// Update
await apiClient.aiAgents.update.mutate({
  id: agent.id,
  instructions: "Updated system prompt...",
});

// List
const agents = await apiClient.aiAgents.list.query({});
```

## System Prompt Best Practices

Structure your system prompt with clear sections:

```
You are [Agent Name], a support agent for [Company].

## Role
- Help customers with [domain] questions
- Be friendly, concise, and accurate

## Knowledge
- Use the knowledge base to answer product questions
- If you don't know something, say so — don't guess

## Guardrails
- Never share internal pricing or competitor comparisons
- Never promise features that don't exist
- Never share other customers' data

## Escalation
- Escalate to a human when:
  - The customer is upset or frustrated
  - The issue requires account access you don't have
  - You've been unable to resolve after 3 attempts

## Tools
- Use check_availability before suggesting appointment times
- Use create_booking only after the customer confirms
```

## Tool Tiers

| Tier | Source | Examples | Configured Via |
|------|--------|----------|----------------|
| Built-in | Platform | resolve_conversation, set_priority, assign_to_human, send_message | Dashboard (always available) |
| Capability | Platform (gated) | `fetch_website` (Internet access) | Dashboard > Agent > Capabilities |
| Integration | Third-party adapters | Google Calendar, Tableport, Google Reviews | Dashboard > Integrations |
| Client | Browser-side SDK | search_products, create_order (your code) | `tools` in SDK config |

## Internet Access (fetch_website)

Enabling **Internet access** on an agent grants a platform-managed `fetch_website` tool that
reads public web pages server-side (e.g. importing business details from a URL a customer
shares). It runs on Masheev's infrastructure — **you don't need a scraper or an API key**, and
nothing is exposed to the browser. Off by default.

- **Enable:** Dashboard → Agent → Capabilities → *Internet access* (or `capabilities.internet.enabled`).
- **Restrict (optional):** `capabilities.internet.allowlist` / `blocklist` limit which domains
  the agent may fetch (exact domain or subdomain).
- **Don't ship your own `fetch_website` client tool.** A client tool of the same name overrides
  the platform one (the SDK logs a warning). Reference `fetch_website` by name in a workflow
  step and let the platform provide it.
- **Safety:** fetched content is treated as untrusted data (never as instructions), fetch calls
  are capped per turn, and only public URLs are fetched (SSRF-guarded).

## Knowledge Base Integration

Connect knowledge sources so the AI can answer questions from your docs:

```typescript
// Add a knowledge source
await apiClient.knowledge.create.mutate({
  inboxId: "inb_...",
  type: "webpage",
  url: "https://docs.myapp.com",
});

// Trigger re-crawl
await apiClient.knowledge.sync.mutate({ id: "knowledge_source_id" });
```

The AI automatically searches the knowledge base when it doesn't have an answer from its system prompt.

## Escalation

The AI automatically escalates when:
- Confidence drops below 0.7 (configurable)
- Customer sentiment is negative after multiple exchanges
- The system prompt's escalation rules are triggered

Escalation assigns the conversation to a human agent or team, and fires the `escalation.created` webhook event.

## Voice Agents

Voice agents handle speech-to-text and text-to-speech via ElevenLabs:

- **AI Agent** = what to say (prompt, tools, knowledge)
- **Voice Agent** = how to say it (voice selection, latency settings, language)
- Link them: `aiAgent.channelConfig.voice.voiceAgentId`

Voice agents are configured in the dashboard: **Settings > Voice Agents**

See [references/prompts.md](https://skilld.dev/api/skills-raw/masheev/skills/masheev-ai-agents/references/prompts.md) for example system prompts by industry.
See [references/tools.md](https://skilld.dev/api/skills-raw/masheev/skills/masheev-ai-agents/references/tools.md) for built-in tool reference.
