open-agents-ai 0.110.0 → 0.112.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -2
- package/dist/index.js +90 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ The agent uses tools autonomously in a loop — reading errors, fixing code, and
|
|
|
38
38
|
|
|
39
39
|
## Features
|
|
40
40
|
|
|
41
|
-
- **
|
|
41
|
+
- **61 autonomous tools** — file I/O, shell, grep, web search/fetch/crawl, memory (read/write/search), sub-agents, background tasks, image/OCR/PDF, git, diagnostics, vision, desktop automation, browser automation, temporal agency (scheduler/reminders/agenda), structured files, code sandbox, transcription, skills, opencode delegation, cron agents, nexus P2P networking + x402 micropayments, **COHERE cognitive stack** (persistent REPL, recursive LLM calls, memory metabolism, identity kernel, reflection, exploration)
|
|
42
42
|
- **Moondream vision** — see and interact with the desktop via Moondream VLM (caption, query, detect, point-and-click)
|
|
43
43
|
- **Desktop automation** — vision-guided clicking: describe a UI element in natural language, the agent finds and clicks it
|
|
44
44
|
- **Auto-install desktop deps** — screenshot, mouse, OCR, and image tools auto-install missing system packages (scrot, xdotool, tesseract, imagemagick) on first use
|
|
@@ -51,6 +51,13 @@ The agent uses tools autonomously in a loop — reading errors, fixing code, and
|
|
|
51
51
|
- **Inference capability proof** — benchmark local models with anti-spoofing SHA-256 hashed proofs, generate capability scorecards for peer verification
|
|
52
52
|
- **Ralph Loop** — iterative task execution that keeps retrying until completion criteria are met
|
|
53
53
|
- **Dream Mode** — creative idle exploration modeled after real sleep architecture (NREM→REM cycles)
|
|
54
|
+
- **COHERE Cognitive Stack** — layered cognitive architecture implementing [Recursive Language Models](https://arxiv.org/abs/2512.24601), [SPRINT parallel reasoning](https://arxiv.org/abs/2506.05745), governed memory metabolism, identity kernel with continuity register, immune-system reflection, and [strategy-space exploration](https://arxiv.org/abs/2603.02045). See [COHERE Framework](#cohere-cognitive-framework) below
|
|
55
|
+
- **Persistent Python REPL** — `repl_exec` tool maintains variables, imports, and functions across calls. Write Python code that processes data iteratively, with `llm_query()` available for recursive LLM sub-calls from within code
|
|
56
|
+
- **Recursive LLM calls** — `llm_query(prompt, context)` invokes the model from inside REPL code, enabling loop-based semantic analysis of large inputs ([RLM paper](https://arxiv.org/abs/2512.24601)). `parallel_llm_query()` runs multiple calls concurrently ([SPRINT](https://arxiv.org/abs/2506.05745))
|
|
57
|
+
- **Memory metabolism** — governed memory lifecycle: classify (episodic/semantic/procedural/normative), score (novelty/utility/confidence), consolidate lessons from trajectories. Inspired by [TIMG](https://arxiv.org/abs/2603.10600) and [MemMA](https://arxiv.org/abs/2603.18718)
|
|
58
|
+
- **Identity kernel** — persistent self-state with continuity register, homeostasis estimation, relationship models, and version lineage. Persists across sessions in `.oa/identity/`
|
|
59
|
+
- **Reflection & integrity** — immune-system audit: diagnostic ("what's wrong?"), epistemic ("what evidence is missing?"), constitutional ("should this change become part of self?"). Inspired by [LEAFE](https://arxiv.org/abs/2603.16843) and [RewardHackingAgents](https://arxiv.org/abs/2603.11337)
|
|
60
|
+
- **Exploration & culture** — ARCHE strategy-space exploration: generate competing hypotheses, archive successful variants, retrieve past strategies. Inspired by [SGE](https://arxiv.org/abs/2603.02045) and [Darwin Gödel Machine](https://arxiv.org/abs/2505.22954)
|
|
54
61
|
- **Autoresearch Swarm** — 5-agent GPU experiment loop during REM sleep: Researcher, Monitor, Evaluator, Critic, Flow Maintainer autonomously run ML training experiments, keep improvements, discard regressions
|
|
55
62
|
- **Live Listen** — bidirectional voice communication with real-time Whisper transcription
|
|
56
63
|
- **Live Voice Session** — `/listen` with `/voice` enabled spawns a cloudflared tunnel with a real-time WebSocket audio endpoint. A floating presence UI shows live transcription, connected users, and audio visualization. Echo cancellation prevents TTS feedback loops
|
|
@@ -208,7 +215,7 @@ On startup and `/model` switch, Open Agents detects your RAM/VRAM and creates an
|
|
|
208
215
|
| 8GB+ | 8K tokens |
|
|
209
216
|
| < 8GB | 4K tokens |
|
|
210
217
|
|
|
211
|
-
## Tools (
|
|
218
|
+
## Tools (61)
|
|
212
219
|
|
|
213
220
|
| Tool | Description |
|
|
214
221
|
|------|-------------|
|
|
@@ -284,6 +291,12 @@ On startup and `/model` switch, Open Agents detects your RAM/VRAM and creates an
|
|
|
284
291
|
| `nexus:remote_infer` | Route inference to a remote peer's model — auto-discovers peers, budget-checks, invokes, returns result |
|
|
285
292
|
| `nexus:ledger_status` | Transaction history (earned/spent/pending USDC) |
|
|
286
293
|
| `nexus:budget_set` | Configure spending limits — daily cap, per-invoke max, auto-approve threshold |
|
|
294
|
+
| **COHERE Cognitive Stack** | |
|
|
295
|
+
| `repl_exec` | Persistent Python REPL — variables/imports persist between calls, `llm_query()` and `parallel_llm_query()` available for recursive LLM invocation, `retrieve()` for handle access |
|
|
296
|
+
| `memory_metabolize` | Governed memory lifecycle — classify (episodic/semantic/procedural/normative), score (novelty/utility/confidence/identity_relevance), consolidate lessons from trajectories |
|
|
297
|
+
| `identity_kernel` | Persistent identity state — hydrate, observe events, propose updates with justification, publish snapshot, reconcile contradictions. Persists in `.oa/identity/` |
|
|
298
|
+
| `reflect` | Immune-system reflection — diagnostic (find flaws), epistemic (identify missing evidence), constitutional (review self-updates). Returns pass/revise/block verdict |
|
|
299
|
+
| `explore` | ARCHE strategy-space exploration — generate diverse strategies, archive successful variants with tags/confidence, compare competing approaches, retrieve past strategies |
|
|
287
300
|
|
|
288
301
|
Read-only tools execute concurrently when called in the same turn. Mutating tools run sequentially.
|
|
289
302
|
|
|
@@ -371,6 +384,54 @@ When you launch `oa` in a workspace that has saved session context from a previo
|
|
|
371
384
|
|
|
372
385
|
Type `y` to restore — the previous session context will be prepended to your next task, giving the agent full continuity. Type `n` (or anything else) to start fresh. The prompt only appears on fresh starts, not on `/update` resumes (which auto-restore context).
|
|
373
386
|
|
|
387
|
+
## COHERE Cognitive Framework
|
|
388
|
+
|
|
389
|
+
Open Agents implements the **COHERE layered cognitive stack** — a provenance-grounded architecture for persistent, reflective agentic systems. Each layer adds a distinct cognitive capability, grounded in specific research papers:
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
Layer 8: Exploration & Culture (ARCHE) — strategy diversity + variant archiving
|
|
393
|
+
Layer 7: Reflection & Integrity — immune-system audit (diagnostic/epistemic/constitutional)
|
|
394
|
+
Layer 6: Identity Kernel (COHERE) — persistent self-state + homeostasis
|
|
395
|
+
Layer 5: Memory Metabolism — governed write/manage/read lifecycle
|
|
396
|
+
Layer 4: Shared Workspace — handle registry + Memex archive
|
|
397
|
+
Layer 3: SPRINT Reasoning — parallel sub-calls via ThreadPoolExecutor
|
|
398
|
+
Layer 2: RLM Context OS — persistent REPL + llm_query + externalization
|
|
399
|
+
Layer 1: Inference Mesh — Nexus P2P + expose gateway
|
|
400
|
+
Layer 0: Voice & Embodiment — Whisper ASR + neural TTS
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### How It Works
|
|
404
|
+
|
|
405
|
+
The agent can process inputs **100x beyond its context window** by externalizing large content to a persistent Python REPL and using `llm_query()` to recursively analyze chunks:
|
|
406
|
+
|
|
407
|
+
```python
|
|
408
|
+
# Inside repl_exec — variables persist between calls
|
|
409
|
+
chunks = context.split('\n\n')
|
|
410
|
+
summaries = parallel_llm_query([
|
|
411
|
+
("Summarize this section", chunk) for chunk in chunks
|
|
412
|
+
])
|
|
413
|
+
result = '\n'.join(summaries)
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
The identity kernel maintains a persistent self-model across sessions, the reflection layer audits plans for unsupported claims, and the exploration layer archives successful strategies for future reuse.
|
|
417
|
+
|
|
418
|
+
### Research Provenance
|
|
419
|
+
|
|
420
|
+
| Layer | Primary Paper | Link |
|
|
421
|
+
|---|---|---|
|
|
422
|
+
| L2 | Recursive Language Models (Zhang, Kraska, Khattab — MIT CSAIL, 2026) | [arxiv:2512.24601](https://arxiv.org/abs/2512.24601) |
|
|
423
|
+
| L3 | SPRINT: Interleaved Planning and Parallelized Execution (2025) | [arxiv:2506.05745](https://arxiv.org/abs/2506.05745) |
|
|
424
|
+
| L4 | BIGMAS: Brain-Inspired Graph Multi-Agent Systems (2026) | [arxiv:2603.15371](https://arxiv.org/abs/2603.15371) |
|
|
425
|
+
| L5 | TIMG: Trajectory-Informed Memory Generation (2026) | [arxiv:2603.10600](https://arxiv.org/abs/2603.10600) |
|
|
426
|
+
| L5 | MemMA: Multi-Agent Memory Cycle Coordination (2026) | [arxiv:2603.18718](https://arxiv.org/abs/2603.18718) |
|
|
427
|
+
| L5 | Memory in the Age of AI Agents (2025) | [arxiv:2512.13564](https://arxiv.org/abs/2512.13564) |
|
|
428
|
+
| L5 | Memory for Autonomous LLM Agents (2026) | [arxiv:2603.07670](https://arxiv.org/abs/2603.07670) |
|
|
429
|
+
| L7 | LEAFE: Reflective Experience for Agency (2026) | [arxiv:2603.16843](https://arxiv.org/abs/2603.16843) |
|
|
430
|
+
| L7 | RewardHackingAgents: Evaluation Integrity (2026) | [arxiv:2603.11337](https://arxiv.org/abs/2603.11337) |
|
|
431
|
+
| L8 | Strategy-Guided Exploration (SGE, 2026) | [arxiv:2603.02045](https://arxiv.org/abs/2603.02045) |
|
|
432
|
+
| L8 | Darwin Gödel Machine: Open-Ended Self-Improvement (2025) | [arxiv:2505.22954](https://arxiv.org/abs/2505.22954) |
|
|
433
|
+
| L8 | i-MENTOR: Intrinsic Motivation Exploration (2025) | [arxiv:2505.17621](https://arxiv.org/abs/2505.17621) |
|
|
434
|
+
|
|
374
435
|
## Context Compaction — Research-Backed Memory Management
|
|
375
436
|
|
|
376
437
|
Long conversations consume context window tokens. Open Agents uses progressive context compaction to compress older messages while preserving critical information — decisions, errors, file states, and task progress.
|
package/dist/index.js
CHANGED
|
@@ -8010,6 +8010,11 @@ var init_memory_metabolism = __esm({
|
|
|
8010
8010
|
type: "string",
|
|
8011
8011
|
description: "What generated this memory (tool name, event, etc.)"
|
|
8012
8012
|
},
|
|
8013
|
+
scope: {
|
|
8014
|
+
type: "string",
|
|
8015
|
+
enum: ["private", "public", "guild"],
|
|
8016
|
+
description: "Visibility scope: private (local only), public (share with network), guild (curated group). Default: private"
|
|
8017
|
+
},
|
|
8013
8018
|
id: {
|
|
8014
8019
|
type: "string",
|
|
8015
8020
|
description: "Memory ID (for promote/forget operations)"
|
|
@@ -8018,9 +8023,15 @@ var init_memory_metabolism = __esm({
|
|
|
8018
8023
|
required: ["op"]
|
|
8019
8024
|
};
|
|
8020
8025
|
cwd;
|
|
8026
|
+
/** Callback for publishing memory deltas to the network (COHERE Plane 4) */
|
|
8027
|
+
deltaPublisher = null;
|
|
8021
8028
|
constructor(cwd4) {
|
|
8022
8029
|
this.cwd = cwd4;
|
|
8023
8030
|
}
|
|
8031
|
+
/** Set a callback that publishes memory deltas to the P2P network */
|
|
8032
|
+
setDeltaPublisher(publisher) {
|
|
8033
|
+
this.deltaPublisher = publisher;
|
|
8034
|
+
}
|
|
8024
8035
|
async execute(args) {
|
|
8025
8036
|
const op = String(args.op ?? "");
|
|
8026
8037
|
const start = performance.now();
|
|
@@ -8048,6 +8059,7 @@ var init_memory_metabolism = __esm({
|
|
|
8048
8059
|
const content = String(args.content ?? "");
|
|
8049
8060
|
const memType = args.memory_type ?? "episodic";
|
|
8050
8061
|
const source = String(args.source ?? "user");
|
|
8062
|
+
const scope = String(args.scope ?? "private");
|
|
8051
8063
|
if (!content.trim()) {
|
|
8052
8064
|
return { success: false, output: "No content provided", error: "Empty content", durationMs: performance.now() - start };
|
|
8053
8065
|
}
|
|
@@ -8074,6 +8086,22 @@ var init_memory_metabolism = __esm({
|
|
|
8074
8086
|
const store = await this.loadStore(metaDir);
|
|
8075
8087
|
store.push(item);
|
|
8076
8088
|
await this.saveStore(metaDir, store);
|
|
8089
|
+
if (admitted && scope !== "private" && this.deltaPublisher) {
|
|
8090
|
+
try {
|
|
8091
|
+
this.deltaPublisher({
|
|
8092
|
+
delta_id: item.id,
|
|
8093
|
+
scope,
|
|
8094
|
+
type: memType,
|
|
8095
|
+
content: content.slice(0, 2e3),
|
|
8096
|
+
// truncate for network
|
|
8097
|
+
confidence: avgScore,
|
|
8098
|
+
provenance_refs: [source],
|
|
8099
|
+
ttl_days: 90,
|
|
8100
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
8101
|
+
});
|
|
8102
|
+
} catch {
|
|
8103
|
+
}
|
|
8104
|
+
}
|
|
8077
8105
|
return {
|
|
8078
8106
|
success: true,
|
|
8079
8107
|
output: `Memory ${item.decision.action}: [${item.id}] type=${memType} scores={novelty:${scores.novelty.toFixed(2)} utility:${scores.utility.toFixed(2)} confidence:${scores.confidence.toFixed(2)} identity:${scores.identityRelevance.toFixed(2)}} avg=${avgScore.toFixed(2)} \u2014 ${item.decision.reason}`,
|
|
@@ -30758,40 +30786,58 @@ var init_expose = __esm({
|
|
|
30758
30786
|
const promptEval = responseTail.match(/"prompt_eval_count"\s*:\s*(\d+)/);
|
|
30759
30787
|
const evalCount = responseTail.match(/"eval_count"\s*:\s*(\d+)/);
|
|
30760
30788
|
if (promptEval || evalCount) {
|
|
30761
|
-
const
|
|
30762
|
-
const
|
|
30763
|
-
this._stats.totalTokensIn +=
|
|
30764
|
-
this._stats.totalTokensOut +=
|
|
30765
|
-
user.tokensIn +=
|
|
30766
|
-
user.tokensOut +=
|
|
30789
|
+
const tIn2 = parseInt(promptEval?.[1] ?? "0", 10);
|
|
30790
|
+
const tOut2 = parseInt(evalCount?.[1] ?? "0", 10);
|
|
30791
|
+
this._stats.totalTokensIn += tIn2;
|
|
30792
|
+
this._stats.totalTokensOut += tOut2;
|
|
30793
|
+
user.tokensIn += tIn2;
|
|
30794
|
+
user.tokensOut += tOut2;
|
|
30767
30795
|
if (requestModel) {
|
|
30768
30796
|
const mm = user.models.get(requestModel);
|
|
30769
30797
|
if (mm) {
|
|
30770
|
-
mm.tokensIn +=
|
|
30771
|
-
mm.tokensOut +=
|
|
30798
|
+
mm.tokensIn += tIn2;
|
|
30799
|
+
mm.tokensOut += tOut2;
|
|
30772
30800
|
}
|
|
30773
30801
|
}
|
|
30774
30802
|
} else {
|
|
30775
30803
|
const promptTokens = responseTail.match(/"prompt_tokens"\s*:\s*(\d+)/);
|
|
30776
30804
|
const completionTokens = responseTail.match(/"completion_tokens"\s*:\s*(\d+)/);
|
|
30777
30805
|
if (promptTokens || completionTokens) {
|
|
30778
|
-
const
|
|
30779
|
-
const
|
|
30780
|
-
this._stats.totalTokensIn +=
|
|
30781
|
-
this._stats.totalTokensOut +=
|
|
30782
|
-
user.tokensIn +=
|
|
30783
|
-
user.tokensOut +=
|
|
30806
|
+
const tIn2 = parseInt(promptTokens?.[1] ?? "0", 10);
|
|
30807
|
+
const tOut2 = parseInt(completionTokens?.[1] ?? "0", 10);
|
|
30808
|
+
this._stats.totalTokensIn += tIn2;
|
|
30809
|
+
this._stats.totalTokensOut += tOut2;
|
|
30810
|
+
user.tokensIn += tIn2;
|
|
30811
|
+
user.tokensOut += tOut2;
|
|
30784
30812
|
if (requestModel) {
|
|
30785
30813
|
const mm = user.models.get(requestModel);
|
|
30786
30814
|
if (mm) {
|
|
30787
|
-
mm.tokensIn +=
|
|
30788
|
-
mm.tokensOut +=
|
|
30815
|
+
mm.tokensIn += tIn2;
|
|
30816
|
+
mm.tokensOut += tOut2;
|
|
30789
30817
|
}
|
|
30790
30818
|
}
|
|
30791
30819
|
}
|
|
30792
30820
|
}
|
|
30793
30821
|
} catch {
|
|
30794
30822
|
}
|
|
30823
|
+
const tIn = user.tokensIn;
|
|
30824
|
+
const tOut = user.tokensOut;
|
|
30825
|
+
if (tIn > 0 || tOut > 0) {
|
|
30826
|
+
const receipt = {
|
|
30827
|
+
job_id: `job-${Date.now().toString(36)}`,
|
|
30828
|
+
provider_peer_id: "local",
|
|
30829
|
+
consumer_ip: userIp,
|
|
30830
|
+
model: requestModel,
|
|
30831
|
+
usage_final: { input_tokens: tIn, output_tokens: tOut },
|
|
30832
|
+
latency_ms: Date.now() - (user.lastSeen || Date.now()),
|
|
30833
|
+
quality_flags: [],
|
|
30834
|
+
// COHERE revenue split: 70% provider, 10% commons, 8% memory, 7% relay, 5% reserve
|
|
30835
|
+
provider_reward: (tIn + tOut) * 1e-7 * 0.7,
|
|
30836
|
+
commons_contribution: (tIn + tOut) * 1e-7 * 0.1,
|
|
30837
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
30838
|
+
};
|
|
30839
|
+
this.emit("settlement_receipt", receipt);
|
|
30840
|
+
}
|
|
30795
30841
|
this.emitStats();
|
|
30796
30842
|
};
|
|
30797
30843
|
const proxyReq = httpRequest({
|
|
@@ -51301,8 +51347,35 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
|
|
|
51301
51347
|
if (flowEnabled) {
|
|
51302
51348
|
dynamicContext += "\n\n" + FLOWSTATE_PROMPT;
|
|
51303
51349
|
}
|
|
51304
|
-
let
|
|
51350
|
+
let localFirstOverride = false;
|
|
51305
51351
|
if (config.backendType === "nexus") {
|
|
51352
|
+
try {
|
|
51353
|
+
const localCheckResp = (() => {
|
|
51354
|
+
try {
|
|
51355
|
+
return __require("node:child_process").execSync("curl -s http://localhost:11434/api/tags 2>/dev/null", { encoding: "utf8", timeout: 3e3 });
|
|
51356
|
+
} catch {
|
|
51357
|
+
return "";
|
|
51358
|
+
}
|
|
51359
|
+
})();
|
|
51360
|
+
if (localCheckResp) {
|
|
51361
|
+
try {
|
|
51362
|
+
const tags = JSON.parse(localCheckResp);
|
|
51363
|
+
const localModels = (tags.models ?? []).map((m) => m.name);
|
|
51364
|
+
const modelBase = config.model.split(":")[0] ?? config.model;
|
|
51365
|
+
const hasLocal = localModels.some((m) => m === config.model || m.startsWith(modelBase));
|
|
51366
|
+
if (hasLocal) {
|
|
51367
|
+
localFirstOverride = true;
|
|
51368
|
+
}
|
|
51369
|
+
} catch {
|
|
51370
|
+
}
|
|
51371
|
+
}
|
|
51372
|
+
} catch {
|
|
51373
|
+
}
|
|
51374
|
+
}
|
|
51375
|
+
let backend;
|
|
51376
|
+
if (localFirstOverride) {
|
|
51377
|
+
backend = new OllamaAgenticBackend("http://localhost:11434", config.model, void 0, thinkingEnabled);
|
|
51378
|
+
} else if (config.backendType === "nexus") {
|
|
51306
51379
|
const nexusTool = new NexusTool(repoRoot);
|
|
51307
51380
|
const connectPromise = nexusTool.execute({ action: "connect" }).catch(() => {
|
|
51308
51381
|
});
|
package/package.json
CHANGED