Skip to main content

Building a Custom Agent

Nibchat's agent.yaml lets you shape the AI into a domain-specific assistant. This guide walks through a few common patterns.

Customer support bot

agent:
name: Acme Agent
description: |
You are a customer support agent for Acme Corp.

icon: |
data:image/svg+xml;base64,PHN2ZyB3aWR0...

instructions: |
- Always greet the user warmly.
- For billing issues, ask for their account email and escalate to billing@acme.com.
- For technical issues, try to resolve them using the knowledge base tool.
- Never share internal pricing structures.
- If unsure, say so and offer to connect the user with a human agent.

starterMessages:
- "I need help with my account"
- "I have a billing question"
- "Something isn't working"
- "I'd like to cancel my subscription"

Developer assistant with file system access

instructions: |
You are an expert developer assistant.
You have access to the user's file system via the `files` tool.
When helping with code, always explain what you're doing.
Prefer idiomatic solutions over verbose ones.

mcpServers:
- url: https://localhost:3001/mcp
name: files
headers:
Authorization: "Bearer local-dev-token"

Research assistant with web access

Enable web tools in .env:

TAVILY_API_KEY=tvly-...
JINA_API_KEY=jina_...

Then configure the system prompt to guide web usage:

instructions: |
You are a research assistant.
Always search the web for recent information before answering questions about current events.
Cite your sources by including the URLs you retrieved information from.
Summarize findings clearly and concisely.

starterMessages:
- "Research the latest developments in quantum computing"
- "What are the top AI papers from this month?"
- "Find and summarize this URL for me"

Combining MCP servers and built-in tools

There is no conflict between MCP tools and built-in tools (memory, web search). They are all available simultaneously. You can connect multiple MCP servers alongside the built-in tools:

instructions: |
You are a full-stack assistant. You can browse the web, access our internal database,
and remember important context about the user.

mcpServers:
- url: https://db.internal/mcp
name: database
headers:
Authorization: "Bearer db-token"

- url: https://docs.internal/mcp
name: docs

In this configuration the agent has access to: database__* tools, docs__* tools, web_search, fetch_page, save_memory, list_memories, and delete_memory.