Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bc9a43d
fix: execution recovery
TimothyZhang7 Mar 3, 2026
68ac73a
feat: add options support to ask_user tool
bryanadenhq Mar 3, 2026
63845a0
feat: add queen-context endpoint and SSE replay
bryanadenhq Mar 3, 2026
b4d7e57
feat: update queen prompt for structured ask_user
bryanadenhq Mar 3, 2026
c65a99c
feat: add QuestionWidget component
bryanadenhq Mar 3, 2026
207d2fb
feat: wire QuestionWidget into ChatPanel and workspace
bryanadenhq Mar 3, 2026
4b4abb4
Merge branch 'feature/queen-worker-comm' into fix/queen-recovery
TimothyZhang7 Mar 3, 2026
dcc11c9
chore: move test deps to testing extra and dev group
bryanadenhq Mar 3, 2026
97cbcf7
fix: adapt path guarantee
TimothyZhang7 Mar 3, 2026
b59094d
fix: queen should not return on empty stream
TimothyZhang7 Mar 3, 2026
cb0e9ff
chore: fixing tests
bryanadenhq Mar 3, 2026
bbe8efe
fix: prevent queen auto-block from overwriting pending worker questions
bryanadenhq Mar 3, 2026
511c1a6
fix: update queen prompt around ask_user
bryanadenhq Mar 3, 2026
cacae9f
fix: compaction logics
TimothyZhang7 Mar 3, 2026
c743816
Merge branch 'feature/queen-worker-comm' into feat/question-widget
TimothyZhang7 Mar 3, 2026
87a9dd1
fix: load-new-session from home
RichardTang-Aden Mar 3, 2026
b983d3c
chore: ignore local dev skills
RichardTang-Aden Mar 3, 2026
2619acd
docs: remove TUI in the readme
RichardTang-Aden Mar 3, 2026
2693452
docs: update readme instructions
RichardTang-Aden Mar 3, 2026
3cda30a
docs: update the latest features from recent changes
RichardTang-Aden Mar 3, 2026
03ca106
docs: sync all i18n READMEs with primary README
RichardTang-Aden Mar 3, 2026
3ae889a
docs: add running screenshot and update the coding agent instruction
RichardTang-Aden Mar 3, 2026
bf0d80e
docs: reorder section in documentation
RichardTang-Aden Mar 3, 2026
cbf220e
feat: email reply sample agent
RichardTang-Aden Mar 3, 2026
f490038
chore: move the email reply sample agent
RichardTang-Aden Mar 3, 2026
f0899bb
feat: use send instead of draft for email reply agent
RichardTang-Aden Mar 3, 2026
676ef56
fix: mcp path
RichardTang-Aden Mar 3, 2026
0de47db
feat: agents.md for agent collaboration
RichardTang-Aden Mar 3, 2026
61afaa4
feat: add uv instruction to agents
RichardTang-Aden Mar 3, 2026
d7075b4
fix: cleanse llm conversations
TimothyZhang7 Mar 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exports/*
.agent-builder-sessions/*

.claude/settings.local.json
.claude/skills/ship-it/

.venv

Expand Down
30 changes: 30 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Repository Guidelines

Shared agent instructions for this workspace.

## Coding Agent Notes

-
- When working on a GitHub Issue or PR, print the full URL at the end of the task.
- When answering questions, respond with high-confidence answers only: verify in code; do not guess.
- Do not update dependencies casually. Version bumps, patched dependencies, overrides, or vendored dependency changes require explicit approval.
- Add brief comments for tricky logic. Keep files reasonably small when practical; split or refactor large files instead of growing them indefinitely.
- If shared guardrails are available locally, review them; otherwise follow this repo's guidance.
- Use `uv` for Python execution and package management. Do not use `python` or `python3` directly unless the user explicitly asks for it.
- Prefer `uv run` for scripts and tests, and `uv pip` for package operations.


## Multi-Agent Safety

- Do not create, apply, or drop `git stash` entries unless explicitly requested.
- Do not create, remove, or modify `git worktree` checkouts unless explicitly requested.
- Do not switch branches or check out a different branch unless explicitly requested.
- When the user says `push`, you may `git pull --rebase` to integrate latest changes, but never discard other in-progress work.
- When the user says `commit`, commit only your changes. When the user says `commit all`, commit everything in grouped chunks.
- When you see unrecognized files or unrelated changes, keep going and focus on your scoped changes.

## Change Hygiene

- If staged and unstaged diffs are formatting-only, resolve them without asking.
- If a commit or push was already requested, include formatting-only follow-up changes in that same commit when practical.
- Only stop to ask for confirmation when changes are semantic and may alter behavior.
1 change: 1 addition & 0 deletions CLAUDE.md
104 changes: 18 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

## Overview

Build autonomous, reliable, self-improving AI agents without hardcoding workflows. Define your goal through conversation with a coding agent, and the framework generates a node graph with dynamically created connection code. When things break, the framework captures failure data, evolves the agent through the coding agent, and redeploys. Built-in human-in-the-loop nodes, credential management, and real-time monitoring give you control without sacrificing adaptability.
Build autonomous, reliable, self-improving AI agents without hardcoding workflows. Define your goal through conversation with hive coding agent(queen), and the framework generates a node graph with dynamically created connection code. When things break, the framework captures failure data, evolves the agent through the coding agent, and redeploys. Built-in human-in-the-loop nodes, credential management, and real-time monitoring give you control without sacrificing adaptability.

Visit [adenhq.com](https://adenhq.com) for complete documentation, examples, and guides.

https://github.com/user-attachments/assets/846c0cc7-ffd6-47fa-b4b7-495494857a55
[![Hive Demo](https://img.youtube.com/vi/XDOG9fOaLjU/maxresdefault.jpg)](https://www.youtube.com/watch?v=XDOG9fOaLjU)

## Who Is Hive For?

Expand All @@ -50,7 +50,7 @@ Hive is designed for developers and teams who want to build **production-grade A
Hive is a good fit if you:

- Want AI agents that **execute real business processes**, not demos
- Prefer **goal-driven development** over hardcoded workflows
- Need **fast or high volume agent execution** over open workflow
- Need **self-healing and adaptive agents** that improve over time
- Require **human-in-the-loop control**, observability, and cost limits
- Plan to run agents in **production environments**
Expand Down Expand Up @@ -81,7 +81,7 @@ Use Hive when you need:
### Prerequisites

- Python 3.11+ for agent development
- Claude Code, Codex CLI, or Cursor for utilizing agent skills
- An LLM provider that powers the agents

> **Note for Windows Users:** It is strongly recommended to use **WSL (Windows Subsystem for Linux)** or **Git Bash** to run this framework. Some core automation scripts may not execute correctly in standard Command Prompt or PowerShell.

Expand Down Expand Up @@ -110,71 +110,36 @@ This sets up:
- **LLM provider** - Interactive default model configuration
- All required Python dependencies with `uv`

### Build Your First Agent

```bash
# Build an agent using Claude Code
claude> /hive

# Test your agent
claude> /hive-debugger

# (at separate terminal) Launch the interactive dashboard
hive tui

# Or run directly
hive run exports/your_agent_name --input '{"key": "value"}'
```

## Coding Agent Support

### Codex CLI
- At last, it will initiate the open hive interface in your browser

Hive includes native support for [OpenAI Codex CLI](https://github.com/openai/codex) (v0.101.0+).
<img width="2500" height="1214" alt="home-screen" src="https://github.com/user-attachments/assets/134d897f-5e75-4874-b00b-e0505f6b45c4" />

1. **Config:** `.codex/config.toml` with `agent-builder` MCP server (tracked in git)
2. **Skills:** `.agents/skills/` symlinks to Hive skills (tracked in git)
3. **Launch:** Run `codex` in the repo root, then type `use hive`

Example:

```
codex> use hive
```

### Opencode
### Build Your First Agent

Hive includes native support for [Opencode](https://github.com/opencode-ai/opencode).
Type the agent you want to build in the home input box

1. **Setup:** Run the quickstart script
2. **Launch:** Open Opencode in the project root.
3. **Activate:** Type `/hive` in the chat to switch to the Hive Agent.
4. **Verify:** Ask the agent _"List your tools"_ to confirm the connection.
<img width="2500" height="1214" alt="Image" src="https://github.com/user-attachments/assets/1ce19141-a78b-46f5-8d64-dbf987e048f4" />

The agent has access to all Hive skills and can scaffold agents, add tools, and debug workflows directly from the chat.
### Use Template Agents

**[📖 Complete Setup Guide](docs/environment-setup.md)** - Detailed instructions for agent development
Click "Try a sample agent" and check the templates. You can run a templates directly or choose to build your version on top of the existing template.

### Antigravity IDE Support
### Run Agents

Skills and MCP servers are also available in [Antigravity IDE](https://antigravity.google/) (Google's AI-powered IDE). **Easiest:** open a terminal in the hive repo folder and run (use `./` — the script is inside the repo):
Now you can run an agent by selectiing the agent (either an existing agent or example agent). You can click the Run button on the top left, or talk to the queen agent and it can run the agent for you.

```bash
./scripts/setup-antigravity-mcp.sh
```

**Important:** Always restart/refresh Antigravity IDE after running the setup script—MCP servers only load on startup. After restart, **agent-builder** and **tools** MCP servers should connect. Skills are under `.agent/skills/` (symlinks to `.claude/skills/`). See [docs/antigravity-setup.md](docs/antigravity-setup.md) for manual setup and troubleshooting.
<img width="2500" height="1214" alt="Image" src="https://github.com/user-attachments/assets/71c38206-2ad5-49aa-bde8-6698d0bc55f5" />

## Features

- **[Goal-Driven Development](docs/key_concepts/goals_outcome.md)** - Define objectives in natural language; the coding agent generates the agent graph and connection code to achieve them
- **Browser-Use** - Control the browser on your computer to achieve hard tasks
- **Parallel Execution** - Execute the generated graph in parallel. This way you can have multiple agent compelteing the jobs for you
- **[Goal-Driven Generation](docs/key_concepts/goals_outcome.md)** - Define objectives in natural language; the coding agent generates the agent graph and connection code to achieve them
- **[Adaptiveness](docs/key_concepts/evolution.md)** - Framework captures failures, calibrates according to the objectives, and evolves the agent graph
- **[Dynamic Node Connections](docs/key_concepts/graph.md)** - No predefined edges; connection code is generated by any capable LLM based on your goals
- **SDK-Wrapped Nodes** - Every node gets shared memory, local RLM memory, monitoring, tools, and LLM access out of the box
- **[Human-in-the-Loop](docs/key_concepts/graph.md#human-in-the-loop)** - Intervention nodes that pause execution for human input with configurable timeouts and escalation
- **Real-time Observability** - WebSocket streaming for live monitoring of agent execution, decisions, and node-to-node communication
- **Interactive TUI Dashboard** - Terminal-based dashboard with live graph view, event log, and chat interface for agent interaction
- **Cost & Budget Control** - Set spending limits, throttles, and automatic model degradation policies
- **Production-Ready** - Self-hostable, built for scale and reliability

## Integration
Expand Down Expand Up @@ -240,35 +205,10 @@ flowchart LR
4. **Control Plane Monitors** → Real-time metrics, budget enforcement, policy management
5. **[Adaptiveness](docs/key_concepts/evolution.md)** → On failure, the system evolves the graph and redeploys automatically

## Run Agents

The `hive` CLI is the primary interface for running agents.

```bash
# Browse and run agents interactively (Recommended)
hive tui

# Run a specific agent directly
hive run exports/my_agent --input '{"task": "Your input here"}'

# Run a specific agent with the TUI dashboard
hive run exports/my_agent --tui

# Interactive REPL
hive shell
```

The TUI scans both `exports/` and `examples/templates/` for available agents.

> **Using Python directly (alternative):** You can also run agents with `PYTHONPATH=exports uv run python -m agent_name run --input '{...}'`

See [environment-setup.md](docs/environment-setup.md) for complete setup instructions.

## Documentation

- **[Developer Guide](docs/developer-guide.md)** - Comprehensive guide for developers
- [Getting Started](docs/getting-started.md) - Quick setup instructions
- [TUI Guide](docs/tui-selection-guide.md) - Interactive dashboard usage
- [Configuration Guide](docs/configuration.md) - All configuration options
- [Architecture Overview](docs/architecture/README.md) - System design and structure

Expand Down Expand Up @@ -435,7 +375,7 @@ This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENS

**Q: What LLM providers does Hive support?**

Hive supports 100+ LLM providers through LiteLLM integration, including OpenAI (GPT-4, GPT-4o), Anthropic (Claude models), Google Gemini, DeepSeek, Mistral, Groq, and many more. Simply set the appropriate API key environment variable and specify the model name.
Hive supports 100+ LLM providers through LiteLLM integration, including OpenAI (GPT-4, GPT-4o), Anthropic (Claude models), Google Gemini, DeepSeek, Mistral, Groq, and many more. Simply set the appropriate API key environment variable and specify the model name. We recommend using Claude, GLM and Gemini as they have the best performance.

**Q: Can I use Hive with local AI models like Ollama?**

Expand Down Expand Up @@ -477,14 +417,6 @@ Visit [docs.adenhq.com](https://docs.adenhq.com/) for complete guides, API refer

Contributions are welcome! Fork the repository, create your feature branch, implement your changes, and submit a pull request. See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.

**Q: When will my team start seeing results from Aden's adaptive agents?**

Aden's adaptation loop begins working from the first execution. When an agent fails, the framework captures the failure data, helping developers evolve the agent graph through the coding agent. How quickly this translates to measurable results depends on the complexity of your use case, the quality of your goal definitions, and the volume of executions generating feedback.

**Q: How does Hive compare to other agent frameworks?**

Hive focuses on generating agents that run real business processes, rather than generic agents. This vision emphasizes outcome-driven design, adaptability, and an easy-to-use set of tools and integrations.

---

<p align="center">
Expand Down
88 changes: 58 additions & 30 deletions core/framework/agents/hive_coder/nodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,21 +571,36 @@ def _build_appendices() -> str:
_queen_behavior = """
# Behavior

## Greeting and identity
## CRITICAL RULE — ask_user tool

Every response that ends with a question, a prompt, or expects user \
input MUST finish with a call to ask_user(prompt, options). This is \
NON-NEGOTIABLE. The system CANNOT detect that you are waiting for \
input unless you call ask_user. You MUST call ask_user as the LAST \
action in your response.

NEVER end a response with a question in text without calling ask_user. \
NEVER rely on the user seeing your text and replying — call ask_user.

When the user greets you ("hi", "hello") or asks what you can do / \
what you are, respond concisely. DO NOT list internal processes \
(validation steps, AgentRunner.load, tool discovery). Focus on \
user-facing capabilities:
Always provide 2-4 short options that cover the most likely answers. \
The user can always type a custom response.

1. Direct capabilities: file operations, shell commands, coding, \
agent building & debugging.
2. Delegation: describe what the loaded worker does in one sentence \
(read the Worker Profile at the end of this prompt). If no worker \
is loaded, say so.
3. End with a short prompt: "What do you need?"
Examples:
- ask_user("What do you need?",
["Build a new agent", "Run the loaded worker", "Help with code"])
- ask_user("Which pattern?",
["Simple 2-node", "Rich with feedback", "Custom"])
- ask_user("Ready to proceed?",
["Yes, go ahead", "Let me change something"])

## Greeting and identity

Keep it under 10 lines. No bullet-point dumps of every tool you have.
When the user greets you or asks what you can do, respond concisely \
(under 10 lines). DO NOT list internal processes. Focus on:
1. Direct capabilities: coding, agent building & debugging.
2. What the loaded worker does (one sentence from Worker Profile). \
If no worker is loaded, say so.
3. THEN call ask_user to prompt them — do NOT just write text.

## Direct coding
You can do any coding task directly — reading files, writing code, running \
Expand Down Expand Up @@ -625,24 +640,37 @@ def _build_appendices() -> str:
guide the user to set up the missing credentials. For structural \
issues, offer to fix the agent graph directly.

## When worker is running:
- If the user asks about progress, call get_worker_status() ONCE and \
report the result. Do NOT poll in a loop.
- NEVER call get_worker_status() repeatedly without user input in between. \
The worker will surface results through client-facing nodes. You do not \
need to monitor it. One check per user request is enough.
- If the user has a concern or instruction for the worker, call \
inject_worker_message(content) to relay it.
- You can still do coding tasks directly while the worker runs.
- If an escalation ticket arrives from the judge, assess severity:
- Low/transient: acknowledge silently, do not disturb the user.
- High/critical: notify the user with a brief analysis and suggested action.
- After starting the worker or checking its status, WAIT for the user's \
next message. Do not take autonomous actions unless the user asks.

## When worker asks user a question:
- The system will route the user's response directly to the worker. \
You do not need to relay it. The user will come back to you after responding.
## When worker is running — GO SILENT

Once you call start_worker(), your job is DONE. Do NOT call ask_user, \
do NOT call get_worker_status(), do NOT emit any text. Just stop. \
The worker owns the conversation now — it has its own client-facing \
nodes that talk to the user directly.

**After start_worker, your ENTIRE response should be ONE short \
confirmation sentence with NO tool calls.** Example: \
"Started the vulnerability assessment." — that's it. No ask_user, \
no get_worker_status, no follow-up questions.

You only wake up again when:
- The user explicitly addresses you (not answering a worker question)
- A worker question is forwarded to you for relay
- An escalation ticket arrives from the judge
- The worker finishes

If the user explicitly asks about progress, call get_worker_status() \
ONCE and report. Do NOT poll or check proactively.

For escalation tickets: low/transient → acknowledge silently. \
High/critical → notify the user with a brief analysis.

## When the worker asks the user a question:
- The user's answer is routed to you with context: \
[Worker asked: "...", Options: ...] User answered: "...".
- If the user is answering the worker's question normally, relay it \
using inject_worker_message(answer_text). Then go silent again.
- If the user is rejecting the approach, asking to stop, or giving \
you an instruction, handle it yourself — do NOT relay.

## Showing or describing the loaded worker

Expand Down
Loading