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)
$ 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 issuesReasoning: I need to review, then scan, then decide on approval...→ Calling tool: review→ Calling tool: security→ Calling tool: rag_search→ Calling tool: approveDone. No critical issues found — PR approved.
Single-shot mode (CI-friendly)
Pass a task via --task to run non-interactively and exit when complete.
$ 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.
# 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.
$ 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:
| Tool | Description |
|---|---|
rag_search | Query the RAG index for relevant code snippets or past comments |
post_comment | Post custom Markdown to the PR/MR |
get_pr_info | Get 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.
[agent]max_iterations = 10max_memory_messages = 50memory_file = ".ferret-memory.jsonl" # persist across restartsdefault_channel = "cli"port = 8090