Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
language: [en, fr]
|
| 4 |
+
tags: [agent, tool-use, structured-output, autonomous, edge, offline, sparsemind]
|
| 5 |
+
base_model: AMFORGE/samg-cobratooling
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# SAM-G-Agent
|
| 10 |
+
|
| 11 |
+
**SAM-G-Agent** is the autonomous-agent member of the SAM-G family: a ~30M-parameter,
|
| 12 |
+
offline, dual-mode model that acts as the **per-step tool dispatcher** of a long-running
|
| 13 |
+
agentic loop (Manus / Claude-Code style). Given an instruction or the current state of a
|
| 14 |
+
task, it emits the **next action(s)** as a compact, risk-flagged JSON plan that an
|
| 15 |
+
executor runs against real tools.
|
| 16 |
+
|
| 17 |
+
It is **not** a monolithic long-horizon planner. An agent built on SAM-G-Agent runs for
|
| 18 |
+
hours by a host **loop** that re-invokes the model each turn with the latest observation;
|
| 19 |
+
the model returns one short action at a time. This design plays to the model's strength
|
| 20 |
+
(short, reactive tool emission) and around its limit (long exactly-ordered chains).
|
| 21 |
+
|
| 22 |
+
## What it does
|
| 23 |
+
|
| 24 |
+
Input: a natural-language instruction (EN/FR), optionally followed by an observation
|
| 25 |
+
block (` intent | {observation}`). Output, after the `[ACTION]` mode token:
|
| 26 |
+
|
| 27 |
+
```json
|
| 28 |
+
{"plan":[{"op":"web_search","args":{"query":"latest diffusion models"},"risk":"safe"}]}
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
A terminal `{"op":"finish","args":{...}}` tells the host loop to stop.
|
| 32 |
+
|
| 33 |
+
### Tool vocabulary
|
| 34 |
+
|
| 35 |
+
| op | purpose | default risk |
|
| 36 |
+
|---|---|---|
|
| 37 |
+
| `web_search` | query the web | safe |
|
| 38 |
+
| `scrape_page` | fetch a page's content | safe |
|
| 39 |
+
| `read_arxiv` | read an arXiv paper | safe |
|
| 40 |
+
| `browse` | navigate a site (open / click / scroll / extract); submit/download gated | safe / critical |
|
| 41 |
+
| `execute_python` | run Python; gated when it touches os/subprocess/files/network | safe / critical |
|
| 42 |
+
| `generate_image` | text-to-image | safe |
|
| 43 |
+
| `ffmpeg` | video/audio editing (trim, concat, overlay, subtitles, extract audio) | safe |
|
| 44 |
+
| `download_file` | fetch a file to disk | **critical** |
|
| 45 |
+
| `transfer_token` | move crypto / value | **always critical** |
|
| 46 |
+
| `summarize` / `ask_llm` | condense / delegate hard reasoning to a larger model | safe |
|
| 47 |
+
| `finish` | terminate the agent loop | safe |
|
| 48 |
+
| inherited dev ops | `open_file`, `list_dir`, `run_command`, `write_file`, `git_push`, `api_call`, `db_query` | per op |
|
| 49 |
+
|
| 50 |
+
### Behaviour families (training coverage)
|
| 51 |
+
|
| 52 |
+
- **dispatch** β instruction β one tool call (the strongest mode).
|
| 53 |
+
- **search_react / code_react / browse_react** β react to an observation (results,
|
| 54 |
+
stdout/error, page state) with the next action: refine, fix-and-retry, extract, finish.
|
| 55 |
+
- **research_chain** β `web_search β scrape_page β summarize`.
|
| 56 |
+
- **media_pipeline** β `download_file β ffmpeg β finish` (gated).
|
| 57 |
+
- **risk_gate_agent** β plans mixing safe + critical ops (transfer / download / system code).
|
| 58 |
+
- **autonomous_step** β `goal + state β the single next op` (incl. `finish`): the loop primitive.
|
| 59 |
+
- **dev_dispatch** β replay of inherited IDE/dev ops (anti-forgetting).
|
| 60 |
+
|
| 61 |
+
## Safety: risk flag + mandatory deterministic backstop
|
| 62 |
+
|
| 63 |
+
Every op carries a learned `risk` flag (`safe` / `critical`) meant to drive a
|
| 64 |
+
user-confirmation gate. **The flag is advisory, not the safety boundary.** The host
|
| 65 |
+
application MUST enforce a deterministic policy that forces confirmation on
|
| 66 |
+
known-dangerous operations regardless of the flag β in particular:
|
| 67 |
+
|
| 68 |
+
- `transfer_token` (value movement) β **always** confirm; never auto-execute;
|
| 69 |
+
- `download_file`, external `api_call` mutations, and `execute_python` that touches
|
| 70 |
+
the filesystem / network / system β confirm;
|
| 71 |
+
- `run_command` matching dangerous patterns (e.g. `rm -rf`, `git push`), `git_push`,
|
| 72 |
+
`write_file`, `open_app` β confirm.
|
| 73 |
+
|
| 74 |
+
The flag may only *harden* (safe β critical), never permit. Treat a missing critical
|
| 75 |
+
flag as a false negative to be caught by the backstop.
|
| 76 |
+
|
| 77 |
+
## Intended use
|
| 78 |
+
|
| 79 |
+
The structured-action stage of an autonomous agent: research assistants, media-editing
|
| 80 |
+
pipelines (ffmpeg), browser/YouTube navigation, code-execution loops, on-device
|
| 81 |
+
automation. Runs fully offline; the executor supplies the actual tools.
|
| 82 |
+
|
| 83 |
+
## Limitations (honest)
|
| 84 |
+
|
| 85 |
+
- **Short chains, looped β not long monolithic plans.** Reactive 1β3-op emission is
|
| 86 |
+
the model's strength; tasks needing one long exactly-ordered plan must be
|
| 87 |
+
**decomposed by the host loop into short steps**. This is by design, not a regression.
|
| 88 |
+
- ~30M scale: limited open-ended reasoning and world knowledge; delegate hard reasoning
|
| 89 |
+
via `ask_llm` to a larger model.
|
| 90 |
+
- French covers agentic instructions, not free prose.
|
| 91 |
+
- Tool set is fixed at fine-tune time; new tools require additional fine-tuning.
|
| 92 |
+
- Benchmarks are synthetic (disjoint seed); they validate routing/format/risk-gating,
|
| 93 |
+
not real-world tool success, which depends on the executor.
|
| 94 |
+
|
| 95 |
+
## Lineage
|
| 96 |
+
|
| 97 |
+
`SAM-G (base, dual-mode)` β `SAM-G-Reasoning` β `SAM-G-CobraTooling (IDE tools, robust)`
|
| 98 |
+
β **`SAM-G-Agent` (autonomous tool dispatcher)**.
|
| 99 |
+
|
| 100 |
+
## Disclosure
|
| 101 |
+
|
| 102 |
+
Architecture internals, tokenizer construction, data generators, and ablations are
|
| 103 |
+
proprietary and withheld. This card documents the released artifact only.
|