Custom Agents

CodeBot has a single identity, shared memory, etc, but different tasks are performed by specialised versions of itself: specialised agents. There is an agent for coding; an agent for researching and answering questions; an agent for planning, etc.

You can define your own agent for any specific task.

In Settings, go to Custom Agents, and click New Agent. This prompts for its name and a short description. The agent prompt is then opened in the IDE for you to edit (see Defining Agent Behaviour below.)

  • 'New Agent' created a new project/repository agent, ie, one that you can check in to source control and share with your team. Use this when you have common tasks for your project which any team member may want to invoke

  • Click the dropdown caret to create a new agent for yourself, only. Use this when you have your own workflows and tasks you want to be able to invoke.

Security warning: Be aware of security. Custom agents are instructions given to the AI. Audit any custom agents that you add from a third party or untrusted source.

Defining Agent Behaviour

Agents really can be for any task. This can be general (we have a coding agent) or specific, eg for a common workflow (suppose in your codebase you regularly created new 'operator' types but it takes a few steps for you; you could create an agent that did these steps for you.)

To create an agent, write text that tells it what its goal is, and what to do to achieve it. (See Best Practices below.)

Invoking a Custom Agent

A custom agent can be invoked from the chat window using Slash Commands. The agent's name is the command. For example, if you named your custom agent build-operator, then invoke it as:

/build-operator [optionally more text here]

Like any slash command, after the command you can write more text, which is sent to the agent as your input. For example:

/build-operator make one called MyNewOperator; this one needs to inherit from the FoozleOperator class and implement the same operator comparisons as Zyzzygy and FooBar.

That text will be passed to the agent.

Best Practices

Write imperative commands. Don't leave ambiguity: have clear statements: do this, do that. Don't say you 'like it if', or other ambiguous text: give direct commands, Do X. This is the single most important thing to build a successful custom agent.

That said, you don't need to over-specify. If there are key steps, list them. If you want it to do something, tell it. An order can constrain as much as guide, so give clear imperative orders but only be highly specific when it is appropriate. If it must follow steps, specify those steps; if it just needs to get to a goal, tell it to get to that goal. This is a balance: you may want to test your agent and tweak its instructions a few times.

Agents absolutely can exhibit judgement and handle ambiguous situations. Tell them to do so as a direct statement.

You can also direct an agent to discuss with you, and to ask you questions when it is unsure or when there are multiple options. To use the CodeBot UI for questions, direct an agent to 'use the question tool'.

Give your agents pointers: tell it where to look, what areas of code it needs to understand, etc.

Editing Custom Agents

In Settings > Custom Agents, you can also:

  • Select and edit an existing agent, or show it in Explorer

  • Open both the repo/project custom agents folder, and the personal custom agents folder, in Explorer

Custom agents are just MD files with frontmatter. Edit in any text editor, and commit them to source control.

See Also