Autonomous Agent
Features

Autonomous Agent

A ReAct-loop agent that plans and executes multi-step code review tasks autonomously.

ReAct loop

The agent follows a Reason → Act → Observe cycle. It reads your task, selects a tool, observes the output, and iterates until the task is complete or max_iterations is reached.

CLI REPL (default)

shell
$ ferret agent
🦡 Ferret Agent — type your task and press Enter ("exit" to quit)
> review the PR, run a security scan, and approve if no critical issues
Reasoning: I need to review, then scan, then decide on approval...
→ Calling tool: review
→ Calling tool: security
→ Calling tool: rag_search
→ Calling tool: approve
Done. No critical issues found — PR approved.

Single-shot mode (CI-friendly)

Pass a task via --task to run non-interactively and exit when complete.

shell
$ ferret agent --task "run /security and post a summary"
$ ferret agent --task "describe the PR and generate labels"

Slack integration

Run Ferret as a Slack bot. Mention @ferret in any channel to trigger a task.

shell
# Start the webhook listener
$ ferret agent --channel slack --port 8090

Required env vars for Slack

Set SLACK_BOT_TOKEN (xoxb-...) before starting. In the Slack App settings, configure the Events API URL to http://your-host:8090/slack/events and subscribe to the message.channels bot event.

Discord integration

Ferret polls for new messages and replies when mentioned or addressed by name.

shell
$ ferret agent --channel discord

Required env vars for Discord

Set DISCORD_BOT_TOKEN and DISCORD_CHANNEL_ID. The bot reads the channel every 3 seconds and replies when you mention @Ferret or start a message with ferret.

Available tools

The agent has access to all 19 slash commands plus these additional tools:

ToolDescription
rag_searchQuery the RAG index for relevant code snippets or past comments
post_commentPost custom Markdown to the PR/MR
get_pr_infoGet PR metadata: title, author, branches, labels, diff stats
All slash commands/review, /security, /describe, etc.

Conversation memory

The agent keeps a configurable ring-buffer of messages in memory. Optionally persist it across restarts with a JSONL file.

ferret.toml
toml
[agent]
max_iterations = 10
max_memory_messages = 50
memory_file = ".ferret-memory.jsonl" # persist across restarts
default_channel = "cli"
port = 8090