Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ The `ai-agents/` directory contains autonomous AI agents that run inside LimaCha

**Manually**: See each agent's README for step-by-step instructions.

### Running Agents from the CLI

Once deployed, the same `ai_agent` Hive record can be invoked ad-hoc from the LimaCharlie CLI as a **template**, with per-run overrides for prompt, model, budget, tools, environment, and credentials:

```bash
# Start a run of the deployed agent with a cheaper budget.
limacharlie ai start-session --definition l1-bot --max-budget-usd 0.50

# Attach and stream the agent's output live.
limacharlie ai session attach --id <SESSION_ID>
```

See the [CLI reference](https://docs.limacharlie.io/9-ai-sessions/cli/) for the full command set.

## Repository Structure

```
Expand Down
39 changes: 39 additions & 0 deletions ai-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,42 @@ Unlike D&R suppression which silently drops excess requests, debounce guarantees
## Installation

Use the `lc-deployer` skill from the [lc-essentials](../marketplace/plugins/lc-essentials/) plugin to install and remove agents.

## Running Agents Manually from the CLI

Once an `ai_agent.yaml` is deployed to a Hive, the same definition can be invoked ad-hoc from the LimaCharlie CLI without waiting for a D&R event. The Hive record is treated as a **template** — individual fields (prompt, model, budget, tools, environment, credentials) can be overridden for a single run.

```bash
# Run the deployed agent as-is.
limacharlie ai start-session --definition l1-bot

# Swap the prompt for an ad-hoc question, keep everything else from the template.
limacharlie ai start-session --definition l1-bot \
--prompt "Investigate sensor srv-01 for persistence mechanisms"

# Cap cost and lower max turns for a cheap exploratory run.
limacharlie ai start-session --definition l1-bot \
--max-budget-usd 0.50 --max-turns 10

# Provide the data the agent would normally get from a D&R event.
limacharlie ai start-session --definition l1-bot \
--data '{"hostname": "srv-01", "alert_id": "abc-123"}'
```

Scalars and lists replace the template value. `--env KEY=VALUE` (repeatable) merges with the template's environment, with the override winning on key collisions. Override values may be literal strings or `hive://secret/<name>` references — the same syntax the YAML uses.

To watch what the agent does in real time, attach to the returned session:

```bash
limacharlie ai session attach --id <SESSION_ID>
```

Or start and attach in one step:

```bash
SID=$(limacharlie ai start-session --definition l1-bot \
--output json | jq -r '.session_id')
limacharlie ai session attach --id "$SID"
```

`attach` streams these org-owned sessions in **read-only** mode (the agent runs on its own; you are observing). For an interactive terminal chat with Claude — separate from any deployed agent, billed against your own Claude credential — see `limacharlie ai chat` in the [CLI reference](https://docs.limacharlie.io/9-ai-sessions/cli/#limacharlie-ai-chat).