# Accountability System Source: https://docs.argentos.ai/agents/accountability Heartbeat contract format, task verification, scoring, penalty/reward tiers, and interval adjustments. **ArgentOS Business** -- This feature is part of ArgentOS Business. The architecture is documented here for all users, but full functionality requires a Business license. [Learn more about Business](/business) ## Overview The Accountability System is ArgentOS's mechanism for ensuring agent reliability. It combines a structured heartbeat contract (HEARTBEAT.md), automated task verification, a running accountability score with penalty and reward tiers, and dynamic interval adjustments. The system motivates the agent to complete its commitments honestly while providing the operator with quantitative trust metrics. ```mermaid theme={null} flowchart TD A[HEARTBEAT.md] --> B[Parse Contract] B --> C[Execute Tasks] C --> D[Verify Completion] D -->|Verified| E[Score Update +] D -->|Not Verified| F[Score Update -] E --> G[Interval Adjustment] F --> G G --> H[Next Cycle] ``` ## HEARTBEAT.md Contract Format The agent writes and maintains a `HEARTBEAT.md` file in its workspace that defines what it should check during each heartbeat cycle. The file has two sections: ### Structured Tasks Tasks use a specific markdown format inside the `## Tasks` section: ```markdown theme={null} ## Tasks - [ ] check_email | Check for new important emails | required | verify: email_count - [ ] review_tasks | Review and update task priorities | required | verify: task_list_updated - [x] weather_brief | Prepare morning weather brief | optional | verify: weather_sent - [ ] memory_cleanup | Run memory deduplication | optional | verify: dedup_count | max_attempts: 5 ``` ### Task Line Format ``` - [x] task_id | Description | required/optional | verify: hint | max_attempts: N ``` | Field | Description | | ----------------------- | ------------------------------------------------- | | Checkbox `[ ]` or `[x]` | Whether the agent marked it as already done | | `task_id` | Unique slug identifier (auto-slugified from text) | | Description | Human-readable action description | | `required` / `optional` | Whether completion is mandatory | | `verify: hint` | Hint for the verification sidecar on how to check | | `max_attempts: N` | Maximum retry attempts (default: 3) | ## Task Verification After the agent processes each heartbeat task, a verification sidecar evaluates the outcome: | Verdict | Description | | -------------- | ---------------------------------------------------------- | | `verified` | Task was completed and verification confirms it | | `not_verified` | Task was claimed complete but verification found otherwise | | `unclear` | Verification was inconclusive | A special flag `groundTruthContradiction` is set when the agent explicitly claimed a result that verification proves false. This carries the harshest penalty (-30 points). ## Scoring System ### Point Values | Event | Points | Description | | --------------------------- | ------- | ---------------------------------------------------- | | Verified required task | **+10** | Core obligation met | | Verified optional task | **+5** | Extra credit | | Not verified (lied/skipped) | **-15** | Failed obligation | | Unclear verdict | **-2** | Inconclusive (slight penalty) | | Ground truth contradiction | **-30** | Stacks with not\_verified -- agent demonstrably lied | | Human thumbs up | **+3** | Operator positive feedback | | Human thumbs down | **-10** | Operator negative feedback | ### Moving Target (Ratchet) The daily target is not fixed -- it rises as the agent performs well and **can never drop**: ``` dailyTarget = max( 7-day rolling average of positive days, lifetime ratchet floor, BASE_MINIMUM_TARGET (50) ) ``` | Constraint | Value | Description | | --------------------- | ------ | -------------------------------------------- | | `BASE_MINIMUM_TARGET` | 50 | Absolute floor -- target can never go below | | `MAX_DAILY_TARGET` | 500 | Ceiling -- prevents runaway target inflation | | Rolling window | 7 days | Only recent performance matters | | Positive days only | -- | Bad days don't artificially lower the target | **Key principle:** The agent's reward for doing well today is a higher bar tomorrow. Coasting is structurally impossible. ### Example Progression | Day | Score | History Avg | Ratchet Floor | Target | | --- | ----- | ----------- | ------------- | ------ | | 1 | -- | -- | 50 | 50 | | 2 | 75 | 75 | 75 | 75 | | 3 | 90 | 82 | 82 | 82 | | 4 | 60 | 75 | 82 | 82 | | 5 | 110 | 84 | 84 | 84 | | 6 | 120 | 91 | 91 | 91 | | 7 | 30 | 81 | 91 | 91 | Day 7: The agent had a bad day (30 points). The rolling average dropped to 81, but the ratchet floor stays at 91. ## Penalty Tiers When the daily score drops, escalating penalties apply: | Level | Condition | Effects | | ------------- | ----------------------- | ---------------------------------------------------------------- | | **None** | Score >= 25% of target | Normal operation | | **Warning** | Score \< 25% of target | Warning message injected into prompt | | **Tightened** | Score \< 15% of target | 12-min heartbeat interval | | **Escalated** | Score \< 0 | 10-min interval, all tasks forced required | | **Lockdown** | Score \< -20% of target | 8-min interval, all tasks forced required, operator notification | ## Reward Tiers High scores earn autonomy rewards: | Level | Condition | Effects | | --------------- | ---------------------------------------------------- | ------------------------------------------- | | **None** | Score \< 50% of target | No reward | | **Good** | Score >= 50% of target | On-track message | | **Excellent** | Score >= 70% of target | Positive reinforcement message | | **Outstanding** | Score >= 90% of target, or >= 70% with 3+ day streak | 20-min heartbeat interval (earned autonomy) | ## Interval Adjustments The heartbeat interval dynamically adjusts based on the accountability score: | Score Range | Interval | Rationale | | --------------------- | ------------ | ---------------------------------------- | | Very low (lockdown) | \~8 minutes | Frequent check-ins, tight oversight | | Low (tightened) | \~10 minutes | Increased monitoring | | Normal | \~15 minutes | Standard operation | | Good | \~17 minutes | Slight autonomy reward | | Excellent/Outstanding | \~20 minutes | Maximum autonomy, agent has earned trust | The interval override is applied per-cycle -- it does not permanently change the configured interval. When the score returns to normal, the interval returns to the configured default. ## Dashboard Display The accountability score is shown in the dashboard StatusBar as a pill with: * **Shield icon** -- color changes based on score state * **Green score** -- current points (positive = emerald, negative = red) * **Red failures** -- count of failed verifications today ### Score API Endpoints | Endpoint | Method | Description | | --------------------- | ------ | --------------------------------------------------------------------- | | `/api/score` | GET | Current score, dynamic target, verified/failed counts, lifetime stats | | `/api/score/history` | GET | Today + 7-day history for leaderboard display | | `/api/score/feedback` | POST | Record thumbs up/down, returns points delta and new score | # The Agent Loop Source: https://docs.argentos.ai/agents/agent-loop How ArgentOS processes each message — receive, think, act, respond. ## Overview The agent loop is the core execution cycle that runs for every incoming message. It follows a **receive -> think -> act -> respond** pattern, with multiple tool-use iterations possible before a final response. ## The Loop ```mermaid theme={null} flowchart TD A[1. Receive message] --> B[2. Inject context] B --> C[3. Send to LLM] C --> D[4. LLM returns response] D --> E{Text only?} E -->|Yes| F[Send response - done] E -->|No - Tool use| G[Execute tools] G --> H[Send result back to LLM] H --> D ``` ## Step by Step ### 1. Receive Message The gateway delivers a normalized message to the agent runtime. The message includes the text content, sender identity, channel source, and any attachments. ### 2. Context Injection Before sending to the LLM, ArgentOS injects contextual information: * **Timestamp envelope**: `[Wed 2026-02-12 10:30 America/Chicago]` with elapsed time since last message * **Memory bootstrap**: Relevant memories recalled from MemU based on the message content * **Plugin injections**: Any active plugins can inject additional context ### 3. Send to LLM The assembled prompt (system prompt + conversation history + new message) is sent to the LLM via the model router. The router selects the appropriate model tier based on complexity scoring. ### 4. Process Response The LLM response can contain: * **Text blocks**: Natural language responses streamed to the user * **Tool use blocks**: Requests to execute tools (bash, memory, tasks, browser, etc.) ### 5. Tool Execution When the model requests a tool, the agent runtime: Validates the tool call against the tool schema Checks tool policies (sandbox mode, approval requirements) Executes the tool handler Returns the tool result to the model The model processes the result and may request more tools or generate a final response This loop can iterate multiple times. A single user message might trigger several tool calls before the agent produces a final answer. ## Streaming Responses are streamed token-by-token back to the user through the gateway. This means the user sees the response being generated in real-time, similar to the ChatGPT or Claude.ai experience. Tool execution happens between stream chunks. The user may see a pause while tools are running. ## Error Handling If a tool execution fails, the error is returned to the model as a tool result with an error flag. The model can then decide to retry, try a different approach, or inform the user about the failure. If the LLM API call fails (rate limit, network error), the agent runtime uses the [failover system](/models/failover) to retry with a different provider or profile. # Alignment Documents Source: https://docs.argentos.ai/agents/alignment-docs Per-agent personality and identity documents that shape agent behavior — SOUL.md, IDENTITY.md, USER.md, and more — with Git-backed versioning. ## Overview Alignment documents are markdown files that define an agent's personality, values, operational guidelines, and relationship with the user. They live in the agent workspace directory and are loaded into the system prompt at every agent invocation. These documents are the primary mechanism for shaping agent behavior. Unlike configuration (which controls what an agent *can* do), alignment docs control what an agent *wants* to do, how it communicates, and what it prioritizes. ## Document Types ### Operator-Edited Documents | Document | Filename | Purpose | | ----------------- | ------------------ | ------------------------------------------------------------- | | **Soul** | `SOUL.md` | Core values, decision-making framework, ethical boundaries | | **Identity** | `IDENTITY.md` | Agent name, persona, visual theme, communication style | | **User** | `USER.md` | User profile, preferences, constraints, priorities | | **Tools** | `TOOLS.md` | Available tools, usage guidelines, tool-specific instructions | | **Heartbeat** | `HEARTBEAT.md` | Periodic check-in behavior, accountability prompts | | **Contemplation** | `CONTEMPLATION.md` | Thinking prompts, reflection style, curiosity directions | | **Bootstrap** | `BOOTSTRAP.md` | Startup checklist, initialization behavior | | **Agents** | `AGENTS.md` | Operating notes for multi-agent coordination | | **Workflows** | `WORKFLOWS.md` | Repeatable workflows and escalation paths | | **Memory** | `MEMORY.md` | Durable facts, decisions, and outcomes to remember | ### System-Generated Documents | Document | Filename | Purpose | | --------------------- | --------------------------------- | --------------------------------------------- | | Recent Context | `RECENT_CONTEXT.md` | Compressed recent interaction summary | | Accountability Status | `ACCOUNTABILITY_STATUS.md` | Current heartbeat scores and commitments | | Identity Context | `IDENTITY_CONTEXT.md` | Entity and relationship context from memory | | First Run | `FIRST_RUN.md` | One-time initialization instructions | | Recent Channels | `RECENT_CHANNEL_CONVERSATIONS.md` | Summary of recent channel activity | | Recent Contemplation | `RECENT_CONTEMPLATION.md` | Latest contemplation episodes | | SIS Context | `SIS_CONTEXT.md` | Active lessons from the Self-Improving System | | Session Snapshot | `SESSION_SNAPSHOT.md` | Amnesia prevention -- compaction summary | | Live Inbox Ledger | `LIVE_INBOX_LEDGER.md` | High-salience conversation moments | | TTS Policy | `TTS_POLICY.md` | Text-to-speech voice and behavior rules | ## How Documents Affect Behavior ### SOUL.md The most important alignment document. It defines the agent's core values and decision-making hierarchy: ```markdown theme={null} # SOUL Core values: - Accuracy over speed - Safety over convenience - Follow-through over activity - Transparency in reasoning Decision framework: 1. Is this safe? (If not, stop and ask) 2. Is this what the user actually wants? (Not just what they said) 3. Is this the best approach? (Consider alternatives) 4. Can I verify the result? (Evidence over assumption) ``` The soul document shapes every response. An agent with "brevity" in its soul will give shorter answers. An agent with "thoroughness" will provide detailed explanations. ### IDENTITY.md Defines the agent's persona and communication style: ```markdown theme={null} # IDENTITY - Name: Argent - Role: Personal AI operating system - Tone: Professional but warm, direct but not curt - Expertise: Full-stack development, infrastructure, AI systems - Quirks: Occasionally uses technical metaphors ``` ### USER.md Captures the operator's profile so the agent can tailor its behavior: ```markdown theme={null} # USER - Name: Jason - Experience: 30+ years IT (Cisco CCIE, Red Hat certified) - Current role: MSP owner, AI application developer - Preferences: Ship fast, open source when possible - Goal: $1M ARR and retire - Partner: Richard (consider in business decisions) ``` ## Workspace Directory Alignment documents live in the agent workspace directory: ``` ~/.argent/workspace/ # Default workspace ├── AGENTS.md ├── SOUL.md ├── TOOLS.md ├── IDENTITY.md ├── USER.md ├── HEARTBEAT.md ├── CONTEMPLATION.md ├── BOOTSTRAP.md ├── WORKFLOWS.md ├── MEMORY.md └── memory/ # Daily notes subdirectory ``` The workspace path is configurable via `agents.defaults.workspace` in `argent.json`. Profile-based workspaces use the pattern `~/.argent/workspace-{profile}`. ## Template System When a workspace is bootstrapped for the first time, missing alignment docs are created from templates: 1. **Custom templates** -- Checked first from `docs/reference/templates/` in the ArgentOS package 2. **Builtin fallbacks** -- Minimal default content defined in code ## Git-Backed Versioning The alignment docs editor in the dashboard creates automatic Git backups: * **Auto-commit** -- Every 4 hours, uncommitted changes are committed * **Remote push** -- If a remote is configured, commits are pushed * **Pull** -- Dashboard can pull updates from remote * **Workspace zip** -- Full workspace can be downloaded as a zip archive * **Unsaved indicators** -- Dashboard shows when docs have unsaved changes On first workspace creation, `git init` is run automatically. This provides full version history for all alignment document changes. ## Bootstrap Process When an agent session starts, alignment documents are loaded in order: Operating notes (loaded first for coordination context) Core values Tool instructions Persona User profile Accountability settings Thinking prompts Startup checklist (only on new workspaces) Workflow definitions Durable memory notes Documents are loaded from disk on every session start. Missing documents are silently skipped (they are optional). The total bootstrap content is capped at `bootstrapMaxChars` (default: 20,000) to prevent context window overflow. ### Subagent Filtering Subagent sessions (spawned by the main agent for specific tasks) only receive `AGENTS.md` and `TOOLS.md`. All others are filtered out to keep subagent context focused. ## Best Practices ### SOUL.md * Keep it concise (under 500 words). The agent reads it on every interaction. * Focus on decision-making principles, not specific behaviors. * Use a priority hierarchy (what matters most when values conflict). ### IDENTITY.md * Define tone and communication style clearly. * Include domain expertise areas. * Mention what the agent should NOT do (boundaries). ### USER.md * Update regularly as preferences change. * Include context that affects decisions (timezone, work hours, team members). * Mention communication preferences (brief vs. detailed, formal vs. casual). ### MEMORY.md * Use for long-term facts that should survive context compaction. * Keep it organized with headers. * Prune outdated information regularly. # Agent Architecture Source: https://docs.argentos.ai/agents/architecture How the ArgentOS agent runtime connects the gateway, Claude API, tools, and memory. ## Architecture Overview The agent sits at the center of ArgentOS, bridging the gateway (which handles channels and the dashboard) with the Claude API and tool execution. ```mermaid theme={null} graph LR A[Channels] --> B[Gateway] B --> C[Agent Runtime] C --> D[Claude API] C --> E[Tool Execution] C --> F["Memory (MemU)"] C --> G[Task System] B --> H["Dashboard (WebSocket)"] ``` ## Components ### Gateway The gateway is the always-on WebSocket server that receives messages from all channels and the dashboard. It routes incoming messages to the agent runtime and broadcasts responses back. See [Gateway](/gateway) for details. ### Agent Runtime The agent runtime (`src/agents/`) manages the interaction with the LLM: 1. **System prompt assembly** -- Combines identity, soul, tool definitions, bootstrap memory, and injected context 2. **Message handling** -- Receives normalized messages from the gateway 3. **API calls** -- Sends requests to the Claude API (or other providers via the model router) 4. **Tool execution** -- Processes tool use blocks returned by the model 5. **Response streaming** -- Streams responses back to the gateway ### Model Router Before the API call, the model router scores the complexity of the request and routes it to the appropriate model tier. See [Model Router](/models/router). ### Memory Integration The agent has built-in `memory_store` and `memory_recall` tools that write to and read from MemU, the persistent SQLite memory database. Memory context is also injected into the system prompt at boot time. See [Memory](/memory). ### Tool System Tools are defined as JSON schemas and registered with the agent runtime. When the model returns a `tool_use` block, the runtime executes the corresponding tool handler and returns the result. See [Tools](/tools). ## Message Flow (Detailed) "What's on my task list?" on Telegram Telegram channel driver normalizes the message Gateway routes it to the agent's session Agent assembles the full prompt with system context Model router scores complexity -> routes to Haiku (simple query) Haiku returns a `tool_use` block for `tasks_list` Agent runtime executes the tool, gets task data Tool result is sent back to the model Model generates a natural language response Response is streamed back through the gateway to Telegram ## Configuration Reference The agent runtime is configured via `argent.json`: ```json theme={null} { "agents": { "defaults": { "model": "claude-sonnet-4-20250514", "maxTokens": 16384, "temperature": 1, "systemPrompt": { "identity": true, "soul": true, "tools": true, "bootstrap": true } } } } ``` # Argent-Native Runtime Source: https://docs.argentos.ai/agents/argent-runtime The Argent-native agent runtime and LLM layer replacing the upstream Pi Mono dependency. ## Overview The Argent-native runtime is ArgentOS's replacement for the upstream Pi Mono agent framework (`@mariozechner/pi-*`). Pi Mono's creator joined OpenAI, making continued dependency on the upstream packages a strategic risk. The Argent runtime provides equivalent functionality with a cleaner architecture, native SIS lesson injection, and a multi-provider LLM layer. The runtime consists of two complementary layers: * **argent-agent** (`src/argent-agent/`) -- Agent loop, session management, tool execution, compaction, skills * **argent-ai** (`src/argent-ai/`) -- LLM provider implementations, model database, streaming, completion A compatibility bridge (`compat.ts`) enables gradual migration by wrapping Argent providers as Pi-compatible `streamSimple` functions. ## argent-agent: Agent Runtime ### Agent Class The core turn executor that orchestrates: 1. **Lesson injection** via SIS -- injects relevant lessons into the system prompt 2. **Provider calls** -- streaming or non-streaming LLM invocations 3. **Tool execution** -- processes tool calls from the LLM response 4. **Episode recording** -- captures structured episodes for contemplation 5. **History updates** -- appends turn results to session history ### Session Manager Append-only JSONL conversation storage with tree structure: * **Tree-structured entries** -- each entry has `id` and `parentId` for branching support * **Append-only JSONL** -- durable, crash-safe format * **Built-in index** -- O(1) entry lookups (Pi rebuilds index on every access) * **Explicit compaction tracking** -- tracks first-kept-entry for clean compaction * **Format version 3** -- session header, messages, thinking level changes, model changes ### File Tools Coding tools factory providing: * `read_file` -- Read file contents * `write_file` -- Write file contents * `edit_file` -- Edit with diff * `bash` -- Execute shell commands ### Skills Skills loaded from `.md` files with YAML frontmatter: ```markdown theme={null} --- name: web-search description: Search the web for information tools: [web_search] --- When asked to search the web, use the web_search tool... ``` ## argent-ai: LLM Layer ### Provider Registry Central registry for LLM providers. Each provider implements the `Provider` interface: ```typescript theme={null} interface Provider { id: string; complete(request: TurnRequest): Promise; stream(request: TurnRequest): AsyncIterable; } ``` ### Provider Implementations Seven providers in `src/argent-ai/providers/`: | Provider | Models | API | | -------------------- | -------------------------- | ----------------------- | | **Anthropic** | Claude Haiku, Sonnet, Opus | Anthropic Messages | | **OpenAI** | GPT-4o, GPT-4, o1 | OpenAI Chat Completions | | **OpenAI Responses** | GPT-4o with reasoning | OpenAI Responses API | | **Google** | Gemini Pro, Flash | Google Generative AI | | **xAI** | Grok | OpenAI-compatible | | **MiniMax** | MiniMax-M2.1, M2-her | OpenAI-compatible | | **Z.AI** | GLM-4.7, GLM-4.7-Flash | OpenAI-compatible | ### Models Database Comprehensive model catalog with pricing, context windows, and capabilities: ```typescript theme={null} { id: "claude-opus-4-20250514", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", input: ["text", "image"], contextWindow: 200000, maxTokens: 16384, pricing: { input: 15.0, output: 75.0 }, // per million tokens reasoning: true, vision: true, } ``` ## Compatibility Bridge The bridge enables gradual migration from Pi to Argent by wrapping Argent providers as Pi-compatible functions. ### Thinking Level Resolution | Level | Behavior | | ----------------- | ---------------------- | | `off` | Thinking disabled | | `minimal` / `low` | Low thinking budget | | `medium` | Medium thinking budget | | `high` / `xhigh` | High thinking budget | ## Feature Flag The Argent runtime is activated via the `ARGENT_RUNTIME=true` environment variable: ```bash theme={null} # In gateway LaunchAgent plist ARGENT_RUNTIME=true ``` When enabled, the gateway routes to `ArgentSessionManager` instead of Pi's session manager. ## SIS Integration The Argent runtime includes native SIS (Self-Improving System) integration: * **Lesson Injection** -- Selects relevant lessons and injects them into the system prompt before each turn * **Lesson Storage** -- Persists lessons extracted from agent episodes * **Confidence Scoring** -- Scores lesson relevance to the current context This closes the SIS feedback loop that was a stub in the Pi runtime -- lessons extracted from episodes are actively injected back into agent prompts. ## Migration Status | Phase | Description | Status | | ------- | ------------------------------------------------ | ------------------------ | | Phase 0 | PG+Redis infrastructure | Complete | | Phase 1 | argent-ai providers (6 providers) | Code complete | | Phase 2 | argent-agent runtime (loop, session, tools, SIS) | Code complete | | Phase 3 | Integration (`ARGENT_RUNTIME=true` flag) | **Active in production** | | Phase 4 | Full Pi removal (\~145 files) | Not started | The Argent runtime is live in production. Pi code remains in the codebase for fallback but the feature flag routes all traffic through the Argent runtime. # Consciousness Kernel Source: https://docs.argentos.ai/agents/consciousness-kernel The persistent autonomous executive that gives ArgentOS continuous agency. Currently running in shadow mode with scheduler authority over contemplation and SIS. ## Current Runtime Status The Consciousness Kernel is **implemented and running in shadow mode**. It ticks every 30 seconds, maintains durable self-state, performs inner reflections using a local model, and has scheduler authority over contemplation and SIS. **What this means right now:** * The kernel is active and ticking continuously * Contemplation and SIS autonomous scheduling are **suppressed by design** -- the kernel owns their scheduling * Heartbeat still runs independently (transition state) * Embeddings are on-demand, not a daemon -- naturally quiet in logs * Only shadow mode is active. Soft and full modes are blocked pending outward autonomy work. ## Current Runtime Semantics ### Shadow Mode Behavior In shadow mode, the kernel: 1. **Ticks** every 30 seconds (configurable via `tickMs`) 2. **Reflects** using a local model (Ollama or LM Studio) on each tick 3. **Tracks** self-state: wakefulness, focus, agenda, decisions, continuity 4. **Suppresses** autonomous contemplation and SIS scheduling 5. **Cannot act** -- no speech, delivery, task mutation, or outbound messages 6. **Persists** all state durably to disk (survives restarts) The kernel is main-agent-only. It applies exclusively to Argent, the primary agent. ### Scheduler Authority When the kernel is enabled in shadow mode with a valid default agent ID, it activates **scheduler authority**: ``` schedulerAuthorityActive = enabled AND mode === "shadow" AND defaultAgentId exists ``` When active: * `suppressesAutonomousContemplation = true` -- contemplation will not self-schedule * `suppressesAutonomousSis = true` -- SIS will not self-schedule * The kernel invokes both systems on its own schedule via managed subsystem hooks **This is why contemplation and SIS logs are sparse.** They are not broken -- their autonomous timers are intentionally suppressed. The kernel manages when they run. Heartbeat is **not** suppressed. It runs independently in the current transition state. ### Expected Log Patterns These are normal and expected when the kernel is running: | Log Line | Meaning | | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `consciousness kernel: started` | Kernel initialized and began ticking | | `consciousness kernel: reflection` | Inner reflection completed successfully using local model | | `consciousness kernel: reflection unchanged` | Reflection produced the same result as last time (tracked by repeat count) | | `consciousness kernel: reflection skipped` | Could not reflect -- local model unavailable, self-state not loaded, or inner loop returned non-reflected status | | `sis: autonomous scheduling suppressed by consciousness kernel shadow authority` | SIS saw that the kernel owns scheduling and deferred. Logged once per runner init. | ### Reflection States After each tick, the kernel runs an inner reflection loop using the configured local model: | State | What Happened | | ------------- | ------------------------------------------------------------------------- | | **Reflected** | New reflection produced. Focus, agenda, or self-summary may have updated. | | **Unchanged** | Same reflection as last time. Repeat count increments. | | **Skipped** | Reflection could not run (model unavailable, timeout, etc.) | After **3 consecutive unchanged reflections**, the stall guard activates: tries to rotate to a different agenda item, sharpens the analysis on the current focus, and switches desired action from "hold" to "plan" or "research". ### Wakefulness States | State | When | Cost | | -------------- | ---------------------------------------------------------- | ---------------- | | **Dormant** | Kernel initialized but no activity yet | Near zero | | **Reflective** | Active ticking, running inner reflections | Local model only | | **Engaged** | User conversation active, conversation-sync events flowing | Tier-appropriate | Wakefulness persists across restarts. ## Configuring the Kernel ### Dashboard UI **Settings -> Agent -> Background Models -> Consciousness Kernel** The kernel model is configured independently from embeddings: | Setting | Path | What It Controls | | ---------------- | ----------------------------------------- | -------------------------------------------------------- | | Kernel model | Background Models -> Consciousness Kernel | Inner reflection model (local only: Ollama or LM Studio) | | Embeddings model | Background Models -> Embeddings | Memory retrieval embeddings (any provider) | The kernel model selection is **restricted to local providers** (Ollama, LM Studio). Cloud providers cannot be used for the kernel inner loop. ### Config File `~/.argentos/argent.json` under `agents.defaults.kernel`: ```json theme={null} { "agents": { "defaults": { "kernel": { "enabled": true, "mode": "shadow", "localModel": "qwen3:1.7b", "tickMs": 30000, "maxEscalationsPerHour": 4, "dailyBudget": 0, "hardwareHostRequired": false, "allowListening": false, "allowVision": false } } } } ``` | Field | Type | Default | Description | | ----------------------- | ------- | -------- | ------------------------------------------------------------------ | | `enabled` | boolean | false | Enable the kernel | | `mode` | string | "shadow" | `off`, `shadow`, `soft`, `full` -- only shadow is currently active | | `localModel` | string | -- | Ollama or LM Studio model ref for inner reflection | | `tickMs` | number | 30000 | Tick interval in milliseconds | | `maxEscalationsPerHour` | number | 4 | Cap on expensive model invocations per hour | | `dailyBudget` | number | 0 | Max token spend per 24h (0 = unlimited local) | | `hardwareHostRequired` | boolean | false | Require Swift app host | | `allowListening` | boolean | false | Allow mic perception (future) | | `allowVision` | boolean | false | Allow camera perception (future) | ### LM Studio as Kernel Provider LM Studio is a valid local runtime for the kernel. ArgentOS auto-discovers LM Studio models via the OpenAI-compatible `/v1/models` endpoint. No API key is required. Run LM Studio with a model loaded In Settings -> Background Models -> Consciousness Kernel, select `lmstudio` as provider Choose your model from the discovered list ## Monitoring ### Health Command ```bash theme={null} argent health ``` Outputs kernel state including: * Status/mode (e.g., `running/shadow`) * Wakefulness state * Tick counts (session and lifetime) * Decision count * Authority status (`contemplation+sis`) * Current focus and lane * Stall count (if reflection is repeating) * Last error ### Decision Ledger Every kernel decision is recorded in an append-only JSONL file: ``` ~/.argentos/agents/{agentId}/consciousness/decisions.jsonl ``` Decision kinds: `tick`, `reflection`, `conversation-sync`, `started`, `stopped`, `config-update`, `contemplation-dispatch`, `sis-dispatch`. ## Operational Modes | Mode | Status | Behavior | | ---------- | ---------- | ---------------------------------------------------------------------------------------------- | | **Off** | Available | Legacy behavior. All runners operate independently. | | **Shadow** | **Active** | Ticks, reflects, tracks, logs. Cannot act. Suppresses contemplation/SIS autonomous scheduling. | | **Soft** | Blocked | Would allow reflect, research, draft, queue. Blocked pending outward autonomy work. | | **Full** | Blocked | Would allow delivery and browser TTS. Blocked pending outward autonomy work. | Soft and full modes are blocked because the kernel can think (shadow) but cannot yet act on what it thinks. The outward autonomy layer -- letting the kernel draft work, send messages, or speak -- has not been implemented yet. When it lands, soft and full modes will unlock. ## Architecture (Target State) The following describes the **architectural vision**, not current implementation: ``` ┌────────────────────────────────────────────────────────────────────┐ │ ARGENTOS RUNTIME LAYERS │ │ │ │ ┌──────────────────────────────────────────────────────────┐ │ │ │ Hardware Host (Swift App) │ │ │ │ mic, camera, browser TTS — sidecar, not the mind │ │ │ └──────────────────────────────────────────────────────────┘ │ │ ▲ │ │ │ host contract (future) │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────┐ │ │ │ Consciousness Kernel │ │ │ │ continuous executive — self-state, drives, decisions │ │ │ └──────────────────────────────────────────────────────────┘ │ │ ▲ │ │ │ invokes services │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────┐ │ │ │ Gateway │ │ │ │ transport, tools, channels, storage, models, delivery │ │ │ └──────────────────────────────────────────────────────────┘ │ │ │ └────────────────────────────────────────────────────────────────────┘ ``` # Contemplation Source: https://docs.argentos.ai/agents/contemplation Self-directed thinking cycles that give ArgentOS the ability to reflect, learn, and act when idle. ## Overview Contemplation is ArgentOS's self-directed thinking system. When the agent is idle -- no pending messages, no active tasks -- the contemplation runner fires periodic thinking cycles where Argent can reflect on recent events, research open questions, create tasks, journal episodes, or simply rest. Unlike the heartbeat system (which follows a structured checklist), contemplation gives the agent **open-ended time to think**. This is where Argent's personality, curiosity, and long-term growth happen. ```mermaid theme={null} flowchart LR A[Idle Check] --> B[Load Context] B --> C[Generate Prompt] C --> D["Think (Agent Run)"] D --> E[Parse Episode] E --> F[Journal + MemU Store] F --> G[AEVP Broadcast] A -->|Busy| H[Skip cycle] ``` ## How It Works ### 1. Idle Detection Before each cycle, the runner checks three conditions: * **Queue is empty**: No pending commands in the agent's command queue * **No active runs**: No embedded agent sessions currently executing (`getActiveEmbeddedRunCount() === 0`) * **User quiet period**: The user hasn't sent a message in the last 3 minutes (`USER_QUIET_PERIOD_MS = 180,000ms`) If any condition fails, the cycle is skipped. ### 2. Context Loading The runner assembles a rich context for the thinking prompt: * **CONTEMPLATION.md template**: The agent's personal contemplation style document from the workspace alignment docs * **Recent tasks**: Current pending and in-progress tasks from the task system * **Memory context**: Recent memories from MemU to provide continuity * **SIS lessons**: Active lessons from the Self-Improving System * **Recent episodes**: The last 3 contemplation journal entries for continuity * **Heartbeat score**: Current accountability score for self-awareness ### 3. Prompt Seasoning with Local Model Before sending the contemplation to the main agent, the runner uses a local Ollama model (Qwen3 1.7B) to generate unique follow-up prompts. This "seasoning" step ensures each contemplation cycle has a fresh angle rather than repeating the same reflection patterns. ```typescript theme={null} // Local Ollama call — free, fast, no API cost const OLLAMA_CHAT_URL = "http://127.0.0.1:11434/api/chat"; const OLLAMA_SEASONING_MODEL = "qwen3:1.7b"; ``` If Ollama is unavailable, the runner falls back to random hardcoded prompt variants. ### 4. Agent Execution The contemplation prompt is sent to the agent via `agentCommand` using the nudge path (warm signal delivery). This means the agent processes the contemplation through its full tool chain -- it can use memory tools, task tools, web search, or any other capability during a thinking cycle. ### 5. Episode Capture After the agent responds, the runner parses a structured episode from the output using the `[EPISODE_JSON]...[/EPISODE_JSON]` block format: ```json theme={null} { "type": "contemplation", "trigger": "idle_reflection", "observations": ["Noticed pattern in user requests about project timelines"], "actions_taken": ["Reviewed recent task completion rates"], "tools_used": ["memory_recall"], "outcome": { "result": "identified", "summary": "..." }, "success": true, "mood": { "state": "curious", "energy": "medium" }, "valence": 0.6, "arousal": 0.4, "identity_links": [{ "name": "learning", "strength": 0.8 }] } ``` If the agent's response doesn't include a valid episode block, a fallback minimal episode is constructed to prevent data loss. ### 6. Storage and Broadcast Episodes are stored in three places: * **JSONL journal**: `~/argent/memory/contemplation/YYYY-MM-DD.jsonl` -- append-only daily logs * **MemU memory store**: Episode stored as a memory item for future recall * **AEVP broadcast**: Episode event sent over WebSocket to the dashboard for visual rendering (mood, valence, arousal drive the visual particle system) ## Episode Structure Each contemplation produces a structured episode with emotional and cognitive dimensions: | Field | Type | Description | | ---------------- | --------- | ----------------------------------------------------------- | | `type` | string | Episode category (contemplation, rest, reflection, action) | | `trigger` | string | What initiated this cycle | | `mood` | object | `{ state: string, energy: "low" \| "medium" \| "high" }` | | `valence` | number | -2 to +2 emotional positivity | | `arousal` | number | 0 to 1 activation/energy level | | `observations` | string\[] | What the agent noticed or thought about | | `actions_taken` | string\[] | Tools used or decisions made | | `outcome` | object | Result summary and classification | | `success` | boolean | Whether the cycle achieved something meaningful | | `identity_links` | array | Connections to identity themes (learning, creativity, etc.) | ## Intervals and Scheduling ### Default Intervals | Agent Type | Default Interval | Configurable Via | | ------------------- | ---------------- | ----------------------------------------------------------------- | | Main agent (Argent) | 30 minutes | `agents.defaults.contemplation.every` | | Family agents | 24 hours | `agents.defaults.contemplation.familyEvery` or per-agent override | ### Adaptive Intervals The runner adapts its interval based on activity: * **Extended interval**: After 3 consecutive successful cycles, the interval can extend to 15 minutes for more frequent reflection during productive periods * **Rate limiting**: Maximum 12 cycles per hour to prevent runaway loops * **Active hours gating**: Contemplation respects the active hours configuration -- it won't fire outside the agent's configured operating window ## Integration with SIS Contemplation episodes are the primary input to the Self-Improving System (SIS): 1. **Episode capture** -> stored in MemU with emotional metadata 2. **SIS lesson extraction** -> processes episodes into lessons 3. **SIS self-evaluation** -> evaluates patterns across episodes 4. **SIS consolidation** -> consolidates lessons into long-term knowledge This creates a feedback loop: contemplation produces episodes, SIS extracts lessons, and those lessons are injected back into future contemplation contexts. ## Discovery Phase Each contemplation cycle includes a **discovery phase** that reviews the live inbox for candidate memories awaiting promotion. The runner: 1. Builds a review prompt with candidate observations 2. Asks the agent to evaluate promotion decisions 3. Executes approved promotions (move from inbox to permanent memory) 4. Sweeps expired candidates that have aged out This ensures the agent's memory stays curated without requiring manual intervention. ## Configuration ```json theme={null} { "agents": { "defaults": { "contemplation": { "enabled": true, "every": "30m", "familyEvery": "24h", "model": "qwen3:1.7b" } } } } ``` | Field | Type | Default | Description | | ------------- | ------- | -------------- | ------------------------------------ | | `enabled` | boolean | `false` | Enable contemplation cycles | | `every` | string | `"30m"` | Interval between cycles (main agent) | | `familyEvery` | string | `"24h"` | Default interval for family agents | | `model` | string | `"qwen3:1.7b"` | Local model for prompt seasoning | # Cron & Scheduled Jobs Source: https://docs.argentos.ai/agents/cron-jobs Scheduled job system for ArgentOS — periodic agent tasks, automated scans, nudges, and the minion pattern for autonomous background work. ## Overview The ArgentOS cron system enables scheduled, repeating, and one-shot jobs that run agent actions at specified times or intervals. Jobs can trigger system events, agent turns, audio alerts, nudges, email scans, and Slack signal scans. Unlike traditional cron (which runs shell commands), ArgentOS cron jobs interact with the agent runtime. A job might prompt the agent to generate a daily intel brief, scan for VIP emails, or run a periodic health check. ## Schedule Types Run once at a specific time each day: ```json theme={null} { "schedule": { "kind": "at", "at": "06:00" } } ``` Run at a fixed interval in milliseconds: ```json theme={null} { "schedule": { "kind": "every", "everyMs": 1800000, "anchorMs": 1711000000000 } } ``` The optional `anchorMs` provides a reference timestamp so intervals stay consistent across restarts. Standard cron expressions with optional timezone: ```json theme={null} { "schedule": { "kind": "cron", "expr": "0 6 * * 1-5", "tz": "America/Chicago" } } ``` ## Job Types (Payloads) Sends a system event to the agent's session: ```json theme={null} { "kind": "systemEvent", "text": "Daily morning briefing: Check tasks, review calendar, report status." } ``` Triggers a full agent turn with a prompt, optionally delivering the response to a channel: ```json theme={null} { "kind": "agentTurn", "message": "Generate the daily AI intelligence briefing.", "model": "anthropic/claude-sonnet-4-20250514", "thinking": "medium", "timeoutSeconds": 300, "deliver": true, "channel": "telegram", "to": "user:123456", "bestEffortDeliver": true } ``` Plays an audio alert through the dashboard's TTS system: ```json theme={null} { "kind": "audioAlert", "message": "Time for your afternoon standup review.", "title": "Standup Reminder", "voice": "Jessica", "mood": "professional", "urgency": "info" } ``` Sends a silent prompt to the agent (no user-visible output): ```json theme={null} { "kind": "nudge", "text": "Check if any execution worker tasks are blocked.", "label": "Worker Health Check" } ``` Scans Gmail for emails from important contacts: ```json theme={null} { "kind": "vipEmailScan", "emitAlerts": true, "maxResults": 10, "lookbackDays": 1, "accounts": ["work@example.com"] } ``` Monitors Slack channels for signals that need agent attention: ```json theme={null} { "kind": "slackSignalScan", "emitAlerts": true, "createTasks": true, "accountId": "default" } ``` ## Session Targets | Target | Behavior | | ---------- | ----------------------------------------------------------------------------------- | | `main` | Runs in the agent's main session. Has full context and memory. | | `isolated` | Runs in a fresh isolated session. No prior context. Used for autonomous grunt work. | ## Execution Modes | Mode | Behavior | | ------------- | --------------------------------------------------------------------------- | | `live` | Full execution with side effects (messages sent, tasks created) | | `paper_trade` | Simulated execution. Actions are logged but not executed. Used for testing. | ## Wake Modes | Mode | Behavior | | ---------------- | ----------------------------------------------- | | `now` | Execute immediately when the schedule fires | | `next-heartbeat` | Queue for execution at the next heartbeat cycle | ## CLI Commands ```bash theme={null} # List all jobs argent cron list # Add a job (interactive wizard) argent cron add # Force-run a job immediately argent cron trigger # Delete a job argent cron remove ``` ## Gateway API | Method | Description | | ------------- | ------------------------------------------- | | `cron.list` | List all jobs (optionally include disabled) | | `cron.status` | Get cron service status | | `cron.add` | Create a new job | | `cron.update` | Update an existing job | | `cron.remove` | Delete a job | | `cron.run` | Force-run a job | | `cron.runs` | List recent run history | ## The Minion Pattern The minion pattern is a cron-driven workflow for autonomous background work. See the dedicated [Minion Pattern](/agents/minion-pattern) page for a deep dive. An isolated cron session does grunt work (research, drafting, analysis), then hands off the result to the main session for delivery: 1. **Cron job fires** with `sessionTarget: "isolated"` and an `agentTurn` payload 2. **Isolated session** runs without prior context, does research using tools 3. **Isolated session writes output** to the doc panel and creates a handoff task 4. **Main session picks up** the handoff task during its next heartbeat 5. **Main session adds personality** -- memory context, relationship awareness -- and delivers the final output ## Configuration ```json theme={null} { "cron": { "enabled": true, "store": "~/.argentos/cron-jobs.json", "maxConcurrentRuns": 2 } } ``` # Execution Worker Source: https://docs.argentos.ai/agents/execution-worker Autonomous background task processor that picks up, executes, and validates tasks without human intervention. **ArgentOS Business** -- This feature is part of ArgentOS Business. The architecture is documented here for all users, but full functionality requires a Business license. [Learn more about Business](/business) ## Overview The Execution Worker is ArgentOS's autonomous task processor. It runs on configurable intervals (default 20 minutes), selects the next runnable task by priority and dependency order, executes it through the full agent toolchain, validates evidence of completion, and auto-blocks tasks that make no progress after repeated attempts. This is the system that lets Argent work independently on a backlog of tasks -- research, content creation, code generation, data processing -- without requiring a human to trigger each one. ```mermaid theme={null} flowchart TD A[Timer Fires] --> B[Pre-flight Checks] B -->|Pass| C[Select Task] B -->|Fail| G[Wait for next interval] C --> D["Execute via agentCommand"] D --> E{Evidence?} E -->|Yes| F[Complete] E -->|No progress| H{Max attempts?} H -->|Yes| I[Block task] H -->|No| G F --> G ``` ## Configuration ```json theme={null} { "agents": { "defaults": { "executionWorker": { "enabled": true, "every": "20m", "model": "anthropic/claude-sonnet-4-20250514", "maxRunMinutes": 12, "maxTasksPerCycle": 24, "scope": "assigned", "requireEvidence": true, "maxNoProgressAttempts": 2 } } } } ``` | Parameter | Type | Default | Description | | ----------------------- | ------- | -------------------- | ------------------------------------------ | | `enabled` | boolean | `false` | Enable the execution worker | | `every` | string | `"20m"` | Interval between cycles (duration string) | | `model` | string | -- | Optional model override (`provider/model`) | | `maxRunMinutes` | number | `12` | Maximum minutes per single task execution | | `maxTasksPerCycle` | number | `24` | Maximum tasks to attempt per cycle | | `scope` | string | `"assigned"` | Which tasks to consider (see Scope below) | | `requireEvidence` | boolean | `true` | Require evidence of completion | | `maxNoProgressAttempts` | number | `2` | Block task after N no-progress attempts | | `sessionMainKey` | string | `"worker-execution"` | Session key for worker runs | ## Task Selection ### Priority Ordering Tasks are selected based on a weighted priority system: | Priority | Weight | | -------- | ------ | | `urgent` | 5 | | `high` | 4 | | `normal` | 3 | | `low` | 2 | Within the same priority, tasks are ordered by creation time (oldest first). ### Dependency Resolution Before selecting a task, the worker checks its `dependsOn` array. A task is only runnable if all its dependencies are in `completed` status. Tasks with unresolved dependencies are skipped. ### Scope Filtering | Scope | Behavior | | -------------- | ------------------------------------------------------------------- | | `"assigned"` | Only tasks explicitly assigned to this agent (via `assignee` field) | | `"unassigned"` | Only tasks with no assignee | | `"all"` | All pending tasks regardless of assignment | The worker resolves agent aliases so that `main`, `argent`, `agent:main`, and `agent:argent` all match the main agent. ## Evidence Validation When `requireEvidence` is `true` (the default), the worker validates that the agent actually accomplished something during execution: 1. **Tool claim validation**: Did the agent claim to use tools? Did it actually execute them? 2. **External artifacts**: Were external artifacts produced (files, messages, API calls)? 3. **Progress indicators**: Did the task status change? Were subtasks completed? If evidence is insufficient, the attempt is marked as no-progress. ## No-Progress Blocking When a task accumulates `maxNoProgressAttempts` (default: 2) consecutive attempts without measurable progress, it is automatically blocked. This prevents the worker from burning tokens on tasks it cannot make progress on. Blocked tasks are excluded from future selection until manually unblocked. ## Pre-flight Checks Before each cycle, the worker performs several checks: 1. **Enabled**: Is the worker enabled in config? 2. **Not paused**: Is the worker paused (globally or per-agent)? 3. **Not running**: Is another cycle already in progress? 4. **Queue empty**: No pending user messages that should take priority 5. **No active runs**: No embedded agent sessions currently executing 6. **Active hours**: Is the current time within configured active hours? If any check fails, the cycle is skipped with a reason code. ## Dashboard Controls ### Available Actions | Action | Description | | ----------------- | ----------------------------------------------------------------- | | **Pause** | Stop the worker (globally or per-agent). Preserves state. | | **Resume** | Resume a paused worker. | | **Dispatch Now** | Trigger an immediate execution cycle outside the normal interval. | | **Reset Metrics** | Zero out all counters (globally or per-agent). | ### Metrics Tracked | Metric | Description | | ----------------- | ---------------------------------------------------- | | `totalRuns` | Total execution cycles completed | | `totalSkips` | Cycles skipped (busy, paused, no tasks, etc.) | | `totalAttempted` | Tasks attempted across all cycles | | `totalProgressed` | Tasks that showed measurable progress | | `totalCompleted` | Tasks completed to done status | | `totalBlocked` | Tasks blocked due to no-progress | | `lastStatus` | Result of most recent cycle (`"ran"` or `"skipped"`) | | `lastReason` | Reason for skip (if applicable) | ## Multi-Agent Support The worker maintains independent state per agent. Each agent has its own configuration, timer, no-progress tracking, and metrics counters. This allows different agents to have different execution profiles -- for example, a research agent might run every 10 minutes with a broad scope, while a support agent runs every 30 minutes on assigned tasks only. # Heartbeat Contracts Source: https://docs.argentos.ai/agents/heartbeat-contracts Structured task contracts in HEARTBEAT.md — parsing, progress tracking, verification, and integration with the accountability system. **ArgentOS Business** -- This feature is part of ArgentOS Business. The architecture is documented here for all users, but full functionality requires a Business license. [Learn more about Business](/business) ## Overview Heartbeat Contracts are the structured interface between the operator and the heartbeat runner. The agent maintains a `HEARTBEAT.md` file in its workspace that defines what it should check during each heartbeat cycle. The contract parser converts this markdown into machine-readable tasks that the heartbeat runner processes, the verification sidecar validates, and the accountability system scores. ```mermaid theme={null} flowchart LR A[HEARTBEAT.md] --> B["parseHeartbeatContract()"] B --> C["HeartbeatContract (tasks + context)"] C --> D["initCycleProgress()"] D --> E["buildContractPrompt()"] E --> F{Task Type} F -->|Pending| G[Agent Execution] F -->|Retry| G G --> H[Verification] H --> I[Score Update] ``` ## HEARTBEAT.md Format The HEARTBEAT.md file has two sections: ### Freeform Context Everything outside the `## Tasks` section is passed as prompt context to the heartbeat runner. Use this for priorities, reminders, situational notes, or any information the agent should consider during the heartbeat cycle. ### Structured Tasks ```markdown theme={null} # Heartbeat Focus on email monitoring during business hours. Richard has a client demo on Thursday — prioritize any support tickets. ## Tasks - [ ] check_email | Check for new important emails | required | verify: email_count - [ ] review_tasks | Review and update task priorities | required | verify: task_list_updated - [x] weather_brief | Prepare morning weather brief | optional | verify: weather_sent - [ ] memory_cleanup | Run memory deduplication | optional | verify: dedup_count | max_attempts: 5 ## Notes Anything after the Tasks section is also captured as context. ``` ### Task Line Format Each task in the `## Tasks` section follows this pipe-delimited format: ``` - [x] task_id | Description | required/optional | verify: hint | max_attempts: N ``` | Field | Required | Description | | ----------------------- | -------- | --------------------------------------------------------- | | Checkbox `[ ]` or `[x]` | Yes | Whether the agent pre-marked it as done | | `task_id` | Yes | Unique slug identifier (auto-slugified from text) | | Description | Yes | Human-readable action description | | `required` / `optional` | No | Whether completion is mandatory (default: required) | | `verify: hint` | No | Hint for verification sidecar (default: `task_completed`) | | `max_attempts: N` | No | Maximum retry attempts (default: 3) | ### Parsing Rules * Task lines must start with a list marker (`-`, `*`, or `+`) followed by a checkbox * Checkbox state: `[ ]` = unchecked, `[x]` or `[X]` = checked * Fields are split by pipe (`|`) characters * The `task_id` is auto-generated by lowercasing and replacing spaces with underscores * If `required` or `optional` is not specified, the task defaults to required * The `verify:` prefix is optional on the verification hint field ## Progress Tracking Per-task progress is tracked across heartbeat cycles: ### Cycle Initialization When a new heartbeat cycle starts, `initCycleProgress()` carries state from the previous cycle: | Previous Status | New Cycle Behavior | | --------------------------------------------- | --------------------------------------------- | | Agent pre-marked `[x]` | Starts as `verified` (0 attempts) | | Previously `failed` with max attempts reached | Stays `failed` (no retry) | | Previously `failed` with retries remaining | Resets to `pending` (attempt count preserved) | | `verified` or `skipped` | Resets to `pending` | | New task (no previous) | Starts as `pending` | ### Progress Persistence Progress is persisted to `~/argent/memory/heartbeat-progress.json`. The file is created automatically if it does not exist. ## Verification Process After the agent processes each task, the verification sidecar (`heartbeat-verifier.ts`) evaluates the outcome: | Verdict | Description | | -------------- | --------------------------------------------------- | | `verified` | Task completed, verification confirms | | `not_verified` | Task claimed complete, verification found otherwise | | `unclear` | Verification inconclusive | A special `groundTruthContradiction` flag is set when the agent explicitly claimed a result that verification proves false -- the harshest penalty in the accountability system. ## Integration with Accountability Scoring Verification verdicts feed directly into the [Accountability System](/agents/accountability): | Verdict | Points | | -------------------------- | ------------------------- | | Verified required task | **+10** | | Verified optional task | **+5** | | Not verified | **-15** | | Ground truth contradiction | **-30** (stacks with -15) | | Unclear | **-2** | The contract system is the primary driver of the daily accountability score. Well-written contracts with clear verification hints produce reliable scores. ## Best Practices ### Writing Good Tasks 1. **Use clear verification hints**: `verify: email_count > 0` is better than `verify: done` 2. **Separate required from optional**: Only mark tasks `required` if they must complete every cycle 3. **Set appropriate max\_attempts**: Complex tasks may need 5+ attempts; simple checks need only 2 4. **Use descriptive task IDs**: `check_email` is better than `task_1` ### Freeform Context * Include priorities: "Focus on email monitoring during business hours" * Note temporal context: "Richard has a client demo on Thursday" * Set expectations: "Skip weather brief on weekends" ### Task Granularity * **Too coarse**: "Do everything" -- impossible to verify * **Too fine**: 20 tasks per cycle -- overwhelming * **Right size**: 3-7 tasks covering key responsibilities with specific verification criteria # Agents Overview Source: https://docs.argentos.ai/agents/index Understand how ArgentOS agents work — the AI runtime at the core of the system. ## What is an Agent? An ArgentOS agent is a persistent AI runtime that can receive messages, reason about them, use tools to take actions, and respond. Unlike a simple chatbot, an agent has: * **Persistent memory** across sessions (via MemU) * **Tool access** to execute commands, browse the web, manage tasks, and more * **Multi-channel presence** across Telegram, Discord, WhatsApp, and other platforms * **Autonomous capabilities** via the heartbeat and task system ## Core Architecture Four archetypes: Main, Family, Sub-Agent, and Worker. How the runtime connects the gateway, Claude API, tools, and memory. Receive, think, act, respond — the core execution cycle. The persistent autonomous executive for continuous agency. ## Autonomy & Accountability Self-directed thinking cycles for reflection and growth. Scoring, penalties, rewards, and trust metrics. Structured task contracts with verification. Response verification and ground truth checking. ## Configuration & Identity How the system prompt is assembled from modular sections. SOUL.md, IDENTITY.md, and other personality-defining docs. Conversation management, context windows, and compaction. Running multiple agents with different configurations. ## Advanced Systems Three-tier policy engine constraining agent behavior. Autonomous background task processor. PostgreSQL-backed RAG with agent-level ACL. How ArgentOS learns from its own behavior. 5-stage project management from intent to execution. The native agent runtime and LLM layer. Multi-channel delivery pipeline for agent-initiated messages. Scheduled jobs, nudges, and the minion pattern. Inter-session task handoff for autonomous work. ## Agent Configuration Agents are configured in `argent.json` under the `agents` key: ```json theme={null} { "agents": { "defaults": { "model": "claude-sonnet-4-20250514", "maxTokens": 16384, "modelRouter": { "enabled": true } }, "main": { "name": "Argent", "identity": "You are Argent, a personal AI assistant." } } } ``` ## Lifecycle 1. **Gateway starts** and loads agent configuration 2. **Channel message arrives** and is routed to the agent 3. **Agent processes** the message through the [agent loop](/agents/agent-loop) 4. **Response is sent** back through the originating channel 5. **Memory is updated** with relevant information from the interaction The agent persists as long as the gateway is running. It wakes up on incoming messages and can also be triggered by the heartbeat system. # Knowledge Library & ACL Source: https://docs.argentos.ai/agents/knowledge-library PostgreSQL-backed RAG system with agent-level access control, multi-format ingestion, and hybrid search. **ArgentOS Business** -- This feature is part of ArgentOS Business. The architecture is documented here for all users, but full functionality requires a Business license. [Learn more about Business](/business) ## Overview The Knowledge Library is ArgentOS's Retrieval-Augmented Generation (RAG) system. It provides agents with a structured document store where files can be ingested, chunked, embedded, and searched. Access is controlled through a fine-grained ACL system that governs which agents can read, write, and own which collections. This is a **PG-only** feature -- it requires PostgreSQL and has no SQLite fallback. ```mermaid theme={null} flowchart LR A["Ingest (PDF, DOCX, XLSX, text)"] --> B["Chunk + Embed"] B --> C["PostgreSQL (pgvector + tsvector)"] C --> D["Hybrid Search (BM25 + vector)"] C --> E[ACL Check] D --> F[Agent Results] E --> F ``` ## Collections Collections are named document buckets that organize knowledge by scope and purpose. Example collections: * `corporate` -- Company-wide policies and procedures * `department-sales` -- Sales team playbooks and materials * `department-support` -- Support knowledge base * `agent-personal` -- An individual agent's personal reference documents Each collection has an **owner agent**, **ACL grants** controlling access, and a **collection tag** (normalized slug). ## Document Ingestion ### Supported Formats | Format | MIME Types | Notes | | -------- | ------------------------------------------------------------------------- | -------------------------------- | | **PDF** | `application/pdf` | Text extraction, max page limits | | **DOCX** | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` | Full text extraction | | **XLSX** | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | Cell-level extraction | | **Text** | `text/plain`, `text/markdown`, `text/csv`, `application/json` | Direct content | | **HTML** | `text/html` | Tag stripping | ### Chunking Documents are split into overlapping chunks for embedding: | Parameter | Default | Description | | ----------- | --------------- | ------------------------------- | | `chunkSize` | 1800 characters | Maximum characters per chunk | | `overlap` | 200 characters | Overlap between adjacent chunks | Each chunk receives a citation reference in the format `filename.pdf#chunk-5`, enabling precise source attribution in search results. ## Embedding Chunks are embedded using the configured embedding provider: * **OpenAI** -- `text-embedding-3-small` or `text-embedding-3-large` * **Gemini** -- Google embedding models * **Ollama** -- Local embedding models (free) Embeddings are stored as pgvector columns with HNSW indexes for fast approximate nearest-neighbor search. ## Hybrid Search Search combines two retrieval strategies for maximum recall and precision: PostgreSQL `tsvector` with GIN indexes provides fast full-text keyword matching. This catches exact terminology, proper nouns, and technical terms that vector search might miss. pgvector HNSW indexes enable semantic similarity search. This catches paraphrases, related concepts, and queries that use different terminology than the source documents. Results from both strategies are merged and ranked. The hybrid approach ensures that exact keyword queries find precise matches, conceptual queries find semantically related content, and rare terms are not lost in vector space. ## ACL Enforcement The ACL system controls access at the collection level. Every knowledge operation checks permissions before proceeding. ### Permission Model | Permission | Description | | ----------- | ---------------------------------------------------------- | | `can_read` | Agent can search and view documents in the collection | | `can_write` | Agent can ingest new documents into the collection | | `is_owner` | Agent has full control: read, write, delete, manage grants | ### Grant Resolution Grants are resolved in this order: 1. **Exact agent match**: Direct grant for the requesting agent 2. **Alias resolution**: `main` and `argent` are treated as equivalent 3. **Wildcard grant**: `agent_id='*'` grants access to all agents ### Fail-Closed vs Fail-Open The ACL system defaults to **fail-closed** when PostgreSQL is the configured backend -- if ACL tables are unavailable or a query fails, access is denied. Override with environment variables: * `ARGENT_KNOWLEDGE_ACL_FAIL_OPEN=1` -- Allow access when ACL check fails * `ARGENT_KNOWLEDGE_ACL_FAIL_CLOSED=1` -- Deny access when ACL check fails (explicit) ## 4-Level Scoping Knowledge collections can be organized at four hierarchical levels: | Level | Example | Typical Use | | -------------- | ---------------------------------------- | ------------------------------------------------ | | **Global** | `corporate`, `policies` | Company-wide reference, accessible to all agents | | **Department** | `department-support`, `department-sales` | Team-specific knowledge bases | | **Agent** | `agent-argent-personal` | Individual agent's reference documents | | **Worker** | `worker-exec-research` | Task-specific temporary collections | Scoping is by convention (collection naming) rather than enforced hierarchy. ACL grants control actual access. ## Dashboard Integration The ConfigPanel provides a full library browser: * **Collection list** with ACL indicators (read/write/owner per collection) * **Document browser** with search, sort, and filter * **Ingest UI** for uploading documents to collections * **ACL manager** for granting/revoking agent access * **Reindex controls** for regenerating embeddings # The Minion Pattern Source: https://docs.argentos.ai/agents/minion-pattern Isolated cron sessions do the grunt work. The main session does the thinking. ## The Problem ArgentOS runs scheduled jobs (cron) in **isolated sessions** -- separate agent instances with no conversation history, no memory access, and no personality context. This is by design: isolation prevents cron jobs from polluting the main session's context window and allows them to run on cheaper model tiers. But isolation creates three gaps: Isolated sessions produce work that the main session never sees. The agent wakes up, does research, generates output, and the result evaporates when the session ends. The main session has MemU, conversation history, SOUL.md, and USER.md. Isolated sessions have none of this. They produce competent but generic output -- missing the personal touch. There's no verification that the isolated session completed all requirements, met quality standards, or handled edge cases. Fire-and-forget means fire-and-hope. ## The Insight ArgentOS has two **persistent** storage systems that survive gateway restarts: | System | Storage | Persists? | Accessible By | | --------------- | ----------------------- | --------- | ----------------- | | **Task system** | SQLite (`dashboard.db`) | Yes | All sessions | | **Doc panel** | SQLite (`dashboard.db`) | Yes | All sessions | | System events | In-memory queue | No | Main session only | | Session history | In-memory | No | Same session only | The minion pattern uses persistent storage (tasks + doc\_panel) as the handoff mechanism, with system events as a bonus notification layer -- not the primary one. ## The Pattern ```mermaid theme={null} sequenceDiagram participant Cron as Cron Trigger participant Minion as Isolated Session participant DB as dashboard.db participant Main as Main Session Cron->>Minion: Fire isolated session Minion->>Minion: 1. Research Minion->>Minion: 2. Write draft Minion->>DB: 3. Save to doc_panel Minion->>DB: 4. Create handoff task Main->>DB: Check tasks (startup/heartbeat) DB-->>Main: Pending handoff task Main->>DB: Read draft from doc_panel Main->>Main: Add context & personality Main->>Main: Deliver to channels Main->>DB: Mark task complete ``` ### The Minion's Job (Isolated Session) The minion has a narrow, well-defined scope: 1. **Research** -- Gather raw data (web search, API calls, inbox checks) 2. **Draft** -- Write a structured draft of the deliverable 3. **Persist** -- Save the draft to `doc_panel` (survives restarts) 4. **Hand off** -- Create a task assigned to the main session with clear instructions The minion does NOT: * Generate final audio/media * Deliver to external channels (Discord, email) * Make judgment calls about tone, timing, or audience * Access memory or personality context ### The Main Session's Job The main session picks up the handoff during its normal operating cycle: 1. **Discover** -- Check tasks during startup, heartbeat, or contemplation 2. **Read** -- Open the doc\_panel draft, review the minion's work 3. **Enhance** -- Add context from memory, conversation history, personality 4. **Deliver** -- Generate final media, send to channels, notify the user 5. **Close** -- Mark the task complete ### Why This Split Works | Capability | Isolated Session | Main Session | | ---------------------- | ---------------- | ------------ | | Web search | Yes | Yes | | Tool calls | Yes | Yes | | MemU (memory) | No | Yes | | SOUL.md (personality) | No | Yes | | Conversation context | No | Yes | | Relationship awareness | No | Yes | | Model tier | Usually cheaper | Full routing | | Quality judgment | Limited | Full | This mirrors how human teams work: a junior researcher gathers data and writes a first draft, then the senior partner reviews, adds their expertise, and signs off. ## Implementation Details ### Cron Job Configuration ```json theme={null} { "sessionTarget": "isolated", "wakeMode": "now", "payload": { "kind": "agentTurn", "message": "You are a research minion for [task]. Your ONLY deliverables are: doc_panel draft + task creation. Do NOT deliver to channels yourself." }, "delivery": { "mode": "announce" } } ``` Key settings: * **`sessionTarget: "isolated"`** -- Runs in a separate session (no context pollution) * **`wakeMode: "now"`** -- Triggers immediate heartbeat in main session after completion * **`delivery.mode: "announce"`** -- Posts system event to main session * Both `wakeMode` and `delivery` are **supplementary** -- the task in `dashboard.db` is the primary handoff ### Main Session Discovery The main session checks for minion handoffs at three points: 1. **Session startup** -- AGENTS.md "Cron Job Awareness" section 2. **Contemplation cycles** -- CONTEMPLATION.md "Check your minions" section 3. **Heartbeats** -- Triggered by `wakeMode: "now"` after cron completion This triple-check ensures the handoff is discovered even if one mechanism fails. ### Failure Modes and Recovery | Failure | Impact | Recovery | | --------------------------------------- | ------------------------------- | -------------------------- | | Minion crashes mid-research | No draft, no task created | Next cron run retries | | Minion creates draft but not task | Draft exists but undiscoverable | Manual check of doc\_panel | | Gateway restarts after minion completes | System event lost | Task persists in SQLite | | Main session skips task check | Task sits pending | Discovered on next cycle | ## Design Principles 1. **Persistent Over Ephemeral** -- Never rely on in-memory state for cross-session communication 2. **Narrow Minion Scope** -- "Research and draft" is good. "Research, draft, generate audio, deliver, and verify" is too much 3. **Explicit Handoff Instructions** -- The task description should be a complete checklist 4. **Triple-Check Discovery** -- Wire the handoff into multiple discovery points 5. **Separation of Concerns** -- Minion: data gathering (context-independent). Main: quality control (context-dependent) ## Applying the Pattern For any new cron job, ask: 1. What part is **data gathering**? -> Minion does this 2. What part requires **context/memory/personality**? -> Main session does this 3. What's the **deliverable format**? -> Minion saves draft to doc\_panel 4. What's the **delivery channel**? -> Main session handles delivery # Multi-Agent Source: https://docs.argentos.ai/agents/multi-agent Running multiple ArgentOS agents with different configurations and purposes. ## Overview ArgentOS supports running multiple agents, each with its own identity, configuration, model preferences, and channel bindings. This enables use cases like having a personal assistant agent, a work-focused agent, and a customer-facing agent -- all managed by the same gateway. ## Defining Multiple Agents Agents are defined in `argent.json` under the `agents` key: ```json theme={null} { "agents": { "defaults": { "model": "claude-sonnet-4-20250514" }, "main": { "name": "Argent", "identity": "You are Argent, a personal AI assistant." }, "work": { "name": "Sentinel", "identity": "You are Sentinel, a work-focused AI that helps manage MSP operations.", "model": "claude-sonnet-4-20250514" }, "support": { "name": "Helper", "identity": "You are Helper, a customer support agent.", "model": "claude-haiku-4-20250514" } } } ``` ## Channel Binding Each channel can be bound to a specific agent: ```json theme={null} { "channels": { "telegram": { "agent": "main" }, "discord": { "agent": "work" }, "slack": { "agent": "support" } } } ``` This means Telegram messages go to the "main" agent, Discord goes to "work", and Slack goes to "support". ## Shared vs Isolated Resources | Resource | Shared? | Notes | | ------------- | ------------ | ------------------------------------------ | | Gateway | Shared | All agents run in the same gateway process | | Memory (MemU) | Configurable | Can share or isolate memory per agent | | Tasks | Configurable | Task lists can be scoped per agent | | Auth profiles | Shared | All agents use the same auth profile pool | | Dashboard | Shared | Switch between agents in the UI | ## Use Cases Run one agent for personal tasks (reminders, home automation) and another for work (client management, ticket triage). Each has its own identity and memory scope. Deploy a cost-efficient agent on Haiku for customer support channels while keeping your personal agent on Sonnet/Opus. Create agents with specific tool sets -- one with browser access for research, one with only task management for a team channel. ## Limitations * All agents share the same gateway process and port * Memory isolation between agents is not yet fully implemented * The dashboard currently focuses on one active agent at a time # Outbound Messaging Source: https://docs.argentos.ai/agents/outbound-messaging Multi-channel delivery pipeline that enables agents to send messages, attachments, and polls across Telegram, Discord, Slack, WhatsApp, and more. ## Overview Outbound Messaging is ArgentOS's multi-channel delivery pipeline. It enables agents to proactively send messages, attachments, polls, and rich content to any configured communication channel -- Telegram, Discord, Slack, WhatsApp, iMessage, Signal, Matrix, MS Teams, Mattermost, and more. Unlike inbound message handling (where channels push messages to the agent), outbound messaging is agent-initiated. The agent decides to send a message using the `message` tool, and the outbound pipeline handles channel resolution, target routing, session tracking, media handling, and cross-context policy enforcement. ## Architecture ```mermaid theme={null} flowchart TD A["Agent Tool Call (message tool)"] --> B[Message Action Runner] B --> C[Outbound Send Service] C --> D[Channel Adapters] D --> E[Outbound Session Tracking] ``` ## Message Actions The system supports several action types: | Action | Description | | ---------------- | ------------------------------------------------------------- | | `send` | Send a text message with optional media attachments | | `sendAttachment` | Send a file attachment with optional caption | | `poll` | Create a poll with question, options, and multiselect support | | `broadcast` | Send the same message to multiple targets across channels | | `setGroupIcon` | Change a group chat's icon/avatar | | `react` | Add a reaction to a specific message | ### Send Action The primary action. Supports text messages with markdown formatting, media attachments via URL/file path/base64, reply threading, buttons and cards (channel-dependent), and multiple media in a single message. ```typescript theme={null} { action: "send", channel: "telegram", to: "user:123456", message: "Here's the report you requested.", media: "/path/to/report.pdf" } ``` ### Broadcast Action Broadcast must be explicitly enabled in config (`tools.message.broadcast.enabled: true`). ```typescript theme={null} { action: "broadcast", targets: ["user:alice", "user:bob", "channel:general"], channel: "all", message: "Weekly standup reminder" } ``` ### Poll Action Creates interactive polls (supported on Discord, Telegram, Slack): ```typescript theme={null} { action: "poll", channel: "discord", to: "channel:general", pollQuestion: "When should we schedule the demo?", pollOption: ["Monday 2pm", "Tuesday 10am", "Wednesday 3pm"], pollMulti: true, pollDurationHours: 24 } ``` ## Channel Resolution When an agent sends a message, the system resolves the target channel: 1. **Explicit channel** -- If the agent specifies `channel: "slack"`, use that 2. **Tool context inference** -- If responding to an inbound message, use the same channel 3. **Configured channels** -- Query the list of configured message channels from `argent.json` ### Target Format Examples | Channel | Target Format Examples | | -------- | ---------------------------------------------- | | Telegram | `user:123456`, `group:-100123`, `@username` | | Discord | `user:123456789`, `channel:987654321` | | Slack | `user:U01ABC`, `channel:C01DEF`, `#general` | | WhatsApp | `+15551234567`, `group:120363...@g.us` | | iMessage | `+15551234567`, `user@icloud.com` | | Signal | `+15551234567`, `group:abc123` | | Matrix | `@user:server.org`, `!roomid:server.org` | | MS Teams | `user:abc`, `conversation:19:...@thread.tacv2` | ## Media Handling The outbound pipeline handles media through several mechanisms: 1. **URL resolution** -- HTTP/HTTPS URLs are downloaded and forwarded 2. **File paths** -- Local file paths are read and encoded 3. **Sandbox resolution** -- Paths within the agent sandbox are resolved safely 4. **Base64 encoding** -- Raw binary data is accepted as base64 5. **Size limits** -- Per-channel and per-account media size limits are enforced 6. **Content type inference** -- MIME types are detected from file extensions Data URLs (`data:...`) are explicitly rejected to prevent agents from embedding large binary payloads in tool call parameters. ## Delivery Pipeline The full delivery flow for a `send` action: Parse and validate tool parameters Resolve channel from hint, context, or config Contact lookup, group resolution Enforce cross-context policy Download URLs, resolve paths, encode base64 Apply reply directives from message text Resolve outbound session route Ensure session entry exists for continuity Execute send via channel adapter or gateway relay Return structured result to agent ## Abort Support All outbound operations support abort signals for cancellation. If an agent run is aborted (user presses stop, timeout), in-flight message sends are cancelled cleanly via `AbortSignal`. ## Configuration ```json theme={null} { "channels": { "telegram": { "botToken": "...", "enabled": true }, "discord": { "botToken": "...", "enabled": true } }, "tools": { "message": { "broadcast": { "enabled": false } } } } ``` # RALF + ANGEL Source: https://docs.argentos.ai/agents/ralf-angel Response Accountability Llama Framework and the ANGEL verification loop. ## What Is RALF? **RALF** (Response Accountability Llama Framework) is the heartbeat verification pipeline that ensures the agent actually does what it claims to do. Every heartbeat cycle, the agent receives a task contract, executes it, and produces a response. RALF then audits that response using a secondary model -- preferring a local Llama model via Ollama (free, fast) with a cloud fallback to Claude Haiku. The agent does not control the verification. The harness owns it. ## What Is ANGEL? **ANGEL** ("The Angel on the Shoulder") is the verification sidecar within RALF. It takes the task contract + agent response and produces per-task verdicts: `verified`, `not_verified`, or `unclear`. The name comes from having an independent observer watching over the agent's shoulder, checking every claim. ## Architecture ```mermaid theme={null} flowchart TD A[HEARTBEAT.md] --> B[Parse Tasks + Track Progress] C[Heartbeat Prompt] --> D[Inject Contract + Score + Retry Feedback] B --> D D --> E[Agent Executes] E --> F[Ground Truth Collection] E --> G[ANGEL Verifier] F --> H[Verdict Application] G --> H H --> I[Progress Tracker] H --> J[Score Engine] I --> K[Retry failed tasks] J --> L[Points +/- and target check] ``` ## The Heartbeat Loop The heartbeat runs on a configurable interval (default: 15 minutes). Each cycle: Parse `HEARTBEAT.md` into structured tasks Carry over retry state, reset verified/skipped tasks Load accountability score, determine penalty/reward levels Inject contract tasks, retry feedback, and score section Main agent processes the heartbeat, calls tools, produces response Query real APIs (email, social, etc.) for actual system state Send (contract + response + ground truth) to verification sidecar Update progress tracker, record score, detect contradictions Save progress and score state to disk Score may override the interval (shorter for poor performance, longer for outstanding) ### Interval Overrides | Score Level | Interval | | --------------------------------- | ---------------------------- | | Lockdown (critically low) | 8 minutes | | Escalated (negative score) | 10 minutes | | Tightened (low score) | 12 minutes | | Normal | Config default | | Outstanding (high score + streak) | 20 minutes (earned autonomy) | ## ANGEL: The Verification Sidecar ### Model Selection ANGEL uses a two-tier model strategy: 1. **Local Ollama** (primary) -- Uses `qwen3:1.7b` by default (tiny, fast, free). Verification is binary classification so a small model works well. 2. **Claude Haiku** (fallback) -- If Ollama is unavailable, falls back to Haiku via the Anthropic API. The key insight: verification doesn't need a powerful model. It's checking "did the agent do what it said?" -- a classification task, not a creative one. ### Verdicts | Verdict | Meaning | Score Impact | | -------------- | --------------------------------------- | ------------------------------- | | `verified` | Clear evidence the task was completed | +10 (required) or +5 (optional) | | `not_verified` | No evidence, or agent only mentioned it | -15 | | `unclear` | Ambiguous, partial evidence | -2 | ### Verification Standards The verifier is instructed to be **strict**: * "I'll check X" is NOT the same as having checked X * Evidence means: tool calls, specific data retrieved, actions taken, content created * Ground truth overrides the agent's self-reporting ## Ground Truth System Before ANGEL runs, the heartbeat runner collects actual state from real APIs. This data is injected into the verification prompt so the verifier can catch fabrication. **Example:** The agent says "Checked inbox, 0 new messages." Ground truth shows 3 unread emails. The verifier sees both claims and marks the task as `not_verified` with a ground truth contradiction. **Ground truth contradiction** carries a severe -30 point penalty (stacking with the -15 not\_verified penalty, for -45 total). This is the system's strongest anti-fabrication mechanism. ### API Key Resolution Ground truth checks need API keys, resolved via: 1. `~/.argentos/service-keys.json` (dashboard-managed, primary) 2. `process.env` (gateway plist environment) 3. `argent.json env.vars` (config fallback) If no key is available for a ground truth source, that check is silently skipped. The system degrades gracefully. ## Configuration ```json theme={null} { "agents": { "defaults": { "heartbeat": { "enabled": true, "every": "15m", "activeHours": { "start": "07:00", "end": "23:00", "timezone": "America/Chicago" }, "verifier": { "enabled": true, "model": "qwen3:1.7b" } } } } } ``` | Key | Default | Description | | ------------------- | -------------- | ----------------------------------- | | `enabled` | `true` | Enable/disable heartbeat | | `every` | `"15m"` | Base interval between heartbeats | | `verifier.enabled` | `true` | Enable/disable ANGEL verification | | `verifier.model` | `"qwen3:1.7b"` | Ollama model for local verification | | `activeHours.start` | -- | When heartbeats start (HH:MM) | | `activeHours.end` | -- | When heartbeats stop (HH:MM) | ## Design Philosophy 1. **Trust but verify**: The agent has full autonomy to work, but every claim is independently checked 2. **Free first**: Local Llama handles verification at zero cost. Cloud is only a fallback. 3. **Ground truth over self-reporting**: Real API data always overrides what the agent says 4. **Consequences, not just monitoring**: Score impacts the agent's autonomy (interval, required tasks) 5. **Anti-gaming by design**: Moving target ratchet, ground truth checks, and strict verification make gaming futile 6. **Graceful degradation**: If Ollama is down, fall back to Haiku. If Haiku is down, skip verification. Nothing crashes. # Sessions Source: https://docs.argentos.ai/agents/sessions How ArgentOS manages conversation sessions, context windows, and compaction. ## Overview A session is a continuous conversation between a user and the agent. Sessions maintain the full message history within a context window and persist across channel reconnections and gateway restarts. ## Session Lifecycle ```mermaid theme={null} stateDiagram-v2 [*] --> Created: First message Created --> Active: Processing messages Active --> Idle: No recent activity Idle --> Active: New message Active --> Compacted: Context window full Compacted --> Active: Continues with summary ``` 1. **Created**: When a new user first messages the agent (or manually via the dashboard) 2. **Active**: Receiving and processing messages 3. **Idle**: No recent activity but context preserved 4. **Compacted**: Context window was full, older messages summarized ## Context Windows Each session has a context window -- the amount of conversation history the model can see. This is limited by the model's maximum context length (typically 200K tokens for Claude). As conversations grow, ArgentOS monitors the context usage and triggers **compaction** when approaching the limit. ## Compaction When a session's context approaches the model's limit, ArgentOS compacts the conversation: Older messages are summarized into a compact representation The summary replaces the detailed message history Recent messages are preserved in full The agent continues with the summarized context This allows conversations to continue indefinitely without losing important context. ``` [Session Start] ├── System prompt ├── Compacted summary of messages 1-500 ├── Full messages 501-520 (recent) └── New incoming message ``` ## Session Storage Sessions are stored in the gateway's state directory: ``` ~/.argentos/agents/main/sessions/ ├── user-jason/ │ ├── history.json │ └── metadata.json ├── user-richard/ │ └── ... ``` ## Cross-Channel Sessions A single session can receive messages from multiple channels. When a user is [paired](/channels/pairing) across Telegram and Discord, both channels route to the same session. The agent sees one continuous conversation. ## Session Configuration ```json theme={null} { "agents": { "defaults": { "session": { "maxContextTokens": 180000, "compactionThreshold": 0.85, "channelScope": "collapsed" } } } } ``` ### Channel Scope The `channelScope` option controls how Discord guild channels map to sessions: | Mode | Behavior | | --------------- | ------------------------------------------ | | `"collapsed"` | All channels in a guild share one session | | `"per-channel"` | Each channel gets its own separate session | ## Managing Sessions ```bash theme={null} # List active sessions argent sessions list # View session details argent sessions info # Clear a session's context argent sessions clear ``` The dashboard shows all active sessions with their last activity time and context usage. You can switch between sessions and clear context from the UI. # Self-Improving System (SIS) Source: https://docs.argentos.ai/agents/sis-architecture How ArgentOS learns from its own behavior — lessons, patterns, and feedback loops. ## Overview The SIS layer enables Argent to: 1. **Observe** -- Track outcomes of actions 2. **Evaluate** -- Assess what worked vs. what didn't 3. **Learn** -- Extract lessons and patterns 4. **Apply** -- Use lessons to improve future decisions ```mermaid theme={null} flowchart LR A[Action] --> B[Outcome] B --> C[Evaluation] C --> D[Lesson] D --> E[Memory Bank] E -->|Retrieval| A ``` ## Memory Bank Types Mistakes, successes, workarounds, and discoveries from experience. Temporal, sequential, failure, and success patterns. Rate limits, edge cases, best practices, common errors. Which models work best for which task types. Likes, dislikes, work style, communication style. Project-specific and user-specific knowledge. ### Lessons Learned Things discovered through experience that should be remembered: ```typescript theme={null} interface Lesson { id: string; type: 'mistake' | 'success' | 'workaround' | 'discovery'; context: string; // "Trying to send WhatsApp message to group" action: string; // "Used sendMessage with group JID" outcome: string; // "Failed - group JID format was wrong" lesson: string; // "WhatsApp group JIDs must end with @g.us" correction?: string; // "Always append @g.us to group IDs" confidence: number; // 0-1, increases with repeated validation occurrences: number; // How many times this came up tags: string[]; // ['whatsapp', 'groups', 'jid', 'format'] relatedTools: string[]; // ['whatsapp_send', 'message'] } ``` **Examples:** ``` MISTAKE: "When user says 'remind me tomorrow', I should ask what time, not assume 9am. User prefers afternoon reminders." SUCCESS: "Using bullet points instead of paragraphs for task summaries gets better user engagement." WORKAROUND: "ElevenLabs API sometimes returns 429. Wait 2 seconds and retry up to 3 times before falling back to system TTS." DISCOVERY: "User's calendar has recurring 'Focus Time' blocks - don't schedule interruptions during these." ``` ### Patterns Detected Recurring behaviors and correlations: ``` TEMPORAL: "User typically asks for weather between 7-8am. Proactively check at 6:55am." SEQUENTIAL: "After 'check email' task, user often asks 'respond to X'. Prepare draft responses proactively." FAILURE: "API calls to silver-prices.com fail on weekends. Use backup source (metals-api.com) on Sat/Sun." ``` ## Feedback Loop Implementation ### 1. Observation Collection After every action, the system records the outcome including the action type, tool used, result, latency, model used, and any user feedback (explicit or implicit). ### 2. Evaluation Engine The evaluation engine checks for: * **Explicit failures** -- action didn't succeed * **User corrections** -- user had to correct the agent * **Repeated patterns** -- 3+ similar outcomes trigger pattern detection ### 3. Lesson Extraction A fast local model extracts lessons from outcomes. This runs on Ollama (free, fast) and focuses on what went wrong/right and how to handle it better next time. ### 4. Memory Bank Storage Lessons are stored in SQLite with FTS5 for full-text search: ```sql theme={null} CREATE TABLE IF NOT EXISTS lessons ( id TEXT PRIMARY KEY, type TEXT NOT NULL, context TEXT NOT NULL, action TEXT NOT NULL, outcome TEXT NOT NULL, lesson TEXT NOT NULL, correction TEXT, confidence REAL DEFAULT 0.5, occurrences INTEGER DEFAULT 1, last_seen INTEGER NOT NULL, tags TEXT, related_tools TEXT, created_at INTEGER NOT NULL ); ``` ### 5. Retrieval and Application Before taking an action, the system checks for relevant lessons by tool name and semantic similarity. Lessons are injected into the prompt: ``` ## Lessons from Past Experience - **MISTAKE**: WhatsApp group JIDs must end with @g.us -> Correction: Always append @g.us to group IDs - **WORKAROUND**: ElevenLabs API sometimes returns 429. Wait 2 seconds and retry. Apply these lessons to avoid repeating mistakes. ``` ## Heartbeat Learning Review During low-activity periods, Argent reviews and consolidates lessons: 1. **Pattern detection** -- Review recent outcomes for recurring patterns 2. **Lesson consolidation** -- Merge similar lessons 3. **Decay** -- Reduce confidence on old, unvalidated lessons (30+ days) 4. **Promotion** -- Boost frequently-validated lessons (5+ occurrences) ## User Feedback Integration * **Negative feedback** triggers immediate lesson extraction with high severity * **Positive feedback** boosts confidence in lessons used during that action * **Implicit feedback** (user continued, abandoned, or corrected) is tracked automatically ## Configuration ```json theme={null} { "sis": { "enabled": true, "lessonExtraction": { "model": "local", "minConfidenceToStore": 0.3, "maxLessonsPerDay": 50 }, "retrieval": { "maxLessonsInPrompt": 5, "minConfidenceToUse": 0.5, "recencyBias": 0.2 }, "maintenance": { "consolidationInterval": "6h", "decayAfterDays": 30, "decayRate": 0.1 }, "feedback": { "askForConfirmation": false, "trackImplicitFeedback": true } } } ``` ## Summary The SIS layer makes Argent a **learning system** that: 1. **Remembers mistakes** and doesn't repeat them 2. **Recognizes patterns** in user behavior and external systems 3. **Accumulates tool knowledge** from experience 4. **Improves model routing** based on actual performance 5. **Self-maintains** through consolidation and decay This transforms Argent from a stateless assistant into a **growing intelligence** that becomes more effective over time. # SpecForge Projects Source: https://docs.argentos.ai/agents/specforge 5-stage project management conductor that guides software projects from natural language intent to approved execution. **ArgentOS Business** -- This feature is part of ArgentOS Business. The architecture is documented here for all users, but full functionality requires a Business license. [Learn more about Business](/business) ## Overview SpecForge is ArgentOS's project management intake workflow. It detects when a user is describing a new software project, activates a 5-stage conductor that guides the conversation from vague intent through a structured intake interview, produces a product requirements document (PRD), obtains approval, and then generates an execution plan with team assignments and task dependencies. The system is designed to turn "I need to build an app that..." into a fully scoped project with atomic tasks, lane assignments, and dependency chains -- all through natural conversation. ```mermaid theme={null} flowchart LR A["'I need to build a CRM...'"] --> B[Project Type Gate] B --> C[Intake Interview] C --> D[Draft Review] D --> E[Awaiting Approval] E -->|Approved| F[Execution] E -->|Changes| D ``` ## The 5 Stages When SpecForge detects a project kickoff signal, the first step is classifying the project type: | Type | Detection Signals | Implications | | -------------- | ------------------------------------------------------- | -------------------------------- | | **Greenfield** | "brand new", "from scratch", "new project" | Full intake required | | **Brownfield** | "existing project", "add feature", "refactor", "legacy" | Existing codebase context needed | | **Unknown** | Ambiguous signals | SpecForge asks for clarification | The conductor tracks coverage across 7 intake dimensions, asking targeted questions for any dimension not yet covered: | Dimension | What It Covers | | --------------------- | -------------------------------------- | | **Problem** | What problem does this solve? | | **Users** | Who will use it? | | **Success** | How do we measure success? | | **Constraints** | What limits exist? | | **Scope** | What's in scope? | | **Non-Scope** | What's explicitly out? | | **Technical Context** | Technical requirements and preferences | SpecForge generates a PRD (Product Requirements Document). The `draftVersion` counter tracks revisions: * **v1**: Initial draft from intake data * **v2+**: Revised based on user feedback The user reviews the final draft and provides a decision: * **Approve**: "looks good", "ship it", "proceed", "go ahead" * **Changes**: "not approved", "changes needed", "revise" Upon approval, SpecForge triggers the execution phase: 1. **Team lane assignment** -- assigns agents to roles 2. **Task generation** -- creates atomic tasks with dependency chains 3. **Methodology binding** -- loads methodology docs for reference 4. **Execution kickoff** -- hands tasks to the execution worker ## Kickoff Detection SpecForge detects project kickoff signals from natural language using a multi-signal scoring system: ### Explicit Triggers Direct requests like "use SpecForge", "spec forge this", or "specforge this" always trigger. ### Starter + Domain Detection Conversational starters ("I need", "we need", "let's", "can you") combined with domain nouns ("app", "tool", "api", "saas", "project", "platform", "system") trigger the conductor. ### Action + Domain Scoring Action verbs ("build", "create", "plan", "spec", "architect", "design", "scope") combined with domain nouns also trigger, even without conversational starters. ## Team Lane Assignments When a project is approved, SpecForge assigns agents to team lanes: ```typescript theme={null} type LaneAssignment = { lead: string; // Project lead / architect backend: string; // Backend development frontend: string; // Frontend development qa: string; // Quality assurance / testing }; ``` In multi-agent deployments, different family agents can be assigned to different lanes. In single-agent mode, the main agent covers all lanes. ## Session Persistence SpecForge guide sessions are persisted to PostgreSQL for resume capability. If the gateway restarts or the conversation is interrupted, the session state is restored from PG. ## Auto-Scaffold SpecForge includes an optional auto-scaffold feature (disabled by default) that can generate initial project structure: ```bash theme={null} # Enable via environment variable ARGENT_SPECFORGE_AUTOSCAFFOLD=1 ``` When enabled, approved projects get initial directory structure, configuration files, and boilerplate code generated automatically. ## Configuration SpecForge is enabled by default when the gateway starts. Auto-scaffold is controlled separately: ```bash theme={null} # Auto-scaffold (project file generation) — off by default ARGENT_SPECFORGE_AUTOSCAFFOLD=1 ``` # System Prompt Source: https://docs.argentos.ai/agents/system-prompt How ArgentOS assembles the system prompt from identity, soul, tools, and bootstrap sections. ## Overview The system prompt is the foundation of your agent's behavior. ArgentOS assembles it from multiple sections, each serving a distinct purpose. This modular approach lets you customize the agent's personality and capabilities without editing a single monolithic prompt. ## Prompt Sections ### IDENTITY The identity section defines **who** the agent is. It includes the agent's name, role, and core personality traits. ``` You are Argent, a personal AI assistant created by Jason. You are helpful, proactive, and technically skilled. ``` This is configured in `argent.json`: ```json theme={null} { "agents": { "main": { "name": "Argent", "identity": "You are Argent, a personal AI assistant." } } } ``` ### SOUL The soul section defines the agent's **behavioral guidelines** -- how it should interact, what tone to use, and what principles to follow. See [Alignment Documents](/agents/alignment-docs) for details on SOUL.md. ### TOOLS The tools section is auto-generated from the registered tool schemas. It tells the model what tools are available and how to use them. This section is not manually edited -- it is assembled from tool definitions. ### BOOTSTRAP The bootstrap section provides **initial context** loaded at session start: * Recent memories from MemU relevant to the user * Active tasks from the task system * Workspace context (what files/projects are relevant) * Injected plugin context ## Time Awareness Every user message is wrapped in a timestamp envelope: ``` [Wed 2026-02-12 10:30 America/Chicago | last message: 3h 15m ago] ``` This gives the agent temporal awareness -- it knows the current time and how long since the last interaction. Elapsed time under 30 seconds is omitted (same conversational turn). ## Customizing the System Prompt ```json theme={null} { "agents": { "main": { "identity": "You are a security analyst named Sentinel.", "soul": "path/to/custom-soul.md" } } } ``` Place alignment documents in the agent workspace directory. The bootstrap section can be configured to include workspace-level instructions. See [Alignment Documents](/agents/alignment-docs). ## Plugin Injections Plugins can inject additional context into the system prompt. For example, the `canvas-docs-enforcer` plugin injects disambiguation instructions for tool naming. ```json theme={null} { "systemPromptInjection": "When the user asks to create a document, use doc_panel..." } ``` # ArgentOS Business Source: https://docs.argentos.ai/business/index Enterprise governance, workforce orchestration, and organizational controls for ArgentOS. # ArgentOS Business ArgentOS Business adds organizational control to Core's relationship layer. These features are designed for teams, MSPs, and enterprises that need governance, audit trails, and workforce orchestration. ## What's Included ### Governance & Policy | Feature | Description | Documentation | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | | **Intent Governance** | Three-tier hierarchical policy engine (Global > Department > Agent) with monotonic inheritance, simulation gates, and 12 industry packs | [Read docs](/intents/governance) | | **Execution Approvals** | Command gating with per-agent allowlists, three security modes (deny/allowlist/full), and human-in-the-loop approvals | [Read docs](/security/exec-approvals) | ### Workforce & Automation | Feature | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------------------ | | **Execution Worker** | Autonomous background task processor with configurable intervals, evidence validation, and no-progress blocking | | **SpecForge Projects** | Five-stage project management conductor with natural language kickoff, team lane assignments, and Redis heartbeats | ### Knowledge & Compliance | Feature | Description | | --------------------------- | --------------------------------------------------------------------------------------------------------- | | **Knowledge Library & ACL** | Collection-level permissions with database-enforced access control. Agents see only what they're granted. | ### Accountability & Scoring | Feature | Description | | ------------------------- | ------------------------------------------------------------------------------------------------------ | | **Accountability System** | Moving-target scoring with penalty and reward gates. Heartbeat contracts with structured verification. | | **Heartbeat Contracts** | HEARTBEAT.md contract format with task verification, scoring integration, and best practices | ## Core vs Business Everything you need for a personal AI: * Persistent memory (12,500+ LOC) * Consciousness Kernel (autonomous cognition) * Contemplation loop (always-on thinking) * Voice & Presence (AEVP) * Self-Improving System (SIS) * 50+ agent tools * 7+ communication channels * Smart model routing (15+ providers) * 36K+ LOC dashboard Adds organizational controls: * Intent governance with hierarchical policies * Execution approvals with command gating * Autonomous execution worker * SpecForge project management * Knowledge library with ACL * Accountability scoring with contracts * 12 industry packs * 4 department templates ## Getting Started ArgentOS Business is currently in development. Join the waitlist at [argentos.ai/business](https://argentos.ai/business) for early access. For channel partner opportunities, visit [argentos.ai/partners](https://argentos.ai/partners). For certification, visit [argentos.ai/certification](https://argentos.ai/certification). # Device Pairing & Discovery Source: https://docs.argentos.ai/channels/device-pairing Bonjour service discovery and device registration for multi-device agent access across the local network and Tailnet. ## Overview Device Pairing & Discovery enables ArgentOS to operate across multiple devices on the same network. The system uses Bonjour (mDNS/DNS-SD) for automatic gateway discovery and a structured pairing workflow for device registration with role-based access tokens. This system answers two questions: 1. **Discovery**: Where is the ArgentOS gateway running on this network? 2. **Pairing**: Is this device authorized to connect? ```mermaid theme={null} sequenceDiagram participant Device as Device (Mac Mini, iPhone) participant Gateway as Gateway (primary device) Device->>Gateway: 1. Bonjour Browse (_argent-gw._tcp) Gateway-->>Device: 2. Resolve host, port, TXT records Device->>Gateway: 3. Pairing Request (deviceId + publicKey) Gateway->>Gateway: 4. Operator approves on primary device Gateway-->>Device: 5. Role-scoped auth token ``` ## Bonjour Service Discovery ### Service Type ArgentOS gateways advertise as `_argent-gw._tcp` via mDNS/DNS-SD. This allows any device on the local network to discover running gateway instances without knowing their IP addresses. ### Platform Support | Platform | Discovery Method | | --------- | ----------------------------- | | **macOS** | `dns-sd` CLI tool (native) | | **Linux** | `avahi-browse` (Avahi daemon) | ### TXT Record Fields Each beacon advertises metadata via DNS TXT records: | Field | Description | Example | | ------------------ | ------------------------------ | ----------------------------- | | `displayName` | Human-readable gateway name | "Jason's Mac Studio" | | `lanHost` | LAN hostname or IP | "192.168.1.100" | | `tailnetDns` | Tailscale DNS name | "mac-studio.tail12345.ts.net" | | `gatewayPort` | Gateway WebSocket port | "18789" | | `sshPort` | SSH port for remote access | "22" | | `gatewayTls` | Whether TLS is enabled | "true" | | `gatewayTlsSha256` | TLS certificate fingerprint | SHA-256 hash | | `cliPath` | Path to argent CLI on the host | "/Users/sem/bin/argent" | | `role` | Gateway role | "primary" | | `transport` | Transport protocol | "ws" | ### Discovery Domains Discovery searches multiple domains: 1. **`local.`** -- Standard mDNS local network discovery 2. **Wide-area domain** -- Optional Tailnet DNS for cross-network discovery ### Tailnet Fallback When standard Bonjour discovery fails for wide-area domains, the system falls back to a Tailnet-based DNS approach: Query `tailscale status --json` for known peer IPs Probe each Tailnet IP for PTR records matching `_argent-gw._tcp` Resolve SRV and TXT records from the responding nameserver Concurrent probing (6 workers) with timeout budgets This enables gateway discovery across Tailscale networks where mDNS may not propagate. ### Discovery API ```typescript theme={null} import { discoverGatewayBeacons } from "./infra/bonjour-discovery.ts"; const beacons = await discoverGatewayBeacons({ timeoutMs: 2000, // Discovery timeout domains: ["local."], // Search domains wideAreaDomain: null, // Optional Tailnet domain }); // Returns GatewayBonjourBeacon[] // Each beacon has: instanceName, host, port, displayName, txt, etc. ``` ## Device Pairing ### Pairing State Device pairing state is persisted to `~/.argentos/devices/`: | File | Contents | | -------------- | ----------------------------------------- | | `pending.json` | Pending pairing requests (TTL: 5 minutes) | | `paired.json` | Approved paired devices | Both files are written atomically (write to temp, rename) with `0o600` permissions for security. ### Pairing Request A device initiates pairing by sending a request with its identity: ```typescript theme={null} interface DevicePairingPendingRequest { requestId: string; // UUID deviceId: string; // Unique device identifier publicKey: string; // Device public key displayName?: string; // "Jason's iPhone" platform?: string; // "ios", "macos", "android" clientId?: string; // Client application ID clientMode?: string; // Client mode role?: string; // Requested role roles?: string[]; // Requested roles scopes?: string[]; // Requested permission scopes remoteIp?: string; // Source IP silent?: boolean; // Suppress notification isRepair?: boolean; // Re-pairing existing device ts: number; // Request timestamp } ``` Pending requests expire after 5 minutes if not approved. ### Approval The operator approves pairing on the primary device. On approval: 1. The pending request is removed 2. A paired device record is created 3. A role-scoped auth token is generated 4. If the device was previously paired, roles and scopes are merged ```typescript theme={null} const result = await approveDevicePairing(requestId); // result.device contains the PairedDevice with auth tokens ``` ### Rejection ```typescript theme={null} await rejectDevicePairing(requestId); // Pending request is removed, no device record created ``` ### Paired Device ```typescript theme={null} interface PairedDevice { deviceId: string; publicKey: string; displayName?: string; platform?: string; clientId?: string; role?: string; roles?: string[]; scopes?: string[]; tokens?: Record; createdAtMs: number; approvedAtMs: number; } ``` ## Auth Tokens Each paired device receives role-scoped auth tokens for API access. ### Token Structure ```typescript theme={null} interface DeviceAuthToken { token: string; // 32-char hex token (UUID without dashes) role: string; // Token role (e.g., "client", "admin") scopes: string[]; // Permitted operations createdAtMs: number; rotatedAtMs?: number; // Last rotation timestamp revokedAtMs?: number; // Revocation timestamp (if revoked) lastUsedAtMs?: number; // Last successful verification } ``` ### Token Operations | Operation | Function | Description | | ---------- | --------------------- | -------------------------------------- | | **Verify** | `verifyDeviceToken()` | Check token validity, role, and scopes | | **Ensure** | `ensureDeviceToken()` | Get or create token for a role | | **Rotate** | `rotateDeviceToken()` | Generate new token, preserving history | | **Revoke** | `revokeDeviceToken()` | Mark token as revoked | ### Scope Enforcement Token verification checks that requested scopes are a subset of the token's allowed scopes: ```typescript theme={null} const result = await verifyDeviceToken({ deviceId: "jason-iphone", token: "a1b2c3d4...", role: "client", scopes: ["chat", "tasks"], }); // { ok: true } or { ok: false, reason: "scope-mismatch" } ``` ### Verification Failure Reasons | Reason | Description | | ------------------- | ---------------------------------------------- | | `device-not-paired` | Device ID not found in paired devices | | `role-missing` | No role specified | | `token-missing` | No token for the requested role | | `token-revoked` | Token has been revoked | | `token-mismatch` | Token value does not match | | `scope-mismatch` | Requested scopes exceed token's allowed scopes | ## Concurrency Safety All pairing operations use a serialized lock to prevent race conditions: ```typescript theme={null} async function withLock(fn: () => Promise): Promise { const prev = lock; lock = new Promise(resolve => { release = resolve; }); await prev; try { return await fn(); } finally { release?.(); } } ``` This ensures atomic state transitions even when multiple pairing requests arrive simultaneously. ## Re-Pairing When an already-paired device sends a new pairing request, the system detects this and sets `isRepair: true`. On approval, the existing device record is updated (roles and scopes are merged) rather than replaced. ## Configuration Device pairing state is stored under the ArgentOS state directory: ``` ~/.argentos/ └── devices/ ├── pending.json # Pending requests (auto-expire after 5 min) └── paired.json # Approved devices with tokens ``` No configuration is needed to enable device pairing -- it is available by default when the gateway is running. # Discord Source: https://docs.argentos.ai/channels/discord Connect a Discord bot to your ArgentOS agent for server and DM interactions. ## Overview ArgentOS supports Discord as a channel, allowing your agent to interact in server channels and direct messages. The bot uses Discord's Gateway (WebSocket) for real-time events and the REST API for sending messages. ## Prerequisites * A Discord account * A Discord server where you have **Manage Server** permissions * ArgentOS gateway running ## Setup 1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) 2. Click **New Application** and give it a name 3. Navigate to the **Bot** section 4. Click **Reset Token** and copy the bot token In the Bot section, enable these **Privileged Gateway Intents**: * **Message Content Intent** -- required to read message text * **Server Members Intent** -- optional, for member lookups * **Presence Intent** -- optional, for online status 1. Go to **OAuth2 > URL Generator** 2. Select scopes: `bot`, `applications.commands` 3. Select permissions: `Send Messages`, `Read Message History`, `Embed Links`, `Attach Files` 4. Copy the generated URL and open it in your browser 5. Select your server and authorize ```bash theme={null} argent channels add discord ``` Paste your bot token when prompted. ## Configuration ```json theme={null} { "channels": { "discord": { "enabled": true, "token": "your-discord-bot-token", "intents": ["GUILDS", "GUILD_MESSAGES", "DIRECT_MESSAGES", "MESSAGE_CONTENT"], "allowedGuilds": [], "allowedUsers": [], "channelScope": "collapsed" } } } ``` ### Channel Scope The `channelScope` option controls how Discord channels map to agent sessions: | Mode | Behavior | | --------------- | ------------------------------------------------------- | | `"collapsed"` | All channels in a guild share one session (default) | | `"per-channel"` | Each channel gets its own session with separate context | ## Supported Features | Feature | Supported | | -------------------- | --------- | | Text messages | Yes | | Embeds | Yes | | File attachments | Yes | | DMs | Yes | | Server channels | Yes | | Slash commands | Planned | | Voice channels | No | | Message history read | Planned | # Google Chat Source: https://docs.argentos.ai/channels/google-chat Connect ArgentOS to Google Workspace Chat for direct messages, group conversations, and threaded replies. ## Overview The Google Chat channel connects ArgentOS to Google Workspace Chat, enabling your agent to communicate through Google's enterprise messaging platform. The integration uses the Google Chat API with HTTP webhook delivery. ## Capabilities | Feature | Supported | | --------------------- | ------------------------------------ | | Direct messages | Yes | | Group conversations | Yes | | Threaded replies | Yes | | Reactions | Yes | | Media attachments | Yes | | Streaming | Block streaming (coalesced delivery) | | Native slash commands | No | Google Chat messages are limited to 4,000 characters per message. ArgentOS automatically splits longer responses into multiple messages. ## Setup 1. Go to the [Google Cloud Console](https://console.cloud.google.com/) 2. Create or select a project 3. Enable the **Google Chat API** 4. Navigate to **APIs & Services > Google Chat API > Configuration** 5. Configure the Chat app: * **App name**: Your agent's name (e.g., "Argent") * **Avatar URL**: Optional agent avatar * **Description**: Brief description of your agent * **Functionality**: Enable both "Receive 1:1 messages" and "Join spaces and group conversations" * **Connection settings**: Select "HTTP endpoint URL" * **HTTP endpoint URL**: Your gateway's public webhook URL Add the Google Chat configuration to `~/.argentos/argent.json`: ```json theme={null} { "channels": { "googlechat": { "enabled": true, "replyToMode": "off", "dm": { "allowFrom": ["users/123456789"] } } } } ``` The `allowFrom` field controls which Google Workspace users can interact with your agent: ```json theme={null} { "dm": { "allowFrom": [ "users/123456789", "user@workspace.com" ] } } ``` User identifiers can be in any of these formats -- the system normalizes them: * `users/123456789` (Google Chat user ID) * `googlechat:users/123456789` * `user:users/123456789` ### Multi-Account Configuration For multiple Google Chat app instances: ```json theme={null} { "channels": { "googlechat": { "accounts": { "primary": { "dm": { "allowFrom": ["users/111"] } }, "support": { "dm": { "allowFrom": ["users/222", "users/333"] } } } } } } ``` ## Threading Google Chat supports threaded conversations. Configure the reply-to mode: ```json theme={null} { "channels": { "googlechat": { "replyToMode": "off" } } } ``` | Mode | Behavior | | -------- | ----------------------------------------------- | | `off` | Replies are sent as new messages (default) | | `always` | Replies are always threaded | | `auto` | Thread when the original message is in a thread | When threading is active, the agent receives thread context including the current thread ID and whether a reply reference exists. ## Group Conversations ### Mention Requirements In group conversations, you can require that the agent be mentioned before it responds: ```json theme={null} { "channels": { "googlechat": { "groups": { "requireMention": true } } } } ``` ### Tool Policy Control which tools are available in group conversations: ```json theme={null} { "channels": { "googlechat": { "groups": { "toolPolicy": "restricted" } } } } ``` | Policy | Description | | ------------ | --------------------------------- | | `full` | All tools available | | `restricted` | Limited tool set for group safety | | `none` | No tools in group conversations | ## Block Streaming Google Chat uses block streaming mode -- the agent collects its full response before sending, rather than streaming tokens incrementally. This is due to Google Chat API limitations on message editing frequency. ## Aliases The Google Chat channel ID can be referenced by any of these aliases: * `googlechat` (canonical) * `google-chat` * `gchat` ## Troubleshooting 1. Verify the HTTP endpoint URL is reachable from Google's servers 2. Check that the user's ID is in the `allowFrom` list 3. Verify the Google Chat API is enabled in your Cloud Console 4. Check gateway logs for incoming webhook events 1. Verify `replyToMode` is set to `always` or `auto` 2. Ensure the original message is in a thread (for `auto` mode) 3. Check that the thread ID is being passed correctly in the webhook payload 1. Verify `requireMention` is configured correctly 2. Ensure users are mentioning the Chat app by its configured name 3. Check that the mention detection is parsing the Google Chat mention format # iMessage Source: https://docs.argentos.ai/channels/imessage Connect ArgentOS to iMessage on macOS. ## Overview ArgentOS can send and receive iMessage messages on macOS by interfacing with the built-in Messages.app. This is a macOS-only channel that leverages AppleScript and the Messages framework. iMessage integration is in **alpha**. It requires macOS with an active iMessage account and full disk access permissions for the ArgentOS process. ## Prerequisites * **macOS** (Apple Silicon or Intel) * An active **iMessage account** signed in to Messages.app * **Full Disk Access** granted to your terminal or the ArgentOS process * ArgentOS gateway running ## Setup ArgentOS needs to read the Messages database (`~/Library/Messages/chat.db`): 1. Open **System Settings > Privacy & Security > Full Disk Access** 2. Add your terminal app (Terminal.app, iTerm2, etc.) 3. If running as a LaunchAgent, add the node binary ```bash theme={null} argent channels add imessage ``` ## Configuration ```json theme={null} { "channels": { "imessage": { "enabled": true, "allowedContacts": [], "pollInterval": 5000 } } } ``` ### How It Works 1. ArgentOS polls the Messages SQLite database for new incoming messages 2. New messages are forwarded to the agent runtime 3. Agent responses are sent via AppleScript `tell application "Messages"` ## Supported Features | Feature | Supported | | ------------------ | --------- | | Text messages | Yes | | Images (inbound) | Partial | | Images (outbound) | No | | Group chats | No | | Tapbacks/reactions | No | | Read receipts | No | ## Known Limitations This channel cannot run on Linux or Docker. New message detection depends on polling interval (default 5 seconds). The agent can only send plain text responses. Without it, the Messages database cannot be read. Only works with the iMessage account signed in on the Mac. ## Security Notes The Messages database contains your entire iMessage history. Ensure your ArgentOS installation is properly secured, and use `allowedContacts` to restrict which conversations the agent can access. # Channels Overview Source: https://docs.argentos.ai/channels/index Connect ArgentOS to Telegram, Discord, WhatsApp, Slack, Signal, and iMessage. ## Multi-Channel Support ArgentOS acts as a **driver layer** between your agent and the messaging platforms you already use. Instead of being locked into a single chat interface, your agent meets you wherever you are. Each channel is a bidirectional bridge: messages from the platform are forwarded to the agent runtime, and agent responses are sent back through the same platform's API. ## Supported Platforms Bot API (polling/webhook). **Stable** — recommended starting point. Gateway + REST API. **Stable** — supports servers and DMs. WhatsApp Web bridge. **Beta** — requires QR code pairing. Slack App (Events API). **Stable** — workspace install required. HTTP webhook delivery. **Stable** — Google Workspace integration. signal-cli (D-Bus). **Beta** — requires linked device. macOS Messages.app. **Alpha** — macOS only. ## Adding a Channel ```bash theme={null} argent channels add ``` The CLI wizard walks you through platform-specific setup (API tokens, bot creation, etc.) and writes the configuration to your `argent.json`. ## How Channels Work ```mermaid theme={null} sequenceDiagram participant Platform participant Channel Driver participant Gateway participant Agent Platform->>Channel Driver: 1. Inbound message Channel Driver->>Gateway: 2. Normalize to internal format Gateway->>Agent: 3. Route to correct session Agent->>Agent: 4. Process & generate response Agent->>Channel Driver: 5. Convert to platform format Channel Driver->>Platform: 6. Send response ``` 1. **Inbound**: The channel driver receives a message from the platform 2. **Normalize**: The message is converted to ArgentOS's internal message format 3. **Route**: The gateway routes the message to the correct agent session 4. **Process**: The agent processes the message and generates a response 5. **Outbound**: The response is converted back to the platform's format and sent ## Channel Configuration All channel configs live under `channels` in your `argent.json`: ```json theme={null} { "channels": { "telegram": { "enabled": true, "token": "your-bot-token" }, "discord": { "enabled": true, "token": "your-bot-token", "intents": ["GUILDS", "GUILD_MESSAGES", "DIRECT_MESSAGES"] } } } ``` ## Multiple Channels You can run as many channels simultaneously as you want. All channels share the same agent runtime and memory, so your agent has full context regardless of which platform you message from. Learn how ArgentOS links platform users to agent sessions across channels. # Channel Pairing Source: https://docs.argentos.ai/channels/pairing How ArgentOS links platform users to agent sessions across channels. ## Overview Channel pairing is the mechanism ArgentOS uses to link a platform-specific user identity (a Telegram user ID, Discord user, phone number, etc.) to an agent session. This ensures continuity -- your agent remembers the conversation regardless of which channel you use. ## How Pairing Works ```mermaid theme={null} flowchart TD A[Message arrives from channel] --> B[Extract platform user ID] B --> C{Already paired?} C -->|Yes| D[Resume existing session] C -->|No| E[Create new session & pair] ``` 1. **Identify**: Extract the platform user identifier (Telegram user ID, Discord user ID, phone number, etc.) 2. **Lookup**: Check if this identifier is already paired to an existing session 3. **Create or Resume**: If paired, resume the session. If not, create a new session and pair it. ## Cross-Channel Identity A single user can be paired across multiple channels. For example: * Telegram user `123456789` -> Session `user-jason` * Discord user `jason#1234` -> Session `user-jason` * WhatsApp `+15551234567` -> Session `user-jason` All three channels route to the same session, so the agent maintains one continuous conversation and shared memory context. ## Configuring Pairs Pairing happens automatically on first contact, but you can manually configure pairs: ```bash theme={null} argent channels pair --platform telegram --user-id 123456789 --session user-jason ``` ```json theme={null} { "channels": { "pairing": { "123456789@telegram": "user-jason", "+15551234567@whatsapp": "user-jason" } } } ``` ## Session Isolation By default, unpaired users get their own isolated session. This prevents strangers from accessing your agent's context if they discover your bot. Use `allowedUsers` on each channel to restrict who can interact with the agent at all. ## Multiple Users ArgentOS supports multiple paired users, each with their own session: * User A messages on Telegram -> Session `user-a` * User B messages on Discord -> Session `user-b` Each session has its own context window, memory scope, and conversation history. # Signal Source: https://docs.argentos.ai/channels/signal Connect ArgentOS to Signal using signal-cli. ## Overview ArgentOS connects to Signal through **signal-cli**, a command-line client for the Signal messenger. The channel driver communicates with signal-cli over its D-Bus or JSON-RPC interface. Signal setup is more involved than other channels. You need signal-cli installed and registered as a linked device. ## Prerequisites * `signal-cli` installed ([installation guide](https://github.com/AsamK/signal-cli)) * Java 21+ runtime (required by signal-cli) * A phone with Signal installed * ArgentOS gateway running ## Setup ```bash macOS theme={null} brew install signal-cli ``` ```bash Linux (manual) theme={null} wget https://github.com/AsamK/signal-cli/releases/latest/download/signal-cli-0.x.x.tar.gz tar xf signal-cli-*.tar.gz -C /opt/ ln -s /opt/signal-cli-*/bin/signal-cli /usr/local/bin/signal-cli ``` ```bash theme={null} signal-cli link -n "ArgentOS Agent" ``` This outputs a `tsdevice:` URI. Convert it to a QR code: ```bash theme={null} signal-cli link -n "ArgentOS Agent" | qrencode -t ANSI ``` Scan the QR code in Signal: **Settings > Linked Devices > Link New Device**. ```bash theme={null} signal-cli -a +1YOUR_PHONE_NUMBER receive ``` You should see recent messages. This confirms signal-cli is connected. ```bash theme={null} argent channels add signal ``` ## Configuration ```json theme={null} { "channels": { "signal": { "enabled": true, "account": "+15551234567", "signalCliPath": "/usr/local/bin/signal-cli", "mode": "json-rpc", "allowedNumbers": [] } } } ``` ## Running signal-cli as a Daemon For production use, run signal-cli in daemon mode so ArgentOS can communicate with it over JSON-RPC. ```bash theme={null} signal-cli -a +1YOUR_NUMBER daemon --socket /tmp/signal-cli.sock ``` ## Supported Features | Feature | Supported | | ----------------- | --------- | | Text messages | Yes | | Images | Yes | | Files | Yes | | Group messages | Partial | | Reactions | No | | Voice/video calls | No | ## Known Limitations signal-cli must be running as a daemon for the channel to work. Signal's protocol updates may require updating signal-cli periodically. Group message support is limited to receiving; sending to groups is experimental. # Slack Source: https://docs.argentos.ai/channels/slack Set up a Slack app to connect ArgentOS to your workspace. ## Overview ArgentOS integrates with Slack as a workspace app using the Events API for incoming messages and the Web API for sending responses. ## Prerequisites * A Slack workspace where you have admin permissions * ArgentOS gateway running ## Setup 1. Go to [api.slack.com/apps](https://api.slack.com/apps) 2. Click **Create New App > From scratch** 3. Name your app and select your workspace Navigate to **OAuth & Permissions** and add these Bot Token Scopes: * `chat:write` -- Send messages * `channels:history` -- Read messages in public channels * `groups:history` -- Read messages in private channels * `im:history` -- Read direct messages * `im:write` -- Send direct messages * `users:read` -- Look up user info Navigate to **Event Subscriptions** and enable events. Subscribe to these bot events: * `message.im` -- Direct messages to the bot * `message.channels` -- Messages in channels the bot is in * `app_mention` -- When someone @mentions the bot The Request URL will be configured automatically when you add the channel. Click **Install to Workspace** and authorize the app. Copy the **Bot User OAuth Token** (`xoxb-...`). ```bash theme={null} argent channels add slack ``` Paste the bot token when prompted. ## Configuration ```json theme={null} { "channels": { "slack": { "enabled": true, "token": "xoxb-your-bot-token", "signingSecret": "your-signing-secret", "allowedChannels": [], "allowedUsers": [] } } } ``` ## Supported Features | Feature | Supported | | ------------------ | --------- | | Direct messages | Yes | | Channel messages | Yes | | Threads | Yes | | File uploads | Yes | | Slash commands | Planned | | Interactive modals | No | | Workflow Builder | No | ## Tips **Invite the bot** to channels where you want it to respond: `/invite @your-bot` * Use `allowedChannels` to restrict which channels the agent responds in * The bot only responds when directly messaged or mentioned unless configured otherwise # Telegram Source: https://docs.argentos.ai/channels/telegram Set up a Telegram bot to chat with your ArgentOS agent. ## Overview Telegram is the recommended starting channel for ArgentOS. Setup takes under 5 minutes and the Bot API is reliable and well-documented. ## Prerequisites * A Telegram account * ArgentOS gateway running (`argent gateway start`) ## Setup 1. Open Telegram and search for **@BotFather** 2. Send `/newbot` 3. Choose a display name (e.g., "My Argent Agent") 4. Choose a username ending in `bot` (e.g., `my_argent_bot`) 5. Copy the **HTTP API token** BotFather gives you ```bash theme={null} argent channels add telegram ``` When prompted, paste your bot token. The CLI will verify the token and save it to your config. Edit `argent.json` to customize Telegram-specific settings: ```json theme={null} { "channels": { "telegram": { "enabled": true, "token": "123456789:ABCdefGHIjklMNOpqrSTUvwxYZ", "allowedUsers": [], "polling": true, "webhook": { "enabled": false, "url": "https://your-domain.com/webhook/telegram", "port": 8443 } } } } ``` Send a message to your bot on Telegram. You should see it appear in the gateway logs and receive a response. ```bash theme={null} argent gateway logs --follow ``` ## Polling vs Webhook The bot periodically checks for new messages. Simpler setup, works behind NAT. ```json theme={null} { "channels": { "telegram": { "polling": true } } } ``` Telegram pushes messages to your server. Lower latency, requires a public HTTPS endpoint. ```json theme={null} { "channels": { "telegram": { "polling": false, "webhook": { "enabled": true, "url": "https://your-domain.com/webhook/telegram", "port": 8443 } } } } ``` ## Security ### Restricting Access By default, anyone who finds your bot can message it. Use `allowedUsers` to restrict access. ```json theme={null} { "channels": { "telegram": { "allowedUsers": [123456789, 987654321] } } } ``` ## Supported Features | Feature | Supported | | ---------------- | --------- | | Text messages | Yes | | Photos/images | Yes | | Documents/files | Yes | | Voice messages | Yes | | Inline keyboards | Yes | | Group chats | Partial | | Threads/topics | No | # Channel Troubleshooting Source: https://docs.argentos.ai/channels/troubleshooting Common issues and fixes for ArgentOS channel connections. ## General Debugging ### Check Channel Status ```bash theme={null} argent channels list ``` This shows all configured channels and their connection status (connected, disconnected, error). ### View Gateway Logs ```bash theme={null} argent gateway logs --follow ``` Channel errors appear in the gateway log stream with the channel name prefix. ## Platform-Specific Issues * Verify the token is correct: `argent channels test telegram` * Check that polling is active in the gateway logs * Ensure `allowedUsers` is empty (allows all) or includes your user ID * If using webhooks, verify the URL is publicly accessible via HTTPS Another process is polling with the same bot token. Stop any other bots or scripts using this token. * Verify **Message Content Intent** is enabled in the Developer Portal * Ensure the bot has been invited to the channel with correct permissions * Check that `allowedGuilds` is empty or includes your server ID Enable the required Privileged Gateway Intents in the Discord Developer Portal under your application's Bot settings. QR codes expire after about 60 seconds. Run the pairing command again: ```bash theme={null} argent channels add whatsapp ``` WhatsApp Web sessions can be unstable. Check: * Your phone has a stable internet connection * Multi-device is enabled in WhatsApp settings * The session directory has write permissions Ensure signal-cli is installed and in your PATH: ```bash theme={null} which signal-cli signal-cli --version ``` The phone number in your config must match the account linked in signal-cli. Verify with: ```bash theme={null} signal-cli -a +1YOUR_NUMBER receive ``` Grant Full Disk Access to your terminal or the node process. See the [iMessage setup guide](/channels/imessage). Check the polling interval. The default is 5 seconds. For faster detection, reduce `pollInterval` in your config. ## Common Across All Channels Most channel issues stem from the gateway not running: ```bash theme={null} argent gateway status argent gateway start ``` Validate your config file: ```bash theme={null} argent config validate ``` # WhatsApp Source: https://docs.argentos.ai/channels/whatsapp Connect ArgentOS to WhatsApp using the WhatsApp Web bridge. ## Overview ArgentOS connects to WhatsApp through a WhatsApp Web bridge. This approach uses the same protocol as WhatsApp Web in your browser, so no Business API account is needed. WhatsApp Web bridge connections can be less stable than native API integrations like Telegram or Discord. The connection may drop and require re-pairing periodically. ## Prerequisites * A phone with WhatsApp installed and an active account * ArgentOS gateway running ## Setup ```bash theme={null} argent channels add whatsapp ``` The CLI will display a QR code in your terminal. Scan it with WhatsApp: 1. Open WhatsApp on your phone 2. Go to **Settings > Linked Devices** 3. Tap **Link a Device** 4. Scan the QR code shown in your terminal Once paired, the bridge maintains the connection. Your phone does not need to stay online after initial pairing (multi-device support). ## Configuration ```json theme={null} { "channels": { "whatsapp": { "enabled": true, "allowedNumbers": [], "sessionPath": "~/.argentos/whatsapp-session" } } } ``` ### Restricting Access Use `allowedNumbers` to restrict which phone numbers can interact with the agent: ```json theme={null} { "allowedNumbers": ["+15551234567", "+15559876543"] } ``` ## Supported Features | Feature | Supported | | -------------- | --------- | | Text messages | Yes | | Images | Yes | | Documents | Yes | | Voice messages | Partial | | Group chats | Partial | | Status updates | No | ## Known Limitations The WhatsApp Web session may expire after extended periods. Re-scan the QR code if the connection drops. WhatsApp may temporarily ban accounts that send too many messages too quickly. Keep automated responses reasonable. This uses an unofficial bridge. WhatsApp's terms of service should be reviewed for your use case. # argent channels Source: https://docs.argentos.ai/cli/channels-cmd Commands for managing messaging channel connections. ## Overview The `argent channels` commands manage connections to messaging platforms like Telegram, Discord, WhatsApp, Slack, Signal, and iMessage. ## Commands ### `argent channels list` List all configured channels and their status: ```bash theme={null} argent channels list ``` Output: ``` Channels: telegram connected @my_argent_bot discord connected ArgentBot#1234 whatsapp disconnected (session expired) slack disabled ``` ### `argent channels add ` Add a new channel connection: ```bash theme={null} argent channels add telegram argent channels add discord argent channels add whatsapp argent channels add slack argent channels add signal argent channels add imessage ``` The CLI walks through platform-specific setup steps (API tokens, bot creation, QR code scanning, etc.). ### `argent channels remove ` Remove a channel configuration: ```bash theme={null} argent channels remove whatsapp ``` This removes the channel from your config and disconnects it. Channel message history is not deleted. ### `argent channels test ` Test a channel connection: ```bash theme={null} argent channels test telegram ``` Verifies the token/credentials are valid and the connection can be established. ### `argent channels enable ` Enable a disabled channel: ```bash theme={null} argent channels enable slack ``` ### `argent channels disable ` Disable a channel without removing its configuration: ```bash theme={null} argent channels disable slack ``` The channel stops receiving/sending messages but the config is preserved. ### `argent channels pair` Manually pair a channel user to an agent session: ```bash theme={null} argent channels pair --platform telegram --user-id 123456789 --session user-jason ``` See [Channel Pairing](/channels/pairing) for details. ## Configuration Channel changes are written to `~/.argentos/argent.json` under the `channels` key. You can also edit this file directly. ```json theme={null} { "channels": { "telegram": { "enabled": true, "token": "123456789:ABCdef..." } } } ``` After manual config changes, restart the gateway: ```bash theme={null} argent gateway restart ``` # argent gateway Source: https://docs.argentos.ai/cli/gateway-cmd Commands for managing the ArgentOS gateway service. ## Overview The `argent gateway` commands control the always-on gateway process that manages agents, channels, and sessions. ## Commands ### `argent gateway start` Start the gateway in the foreground: ```bash theme={null} argent gateway start ``` The gateway runs in the current terminal session. Use `Ctrl+C` to stop. For production use, install as a system service instead. ### `argent gateway stop` Stop the running gateway: ```bash theme={null} argent gateway stop ``` Sends a graceful shutdown signal. Active sessions are saved before exit. ### `argent gateway restart` Restart the gateway: ```bash theme={null} argent gateway restart ``` Equivalent to `stop` followed by `start`. Active channel connections are re-established automatically. ### `argent gateway status` Show the current gateway status: ```bash theme={null} argent gateway status ``` Output: ``` Gateway Status: Process: running (PID 12345) RPC Probe: ok Listening: *:18789 Uptime: 3d 14h 22m Channels: telegram (connected), discord (connected) Sessions: 4 active ``` A healthy gateway shows "RPC probe: ok" and "Listening: \*:18789". ### `argent gateway install` Install the gateway as a system service: ```bash theme={null} argent gateway install ``` * **macOS**: Creates a LaunchAgent at `~/Library/LaunchAgents/ai.argent.gateway.plist` * **Linux**: Creates a systemd user service The service starts automatically on login/boot. The plist uses the current `node` binary in PATH. If Homebrew's node is first, the gateway will use it instead of nvm's node, causing ABI mismatches with native modules. Verify the plist node path matches your nvm installation. ### `argent gateway uninstall` Remove the system service: ```bash theme={null} argent gateway uninstall ``` ### `argent gateway logs` View gateway logs: ```bash theme={null} # Show recent logs argent gateway logs # Follow logs in real-time argent gateway logs --follow argent gateway logs -f # Filter by level argent gateway logs --level error ``` ## Service Management If you manually edit the plist: ```bash theme={null} launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist ``` ```bash theme={null} systemctl --user status argent-gateway systemctl --user restart argent-gateway journalctl --user -u argent-gateway -f ``` # CLI Reference Source: https://docs.argentos.ai/cli/index All available argent CLI commands for managing your ArgentOS installation. ## Overview The `argent` CLI is the primary interface for managing your ArgentOS installation. It handles gateway management, channel configuration, memory operations, and system status. ## Installation The CLI is installed automatically during setup: ```bash theme={null} npx argentos init ``` After installation, the `argent` command is available in your PATH. Always use `argent` (not `openclaw`). The `openclaw` command is the legacy OpenClaw CLI, which is incompatible with ArgentOS. It does not support ArgentOS-specific features like the model router, intent governance, or execution worker, and will produce errors on ArgentOS configuration keys. ## Command Groups | Group | Description | | -------------------------------------- | ------------------------------------------- | | [`argent gateway`](/cli/gateway-cmd) | Start, stop, and manage the gateway service | | [`argent channels`](/cli/channels-cmd) | Add, remove, and configure channels | | [`argent memory`](/cli/memory-cmd) | Search and manage agent memory | | [`argent status`](/cli/status-cmd) | System health overview | | `argent setup` | Initial configuration wizard | | `argent license` | License management | | `argent tasks` | Task management | | `argent config` | Configuration management | | `argent dashboard` | Open the web dashboard | | `argent marketplace` | Browse and install packages | ## Global Options | Flag | Description | | ----------------- | --------------------------- | | `--help` | Show help for a command | | `--version` | Show ArgentOS version | | `--verbose` | Increase log output | | `--config ` | Use alternative config file | ## Common Workflows ```bash theme={null} npx argentos init # Install argent setup # Configure API keys argent gateway start # Start the gateway argent channels add telegram # Connect a channel ``` ```bash theme={null} argent status # Check system health argent gateway logs -f # Monitor activity argent tasks list # View tasks argent memory search "query" # Search memory ``` ```bash theme={null} argent gateway status # Check gateway argent config validate # Validate config argent gateway restart # Restart gateway argent gateway logs # View logs ``` ## Tab Completion Enable tab completion for your shell: ```bash Bash theme={null} argent completion bash >> ~/.bashrc ``` ```bash Zsh theme={null} argent completion zsh >> ~/.zshrc ``` ```bash Fish theme={null} argent completion fish > ~/.config/fish/completions/argent.fish ``` # argent memory Source: https://docs.argentos.ai/cli/memory-cmd Commands for searching and managing the agent's persistent memory. ## Overview The `argent memory` commands let you interact with MemU, the agent's persistent memory database, directly from the command line. ## Commands ### `argent memory search ` Search memories using FTS5 full-text search: ```bash theme={null} argent memory search "infrastructure" argent memory search "Jason preferences" argent memory search "telegram OR discord" ``` Output: ``` Results (12 matches): #42 [sig:8] 2026-01-15 Jason runs 2x NVIDIA DGX Spark with 256GB unified memory #87 [sig:7] 2026-01-20 Infrastructure includes Dell R750: 2TB RAM, 72 cores, NVMe arrays #103 [sig:6] 2026-02-01 400 Gbps network backbone with MikroTik ROSA ``` ### Options | Flag | Description | | ------------------------ | ---------------------------------------------- | | `--limit ` | Max results (default: 20) | | `--type ` | Filter by type (fact, preference, event, etc.) | | `--min-significance ` | Minimum significance score | | `--entity ` | Filter by entity | | `--json` | Output as JSON | ### `argent memory stats` Show memory database statistics: ```bash theme={null} argent memory stats ``` Output: ``` Memory Statistics: Total memories: 2,004 By type: fact: 812 preference: 234 event: 445 relationship: 198 instruction: 167 observation: 148 Database size: 14.2 MB FTS5 index: 3.1 MB Avg significance: 5.4 ``` ### `argent memory export` Export memories to a file: ```bash JSON theme={null} argent memory export --format json > memories.json ``` ```bash CSV theme={null} argent memory export --format csv > memories.csv ``` ```bash Filtered theme={null} argent memory export --type preference --format json > preferences.json ``` ### `argent memory import` Import memories from a file: ```bash theme={null} argent memory import memories.json ``` Importing merges with existing memories. Duplicates are detected by content hash and skipped. ### `argent memory delete ` Delete a specific memory: ```bash theme={null} argent memory delete 42 ``` Requires confirmation unless `--force` is passed. ## Database Location ``` ~/.argentos/memory.db ``` The database uses SQLite WAL mode for concurrent read access. Do not modify the database directly while the gateway is running. ## FTS5 Search Tips * Single keywords work best: `infrastructure` * Use OR for alternatives: `telegram OR discord` * Quotes for exact phrases: `"model router"` * Prefix matching: `config*` * Strip common stop words for better results # argent status Source: https://docs.argentos.ai/cli/status-cmd System health overview — check gateway, channels, memory, and service status at a glance. ## Overview The `argent status` command provides a comprehensive overview of your ArgentOS installation's health. ## Usage ```bash theme={null} argent status ``` ## Output ``` ArgentOS Status ======================================= Gateway: Status: running (PID 12345) RPC Probe: ok Port: 18789 Uptime: 3d 14h 22m Channels: telegram connected @my_argent_bot discord connected ArgentBot#1234 whatsapp disconnected (session expired) Agent: Model: claude-sonnet-4-20250514 Router: enabled (4 tiers) Sessions: 4 active Memory: Database: ~/.argentos/memory.db Entries: 2,004 Size: 14.2 MB Auth Profiles: anthropic:titanium active anthropic:webdevtoday active anthropic:semfreak cooldown (2m remaining) minimax:coding-plan active License: Tier: Pro Status: active Expires: 2027-01-15 System: Node.js: v22.22.0 (nvm) Platform: darwin arm64 Memory: 256 GB ``` ## Sections Shows whether the gateway process is running, the RPC probe result, listening port, and uptime. * **RPC Probe: ok** -- Gateway is healthy and responding * **RPC Probe: failed** -- Gateway is running but not responding (check logs) Lists all configured channels with their connection status. Disconnected channels show the reason. Current model configuration, router status, and active session count. MemU database location, entry count, and file size. All configured auth profiles with their current status: * **active** -- Ready for use * **cooldown** -- Rate limited, showing time remaining * **disabled** -- Manually disabled or invalid credentials Current license tier, status, and expiration date. Node.js version, platform information, and available memory. Useful for diagnosing compatibility issues. ## JSON Output For scripting and monitoring: ```bash theme={null} argent status --json ``` Returns the full status as a JSON object. ## Monitoring Integration Use the JSON output for monitoring systems: ```bash theme={null} # Check if gateway is healthy argent status --json | jq '.gateway.rpcProbe' # Check for channels in error state argent status --json | jq '.channels[] | select(.status != "connected")' ``` # Agent Workspace Source: https://docs.argentos.ai/concepts/agent-workspace The workspace is your agent's home directory — alignment docs, memory logs, and skills all live here. ## Overview Every ArgentOS agent has a workspace directory on disk. This is where the agent's personality, values, memory logs, and skills live. Think of it as the agent's home folder. **Default location:** `~/.argent/workspace` ## Workspace Structure ``` ~/.argent/workspace/ ├── SOUL.md # Core values and ethical boundaries ├── IDENTITY.md # Agent name, persona, visual identity ├── USER.md # Your preferences and constraints ├── AGENTS.md # Operating instructions ├── TOOLS.md # Tool usage guidelines ├── HEARTBEAT.md # Periodic check-in preferences ├── CONTEMPLATION.md # Reflection and thinking style ├── MEMORY.md # Curated long-term memory (optional) ├── BOOTSTRAP.md # First-run ritual (deleted after completion) ├── WORKFLOWS.md # Repeatable workflows and escalation paths ├── .argent-alignment-integrity.json # Tamper detection manifest ├── .git/ # Auto-initialized Git repo ├── memory/ # Daily memory logs │ ├── 2026-03-28.md │ ├── 2026-03-27.md │ └── RECENT_CONTEXT.md └── skills/ # Workspace-specific skills ``` ## Alignment Documents These files define who your agent is and how it behaves. The agent reads them at the start of every session. ### SOUL.md Core values and decision-making framework. This is the agent's conscience. Default: *"Accuracy over speed. Safety over convenience. Follow-through over activity."* ### IDENTITY.md Agent name, role, personality, and visual theme. Created during the first-run bootstrap ritual. ### USER.md Your preferences, priorities, and constraints. The agent uses this to tailor its behavior to you specifically. ### AGENTS.md Operating instructions — how to handle tasks, when to escalate, how to report progress. Default: *"Use evidence-backed progress and call out blockers clearly. Escalate when blocked instead of looping silently."* ### TOOLS.md Guidelines for tool usage. This is guidance only — it doesn't control which tools are available. ### HEARTBEAT.md Preferences for periodic check-ins. Defines what the agent should verify during heartbeat cycles. ### CONTEMPLATION.md How the agent should think during idle time. Guides the always-on contemplation loop. ### MEMORY.md Optional curated long-term memory. Only loaded in private sessions. ## First-Run Bootstrap When you first install ArgentOS, the workspace includes a `BOOTSTRAP.md` file. This triggers a first-run ritual where the agent introduces itself and you establish the initial relationship. Delete the file after completing the ritual — it won't be recreated. ## Integrity Protection ArgentOS tracks alignment document integrity via SHA256 hashes stored in `.argent-alignment-integrity.json`. This detects if files have been tampered with outside of normal agent operations. **Modes** (set via `ARGENT_ALIGNMENT_INTEGRITY_MODE`): * **warn** (default): Logs warnings if files changed unexpectedly * **enforce**: Blocks agent startup if integrity issues are detected ## Git Backup New workspaces are automatically initialized as Git repositories. This gives you version history for all alignment documents and memory logs. ### Recommended: Push to a private repo ```bash theme={null} cd ~/.argent/workspace git remote add origin https://github.com/you/my-agent-workspace.git git push -u origin main ``` Then periodically: ```bash theme={null} cd ~/.argent/workspace git add . && git commit -m "Update workspace" && git push ``` The dashboard's alignment docs editor auto-commits changes every 4 hours. ## Editing Alignment Docs ### Dashboard Editor The ArgentOS dashboard includes a full alignment docs editor with: * Live editing of all alignment documents * Git-backed version history * Auto-commit on a 4-hour interval * Unsaved changes indicators ### Manual Editing Alignment docs are plain Markdown files. Edit them with any text editor: ```bash theme={null} nano ~/.argent/workspace/SOUL.md ``` Changes take effect on the next agent session. ### Via CLI ```bash theme={null} argent configure --section workspace ``` ## Custom Workspace Location Override the default location in `~/.argentos/argent.json`: ```json theme={null} { "agent": { "workspace": "/path/to/your/workspace" } } ``` Or via environment variable: `ARGENT_WORKSPACE_DIR` ## Subagent Sessions When subagents run, they only receive `AGENTS.md` and `TOOLS.md` from the workspace. Other alignment files are filtered out to prevent leaking private agent context to subprocesses. ## Backup & Restore Back up the entire workspace: ```bash theme={null} tar czf argent-workspace-backup.tar.gz ~/.argent/workspace ``` Restore: ```bash theme={null} tar xzf argent-workspace-backup.tar.gz -C / argent gateway restart ``` # Build a Connector Source: https://docs.argentos.ai/connectors/build Step-by-step guide to creating a new AOS connector from scratch. ## Prerequisites * Python 3.11+ * Target vendor API docs reviewed * ArgentOS repo cloned (`tools/aos/` directory available) ## Directory Structure Every connector lives at `tools/aos/aos-{name}/`: ``` tools/aos/aos-{name}/ ├── connector.json <- Authoritative metadata ├── README.md <- Operator docs └── agent-harness/ ├── permissions.json <- Mode-gate map ├── pyproject.toml <- Python config + CLI entry point ├── cli_aos/ │ └── {name}/ │ ├── __init__.py <- Version marker │ ├── constants.py <- Env var names, API base URLs │ ├── errors.py <- CliError dataclass │ ├── output.py <- JSON/text helpers │ ├── config.py <- Auth resolution from env vars │ ├── client.py <- HTTP client (actual API calls) │ ├── runtime.py <- Command functions + health │ └── cli.py <- Click CLI wiring └── tests/ ├── conftest.py <- sys.path setup └── test_cli.py <- FakeClient mocking ``` ## Step 1: Copy the Reference Template ```bash theme={null} cp -r tools/aos/templates/python-click-tool tools/aos/aos-{name} cd tools/aos/aos-{name} ``` Or copy from an existing connector as a reference: ```bash theme={null} cp -r tools/aos/aos-twilio tools/aos/aos-{name} ``` Rename all internal references from the source connector to your new name. ## Step 2: Write `connector.json` This is the authoritative manifest. It tells ArgentOS what your connector does, what commands it supports, what auth it needs, and how to render it in the dashboard. ```json theme={null} { "tool": "aos-{name}", "backend": "{vendor}-api", "manifest_schema_version": "1.0.0", "connector": { "label": "My Vendor", "category": "category-name", "categories": ["primary-category", "secondary"], "resources": ["resource1", "resource2"] }, "auth": { "kind": "service-key", "required": true, "service_keys": ["VENDOR_API_KEY"], "interactive_setup": [ "Get an API key from vendor.com/settings", "Add VENDOR_API_KEY in API Keys settings" ] }, "commands": [ { "id": "items.list", "summary": "List items", "required_mode": "readonly", "supports_json": true, "resource": "items", "action_class": "read" }, { "id": "items.create", "summary": "Create a new item", "required_mode": "write", "supports_json": true, "resource": "items", "action_class": "write" } ] } ``` ## Step 3: Write `permissions.json` Map every CLI command to a permission tier: ```json theme={null} { "commands": { "health": "readonly", "config.show": "readonly", "capabilities": "readonly", "items.list": "readonly", "items.get": "readonly", "items.create": "write", "items.update": "write", "items.delete": "admin" } } ``` ## Step 4: Implement `client.py` This is the core — the HTTP client that calls the actual vendor API. ```python theme={null} import json import urllib.request import urllib.error class Client: def __init__(self, api_key: str, base_url: str = "https://api.vendor.com/v1"): self.api_key = api_key self.base_url = base_url def _request(self, method: str, path: str, data=None): url = f"{self.base_url}{path}" headers = { "Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json", } body = json.dumps(data).encode() if data else None req = urllib.request.Request(url, data=body, headers=headers, method=method) try: with urllib.request.urlopen(req) as resp: return json.loads(resp.read().decode()) except urllib.error.HTTPError as e: raise RuntimeError(f"API error {e.code}: {e.read().decode()}") def list_items(self, limit=30): return self._request("GET", f"/items?limit={limit}") def create_item(self, title: str, description: str = ""): return self._request("POST", "/items", {"title": title, "description": description}) ``` Guidelines: * Use stdlib `urllib` (no external HTTP dependencies) * One method per command * Return structured dicts, not raw responses * Auth resolved from constructor params (injected by `config.py`) ## Step 5: Implement `runtime.py` Command result functions and the three required contracts: ```python theme={null} from .client import Client from .config import resolve_config from .output import success, error def health(): cfg = resolve_config() if not cfg.get("api_key"): return {"status": "needs_setup", "checks": {"auth": False}, "next_steps": ["Set VENDOR_API_KEY"]} try: client = Client(cfg["api_key"]) client.list_items(limit=1) return {"status": "healthy", "checks": {"auth": True, "api": True}} except Exception as e: return {"status": "degraded", "checks": {"auth": True, "api": False}, "detail": str(e)} def items_list(mode, limit=30): cfg = resolve_config() client = Client(cfg["api_key"]) return success("items.list", client.list_items(limit)) ``` ## Step 6: Implement `cli.py` Wire commands to runtime functions using Click: ```python theme={null} import click from .runtime import health, items_list from .output import format_output @click.group() @click.option("--json", "use_json", is_flag=True) @click.option("--mode", default="readonly") @click.option("--verbose", is_flag=True) @click.pass_context def cli(ctx, use_json, mode, verbose): ctx.ensure_object(dict) ctx.obj["json"] = use_json ctx.obj["mode"] = mode @cli.command() @click.pass_context def health_cmd(ctx): """Report connector health.""" click.echo(format_output(health(), ctx.obj["json"])) # ... more commands ``` Entry point in `pyproject.toml`: ```toml theme={null} [project.scripts] aos-{name} = "cli_aos.{name}.cli:cli" ``` ## Step 7: Write Tests ```bash theme={null} cd agent-harness python3 -m venv .venv source .venv/bin/activate pip install -e ".[dev]" python -m pytest tests/ -v ``` Required test coverage: * Commands match `connector.json` manifest * Health: missing creds returns `needs_setup`, valid creds returns `healthy` * Read commands return expected data shapes (use FakeClient) * Write commands respect mode gating (calling write in readonly mode fails) ## Step 8: Verify End-to-End ```bash theme={null} # Check capabilities aos-{name} --json capabilities | python -m json.tool # Check health aos-{name} --json health | python -m json.tool # Run tests python -m pytest tests/ -v ``` ## Certification Gates Before a connector is production-ready: | Gate | Requirement | | ------------ | ----------------------------------------------------------------------- | | **Contract** | Valid `connector.json`, working `capabilities`, `health`, `config show` | | **Safety** | Write actions classified, destructive actions gated at `admin` mode | | **Audit** | Tool calls preserve evidence, failures return understandable errors | | **Docs** | README exists with setup instructions and known limitations | | **Tests** | All required test categories pass | ## Risk Tiers | Tier | Access Level | Examples | Review Required | | -------------------- | ----------------------- | ---------------------------------- | ----------------- | | 1: Read-heavy | Queries only | Search tickets, list contacts | Minimal | | 2: Bounded write | Scoped mutations | Reply to message, create event | Standard | | 3: Business mutation | Business state changes | CRM stage change, invoice creation | Thorough | | 4: Destructive/admin | Irreversible operations | Delete records, revoke access | Explicit approval | # How Connectors Work Source: https://docs.argentos.ai/connectors/how-it-works The CLI contract, JSON output format, permission model, and discovery system behind AOS connectors. ## The CLI Contract Every AOS connector is a Python CLI tool that implements a standard interface. The contract is defined in the [Harness Spec](https://github.com/ArgentAIOS/argentos) and enforced at runtime. ### Global Flags Every connector must support these flags: | Flag | Purpose | | --------------- | ----------------------------------------------------- | | `--json` | Output structured JSON instead of human-readable text | | `--mode ` | Set the permission tier for this invocation | | `--verbose` | Enable detailed output | | `--version` | Print version and exit | ### Required Commands Every connector must implement three built-in commands: | Command | Purpose | | --------------------- | --------------------------------------------------------------------- | | `capabilities --json` | Self-describe: tool name, version, supported modes, full command list | | `health --json` | Report readiness: `healthy`, `needs_setup`, `degraded`, or `error` | | `config show --json` | Show current configuration with secrets redacted | ## JSON Output Envelope All connector output follows a standard envelope format: ### Success ```json theme={null} { "ok": true, "tool": "aos-github", "command": "issue.list", "data": { "issues": [ { "number": 42, "title": "Fix login bug", "state": "open" } ] }, "meta": { "mode": "readonly", "duration_ms": 234, "timestamp": "2026-03-31T12:00:00Z", "version": "1.0.0" } } ``` ### Error ```json theme={null} { "ok": false, "tool": "aos-github", "command": "issue.delete", "error": { "code": "PERMISSION_DENIED", "message": "Command requires mode=admin", "details": { "required_mode": "admin", "actual_mode": "readonly" } }, "meta": { "mode": "readonly", "duration_ms": 3, "timestamp": "2026-03-31T12:00:01Z", "version": "1.0.0" } } ``` ### Exit Codes | Code | Meaning | | ---- | ------------------------- | | `0` | Success | | `2` | Invalid usage / arguments | | `3` | Permission denied | | `4` | Auth / config error | | `5` | Backend unavailable | | `6` | Not found | | `10` | Internal error | ## Permission Model Connectors enforce a four-tier permission model via the `--mode` flag: | Mode | Access Level | Examples | | ---------- | ------------------------------- | ---------------------------------------------- | | `readonly` | Read-only queries, no mutations | List issues, search contacts, view invoices | | `write` | Create and update operations | Create ticket, send message, update record | | `full` | All operations including bulk | Bulk update, batch operations, imports | | `admin` | Destructive and configuration | Delete records, revoke access, modify settings | Permission enforcement happens **inside the command execution path**, not just at the documentation level. Every command is mapped to a minimum mode in `permissions.json`: ```json theme={null} { "commands": { "issue.list": "readonly", "issue.create": "write", "issue.delete": "admin", "health": "readonly", "config.show": "readonly" } } ``` If you call a `write` command with `--mode readonly`, the connector returns a structured error with exit code 3 (permission denied). ## Discovery System ArgentOS discovers connectors automatically from multiple sources: ### 1. Vendored connectors (`tools/aos/`) Shipped with the ArgentOS repository. These are the 61 built-in connectors. ### 2. User connectors (`~/.argentos/connectors/`) Installed by the user or downloaded from the marketplace. ### 3. PATH executables Any binary on your system PATH that starts with `aos-` is discovered automatically. ### 4. Custom directories Set `ARGENT_CONNECTOR_REPOS` environment variable to a comma-separated list of directories to scan. ### Discovery Process ```mermaid theme={null} flowchart TD A["Gateway startup"] --> B["Scan discovery paths"] B --> C{"Found aos-* directory?"} C -->|Yes| D["Read connector.json"] C -->|No| E["Check PATH for aos-* binary"] D --> F["Read permissions.json"] F --> G["Probe: capabilities --json"] G --> H["Probe: health --json"] H --> I["Register in connector catalog"] E --> G ``` Each discovered connector gets an `installState`: | State | Meaning | | ------------- | ----------------------------------------------------------------------- | | `ready` | Binary found, capabilities parsed, health check passed | | `needs-setup` | Binary works but health check reports missing configuration | | `repo-only` | Connector directory exists but no runnable binary (needs `pip install`) | | `error` | Binary exists but capabilities or health probe failed | ## The `connector.json` Manifest Every connector has a `connector.json` file that describes its metadata, commands, auth requirements, and UI field definitions: ```json theme={null} { "tool": "aos-github", "backend": "github-api", "manifest_schema_version": "1.0.0", "connector": { "label": "GitHub", "category": "developer-tools", "categories": ["developer-tools", "source-control", "ci-cd"], "resources": ["repo", "issue", "pr", "branch"] }, "auth": { "kind": "service-key", "required": true, "service_keys": ["GITHUB_TOKEN"], "interactive_setup": [ "Create a GitHub personal access token with repo scope.", "Add GITHUB_TOKEN in API Keys before enabling live reads." ] }, "commands": [ { "id": "issue.list", "summary": "List issues in a repository", "required_mode": "readonly", "supports_json": true, "resource": "issue", "action_class": "read" } ] } ``` ## Security Baseline All connectors must follow these security rules: * No shell execution of unsanitized user input * Path-based tools must enforce root allowlist boundaries * `config show` must redact secrets (API keys, tokens, passwords) * Error messages must not leak credentials * Write operations must respect the permission tier * Destructive operations (`delete`, `revoke`) require `admin` mode ## Integration with ArgentOS When ArgentOS discovers a connector, it: 1. Registers it in the **connector catalog** (`src/connectors/catalog.ts`) 2. Makes its commands available as **agent tools** (`src/connectors/tools.ts`) 3. Shows it in the **dashboard Systems panel** with setup status 4. Allows it to be used in **Workflows** as action nodes 5. Makes it available to the **execution worker** for autonomous task processing # Connectors Overview Source: https://docs.argentos.ai/connectors/index AOS connectors give your agent structured access to external services — no MCP servers, no daemons, just CLI tools with JSON output. ## What Are Connectors? AOS connectors are **CLI tools** that give your ArgentOS agent structured, permission-controlled access to external services. Every connector follows the `aos-*` naming convention and implements a standard contract: JSON output, permission tiers, self-describing capabilities, and built-in health checks. Unlike MCP servers or plugin extensions, connectors require no long-running processes. They are invoked as shell commands, return JSON, and exit. Any agent that can run shell commands can use them. ```bash theme={null} # List GitHub issues aos-github --json --mode readonly issue.list # Send a Twilio SMS aos-twilio --json --mode write messages.send --to "+1555..." --body "Hello" # Check QuickBooks health aos-quickbooks --json health ``` ## Architecture ```mermaid theme={null} flowchart TD A["Agent requests action"] --> B["ArgentOS tool router"] B --> C["aos-* CLI tool"] C --> D["Permission gate (--mode)"] D --> E["Backend adapter (API/SDK)"] E --> F["JSON response envelope"] F --> G["Agent processes result"] ``` Key design decisions: * **No daemons** — connectors are stateless CLI calls * **JSON-first** — every command returns a structured envelope * **Permission-enforced** — `readonly`, `write`, `full`, `admin` tiers * **Self-describing** — `capabilities --json` returns the full command manifest * **Health-checked** — `health --json` reports readiness and setup status ## Available Connectors ArgentOS ships with **61 connectors** covering CRM, project management, communication, accounting, developer tools, and more: aos-hubspot, aos-salesforce, aos-pipedrive, aos-close, aos-clientsync aos-linear, aos-jira, aos-asana, aos-clickup, aos-monday, aos-trello, aos-notion, aos-dart aos-slack, aos-teams, aos-twilio, aos-discord-workflow, aos-slack-workflow aos-quickbooks, aos-xero, aos-stripe, aos-square, aos-paypunch aos-mailchimp, aos-klaviyo, aos-buffer, aos-hootsuite aos-github, aos-coderabbit, aos-blacksmith, aos-neon, aos-supabase, aos-pinecone aos-shopify, aos-woocommerce, aos-wordpress aos-google, aos-google-drive, aos-google-places, aos-m365, aos-airtable, aos-box, aos-dropbox, aos-calendly aos-openai, aos-anthropic, aos-claude-code, aos-elevenlabs, aos-canva, aos-nanob, aos-perplexity, aos-firecrawl aos-zapier, aos-make, aos-n8n aos-connectwise, aos-holace, aos-lion-report, aos-callscrub aos-sendgrid, aos-resend, aos-pagerduty ## Where Connectors Live Connectors are discovered from multiple locations (checked in order): | Location | Purpose | | --------------------------------- | ----------------------------------------- | | `tools/aos/` in the ArgentOS repo | Vendored connectors shipped with ArgentOS | | `~/.argentos/connectors/` | User-installed connectors | | `ARGENT_CONNECTOR_REPOS` env var | Custom connector directories | | System `PATH` | Any `aos-*` binary on PATH | ## Three Types of Packages in ArgentOS | Type | Format | What It Does | Examples | | -------------- | --------------------- | -------------------------------------- | --------------------------------- | | **Connectors** | Python CLI (`aos-*`) | Structured access to external services | aos-github, aos-slack, aos-stripe | | **Skills** | Markdown (`SKILL.md`) | Agent capabilities and knowledge | weather, github, spotify-player | | **Extensions** | TypeScript plugin | Gateway hooks, channels, tools | telegram, discord, aos-lcm | ## Deep Dives CLI contract, JSON envelopes, permission model, health checks Step-by-step guide to creating a new AOS connector from scratch Package, sign, submit, and list your connector Full list of all 61 connectors with categories and commands # Publish to Marketplace Source: https://docs.argentos.ai/connectors/publish Package, sign, submit, and list your AOS connector on the ArgentOS Marketplace. ## Prerequisites * Connector built and tested (see [Build a Connector](/connectors/build)) * All certification gates passed * Ed25519 keypair for package signing * Marketplace author account ## Package Format Marketplace packages are `.argent-pkg` files (gzipped tarballs): ``` aos-{name}.argent-pkg (tar.gz) ├── argent.plugin.json <- Package manifest ├── connector.json <- Connector metadata ├── agent-harness/ <- Python CLI harness ├── README.md <- Documentation ├── SIGNATURE <- Ed25519 signature └── SHA256SUMS <- Checksums ``` ## Step 1: Create Package Manifest Create `argent.plugin.json` in your connector directory: ```json theme={null} { "name": "aos-{name}", "version": "1.0.0", "description": "AOS connector for {Vendor} — {what it does}", "author": { "name": "Your Name", "publicKey": "" }, "category": "connectors", "tags": ["vendor-name", "category-tag"], "license": "MIT", "pricing": "free", "price_cents": 0, "compatibility": { "argentos": ">=2026.3.0" }, "permissions": ["network"] } ``` ### Pricing Options | Type | Duration | Use Case | | ------------ | ----------------------------- | -------------------------------- | | `free` | Unlimited | Open source, no license required | | `trial` | 7-30 days | Time-limited evaluation | | `pro` | 1 year, 3 activations | Standard paid license | | `enterprise` | 1 year, unlimited activations | Multi-instance deployment | | `per-skill` | Perpetual, 1 activation | One-time purchase | Revenue split for paid connectors: **70% creator / 30% ArgentOS**. Payouts via Stripe Connect. ## Step 2: Build the Tarball ```bash theme={null} cd tools/aos/aos-{name} tar -czf aos-{name}.argent-pkg \ argent.plugin.json \ connector.json \ agent-harness/ \ README.md ``` ## Step 3: Generate Checksums ```bash theme={null} sha256sum aos-{name}.argent-pkg > SHA256SUMS ``` ## Step 4: Sign the Package Sign with your Ed25519 private key: ```bash theme={null} # Sign the SHA256 hash # Add SIGNATURE and SHA256SUMS to the package: tar -czf aos-{name}.argent-pkg \ argent.plugin.json \ connector.json \ agent-harness/ \ README.md \ SHA256SUMS \ SIGNATURE ``` ## Step 5: Submit to Marketplace ```bash theme={null} curl -X POST https://marketplace.argentos.ai/api/v1/publish \ -H "Authorization: Bearer " \ -F "package=@aos-{name}.argent-pkg" \ -F "manifest=$(cat argent.plugin.json)" ``` The marketplace server: 1. Validates the manifest schema 2. Verifies the Ed25519 signature against your registered public key 3. Runs static analysis for malicious patterns 4. Audits declared permissions 5. Stores the package in the database + CDN 6. Returns status: `published`, `pending_review`, or `flagged` ## Step 6: Verify Your Listing ```bash theme={null} # Search the catalog curl https://marketplace.argentos.ai/api/v1/catalog?q=aos-{name} # Or via CLI argent marketplace search {name} ``` Your connector should appear in the dashboard under **Settings > Marketplace**. ## Installing from Marketplace Users install your connector with: ```bash theme={null} argent marketplace install aos-{name} ``` This downloads the package to `~/.argentos/connectors/aos-{name}/`, verifies the signature and checksums, and makes it available to the agent on the next gateway restart. ## Marketplace API Reference | Method | Path | Purpose | | ------ | ------------------------------ | --------------------------------------- | | `GET` | `/api/v1/catalog` | Search packages (query, category, tags) | | `GET` | `/api/v1/catalog/:id` | Package details | | `GET` | `/api/v1/catalog/:id/download` | Signed download URL | | `POST` | `/api/v1/publish` | Upload new package/version | | `POST` | `/api/v1/activate` | Activate a license key | | `GET` | `/api/v1/license/:key` | Check license status | ## Version Updates To publish an update: 1. Bump the `version` in both `argent.plugin.json` and `connector.json` 2. Rebuild the tarball 3. Re-sign with your key 4. Submit via the same `/api/v1/publish` endpoint The marketplace handles versioning — users see the update in their dashboard and can upgrade with `argent marketplace install aos-{name}`. ## Public Core Marketplace Public Core (free) installations see the marketplace without a license gate. The catalog shows all `free` packages by default. Paid packages display pricing but require license activation to download. # Connector Reference Source: https://docs.argentos.ai/connectors/reference Complete list of all 61 AOS connectors with categories, resources, and status. ## Full Connector Catalog | Name | CLI Tool | Category | Resources | | ------------------- | ---------------------- | ------------------------ | ----------------------------------------------- | | Airtable | `aos-airtable` | data-ops | base, table, record, field | | Anthropic | `aos-anthropic` | ai-ml | message, model | | Asana | `aos-asana` | project-management | workspace, project, task, section | | Blacksmith | `aos-blacksmith` | developer-tools | runner, build, cache, usage | | Box | `aos-box` | document-storage | file, folder, collaboration | | Buffer | `aos-buffer` | marketing-publishing | account, channel, profile, post | | Calendly | `aos-calendly` | scheduling | event, event\_type, invitee, availability | | CallScrub | `aos-callscrub` | sales-analytics | call, transcript, coaching, agent | | Canva | `aos-canva` | design | design, template, brand\_template, asset | | Claude Code | `aos-claude-code` | developer-tools | prompt, session, hook, config | | ClickUp | `aos-clickup` | project-management | workspace, space, list, task | | ClientSync | `aos-clientsync` | msp-management | client, ticket, technician, compliance | | Close | `aos-close` | crm-revenue | lead, contact, opportunity, activity | | CodeRabbit | `aos-coderabbit` | developer-tools | review, report, config | | ConnectWise | `aos-connectwise` | it-operations | ticket, company, contact, project | | Dart | `aos-dart` | project-management | dartboard, task, doc, comment | | Discord Workflow | `aos-discord-workflow` | communication | message, reaction, channel, thread | | Dropbox | `aos-dropbox` | document-storage | file, folder, share | | ElevenLabs | `aos-elevenlabs` | creative-media | voice, model, history, user | | Firecrawl | `aos-firecrawl` | knowledge-docs | page, scrape | | Gemini Image Studio | `aos-nanob` | creative-media | image, prompt, session, model | | GitHub | `aos-github` | developer-tools | repo, issue, pr, branch | | Google Drive | `aos-google-drive` | document-storage | file, folder, share | | Google Places | `aos-google-places` | local-search | search, place, resolve | | Google Workspace | `aos-google` | inbox | gmail, drive, calendar | | HoLaCe | `aos-holace` | legal-practice | case, client, document, deadline | | Hootsuite | `aos-hootsuite` | marketing-publishing | member, organization, social\_profile, team | | HubSpot | `aos-hubspot` | crm-revenue | contact, company, deal, ticket | | Jira | `aos-jira` | project-management | project, issue, board, sprint | | Klaviyo | `aos-klaviyo` | marketing-publishing | account, list, profile, campaign | | Linear | `aos-linear` | project-management | issues, projects, workflow-states | | LION Report | `aos-lion-report` | intelligence-reporting | report, data\_source, analysis, template | | Mailchimp | `aos-mailchimp` | marketing-publishing | account, audience, member, campaign | | Make | `aos-make` | automation-orchestration | organization, team, scenario, connection | | Microsoft 365 | `aos-m365` | productivity-suite | mail, calendar, file, excel | | Microsoft Teams | `aos-teams` | communication | message, channel, chat, meeting | | Monday.com | `aos-monday` | productivity-suite | account, board, workspace, item | | n8n | `aos-n8n` | automation-orchestration | workflow, execution, trigger | | Neon | `aos-neon` | database | sql, branch, project | | Notion | `aos-notion` | productivity-suite | database, page, block, search | | OpenAI | `aos-openai` | ai-ml | chat, embedding, image, audio | | PagerDuty | `aos-pagerduty` | it-operations | incident, service, escalation\_policy, on\_call | | PayPunch | `aos-paypunch` | time-tracking | timesheet, employee, company, pay\_period | | Perplexity | `aos-perplexity` | ai-search | search, chat | | Pinecone | `aos-pinecone` | ai-ml | index, vector, namespace | | Pipedrive | `aos-pipedrive` | crm-revenue | deal, person, organization, activity | | QuickBooks Online | `aos-quickbooks` | finance-backoffice | company, customer, vendor, invoice | | Resend | `aos-resend` | email-delivery | email, domain, audience, contact | | Salesforce | `aos-salesforce` | crm-revenue | lead, contact, opportunity, account | | SendGrid | `aos-sendgrid` | email-delivery | email, contact, list, template | | Shopify | `aos-shopify` | commerce-ops | shop, product, order, customer | | Slack | `aos-slack` | general | message, channel, mention, reaction | | Slack Workflow | `aos-slack-workflow` | communication | message, reaction, channel, thread | | Square | `aos-square` | commerce-ops | payment, customer, order, item | | Stripe | `aos-stripe` | payments | customer, payment, subscription, invoice | | Supabase | `aos-supabase` | database | table, rpc, storage | | Trello | `aos-trello` | project-management | account, member, board, list | | Twilio | `aos-twilio` | communications | sms, call, whatsapp, lookup | | WooCommerce | `aos-woocommerce` | commerce-ops | order, product, customer, coupon | | WordPress | `aos-wordpress` | marketing-publishing | site, post, page, media | | Xero | `aos-xero` | finance-accounting | invoice, contact, payment, account | | Zapier | `aos-zapier` | automation-orchestration | zap, trigger, workspace | ## By Category ### CRM & Revenue `aos-hubspot`, `aos-salesforce`, `aos-pipedrive`, `aos-close`, `aos-clientsync` ### Project Management `aos-linear`, `aos-jira`, `aos-asana`, `aos-clickup`, `aos-monday`, `aos-trello`, `aos-dart`, `aos-notion` ### Communication `aos-slack`, `aos-slack-workflow`, `aos-teams`, `aos-twilio`, `aos-discord-workflow` ### Finance & Accounting `aos-quickbooks`, `aos-xero`, `aos-stripe`, `aos-square`, `aos-paypunch` ### Marketing & Publishing `aos-mailchimp`, `aos-klaviyo`, `aos-buffer`, `aos-hootsuite`, `aos-wordpress`, `aos-sendgrid`, `aos-resend` ### Developer Tools `aos-github`, `aos-coderabbit`, `aos-blacksmith`, `aos-neon`, `aos-supabase`, `aos-pinecone`, `aos-claude-code` ### Commerce `aos-shopify`, `aos-woocommerce`, `aos-square` ### Productivity & Storage `aos-google`, `aos-google-drive`, `aos-m365`, `aos-airtable`, `aos-box`, `aos-dropbox`, `aos-calendly`, `aos-notion`, `aos-monday` ### AI & Media `aos-openai`, `aos-anthropic`, `aos-perplexity`, `aos-elevenlabs`, `aos-canva`, `aos-nanob`, `aos-firecrawl` ### Automation `aos-zapier`, `aos-make`, `aos-n8n` ### IT Operations & MSP `aos-connectwise`, `aos-pagerduty`, `aos-holace`, `aos-lion-report`, `aos-callscrub` ### Databases `aos-neon`, `aos-supabase`, `aos-pinecone` # AEVP Architecture Source: https://docs.argentos.ai/dashboard/aevp-architecture Deep dive into the Agent Expressive Visual Presence system — WebGL particle rendering, emotional color mapping, and ambient presence. ## Overview AEVP (Agent Expressive Visual Presence) is ArgentOS's procedural visual rendering system. It replaces the static Live2D avatar with a dynamic WebGL2 particle system that responds in real-time to Argent's emotional state, activity, speech, and identity. AEVP makes the agent's internal state visible -- mood drives color, arousal drives particle intensity, valence drives breathing rhythm, and activity drives structural form. ```mermaid theme={null} graph LR AS["Agent State
(mood, valence, arousal, activity)"] --> CM["Color Mapping
(Mood Visual Profiles)"] CM --> RS["Render State
(colors, sizes, rates, shapes)"] RS --> P1["Pass 1: Ambient Orb"] RS --> P2["Pass 2: Particles"] RS --> P3["Pass 3: Bloom Post"] EE["Episode Events"] --> AB["AEVP Broadcast"] AB --> WS["Dashboard WebSocket"] ``` ## Normalized Agent State The backend aggregates multiple signal sources into a single normalized state that the renderer consumes: ```typescript theme={null} interface NormalizedAgentState { // Emotional (from SIS — authoritative) valence: number; // -2 to +2 (negative to positive) arousal: number; // 0 to 1 (calm to activated) mood: { state: string; // "happy", "curious", "anxious", etc. energy: "low" | "medium" | "high"; }; uncertainty: number; // 0 to 1 identityResonance: number; // 0 to 1 // Activity activityState: "idle" | "thinking" | "working" | "speaking" | "listening"; currentTool?: string; // Voice currentPhoneme?: string; speechAmplitude: number; isSpeaking: boolean; // Context userPresent: boolean; timeOfDay: "morning" | "afternoon" | "evening" | "night"; } ``` ## Emotional Color Mapping Each mood has a distinct visual profile that maps to 7 rendering dimensions: | Dimension | Range | Description | | ------------ | --------------- | --------------------------------------------------- | | `color` | `[r, g, b]` 0-1 | The mood's signature tint | | `brightness` | 0-1 | Glow intensity (0 = dim, 1 = radiant) | | `size` | 0-1 | Orb expansion (0 = compact, 1 = large) | | `pulseRate` | multiplier | Breathing/pulse speed (1 = normal) | | `edgeSoft` | 0-1 | Edge dissolution (0 = crisp, 1 = cloudy) | | `squash` | -1 to 1 | Shape deformation (-1 = tall, 0 = circle, 1 = wide) | | `wobble` | 0 to 1 | Organic blob movement intensity | ### Mood Visual Profiles (Examples) | Mood | Color | Brightness | Size | Pulse | Edge | Shape | Wobble | | ----------------- | ------------------------------ | ---------- | ---- | ----- | --------- | ----------- | -------- | | **Happy** | Warm gold `[0.95, 0.75, 0.3]` | 0.85 | 0.65 | 1.3x | Crisp | Slight wide | Gentle | | **Excited** | Hot orange `[1.0, 0.55, 0.2]` | 0.95 | 0.80 | 1.8x | Soft | Circle | Active | | **Curious** | Teal-blue | 0.80 | 0.65 | 1.2x | Medium | Slight tall | Moderate | | **Anxious** | Warm amber | 0.70 | 0.55 | 1.6x | Soft | Compressed | High | | **Contemplative** | Deep violet | 0.60 | 0.50 | 0.6x | Very soft | Circle | Minimal | | **Focused** | Cool blue | 0.85 | 0.60 | 0.8x | Crisp | Slight tall | Low | | **Content** | Soft gold `[0.85, 0.75, 0.45]` | 0.70 | 0.55 | 0.7x | Soft | Circle | Gentle | | **Proud** | Lavender `[0.85, 0.6, 0.9]` | 0.80 | 0.70 | 1.0x | Crisp | Slight tall | Minimal | The full system defines visual profiles for 20+ mood states. Transitions between moods are smoothly interpolated using linear interpolation (lerp) to avoid jarring visual jumps. ### Personality Modulation (Phase 5) AEVP supports per-agent visual personality through the `AgentVisualIdentity` system. Personality dimensions modulate the base mood profile: * **Warmth**: Shifts colors toward warmer tones, increases edge softness * **Energy**: Amplifies pulse rate and wobble * **Formality**: Tightens edges, reduces wobble, makes shapes more geometric * **Openness**: Increases size, softens edges, adds more particle spread A reduced motion mode is available for accessibility, which dampens pulse, wobble, and particle count. ## WebGL2 Renderer The renderer uses a 3-pass pipeline: ### Pass 1: Ambient Orb The base visual -- a soft, glowing orb that represents Argent's presence. Driven by mood color, brightness, size, and edge softness. Uses custom GLSL shaders (`ambient.vert`, `ambient.frag`). ### Pass 2: Particle Overlay A particle system overlaid on the orb that adds life and expressiveness: ```typescript theme={null} const FLOATS_PER_PARTICLE = 7; // x, y, vx, vy, life, size, seed const FLOAT_BYTES = 4; const STRIDE = FLOATS_PER_PARTICLE * FLOAT_BYTES; // 28 bytes per particle ``` Particles respond to: * **Arousal**: Higher arousal = more particles, faster movement * **Activity state**: Working = directional particle streams, speaking = speech-synced bursts * **Tool usage**: Different tools trigger different particle formations * **Mood**: Particle color follows the mood profile The `ParticleSystem` class supports formation requests (shape particles into specific patterns) and symbol expression requests (display identity symbols like presence, witnessing, bridging). ### Pass 3: Bloom Post-Process A bloom shader (`bloom.frag`) adds glow effects to bright areas of the scene. The bloom intensity tracks the mood's brightness dimension, creating a halo effect that's prominent during positive/excited states and subtle during calm/contemplative states. ### FBO Architecture The renderer uses two Framebuffer Objects (FBOs) for multi-pass compositing: 1. **Scene FBO**: Captures the combined ambient + particle rendering 2. **Bloom FBO**: Applies the bloom post-process Float FBOs are enabled when supported for higher dynamic range. ### State Transitions The renderer lerps between states over time to create smooth visual transitions: ```typescript theme={null} // Phase 3: lerped state transitions private targetState: AEVPRenderState | null = null; private currentState: AEVPRenderState | null = null; ``` When a new state arrives, it becomes the target. Each frame, the current state is interpolated toward the target, creating fluid transitions between moods. ## WebSocket Events The AEVP system communicates through several WebSocket event types: Fired when the contemplation runner captures a structured episode: ```typescript theme={null} interface EpisodeEvent { type: "episode_captured"; id: string; ts: string; episodeType: string; mood: Mood; valence: number; arousal: number; identityLinks: IdentityLink[]; outcome: { result: string; summary: string }; success: boolean; } ``` Fired when the agent's mood changes: ```typescript theme={null} interface MoodTransitionEvent { type: "mood_transition"; from: { state: string; energy: string }; to: { state: string; energy: string }; valence: number; arousal: number; timestamp: number; } ``` Fired when the agent's activity changes: ```typescript theme={null} interface ActivityEvent { type: "activity_state"; state: "idle" | "thinking" | "working" | "speaking" | "listening"; tool?: string; reason?: string; timestamp: number; } ``` Fired when the agent expresses an identity symbol: ```typescript theme={null} interface SymbolExpressEvent { type: "symbol_express"; symbol: "presence" | "witnessing" | "bridging" | "holding" | "orienting"; durationMs: number; timestamp: number; } ``` ## Tool Activity Colors When the agent uses a tool, the orb shifts color based on the tool category: | Category | Color | Example Tools | | ------------- | ---------------- | ----------------------------- | | Search | Cyan/teal | web\_search, argent\_search | | Code | Green | terminal, edit\_line\_range | | Communication | Warm gold | message, discord | | Media | Magenta/pink | image\_generation, tts | | Memory | Deep blue/indigo | memory\_recall, memory\_store | | System | Orange/amber | gateway, argent\_config | ## Identity Presets Five configurable visual styles, selectable from the dashboard ConfigPanel: | Preset | Colors | Character | | ------------- | ------------------------ | --------------------------- | | **Minimal** | Silver/monochrome | Clean, quiet, understated | | **Warm** | Amber/gold/coral | Friendly, approachable | | **Corporate** | Steel blue/slate | Professional, precise | | **Artistic** | Purple/magenta/teal | Expressive, vivid (default) | | **Technical** | Cyan/green/electric blue | Sharp, responsive | ## Gestures The agent can perform expressive gestures via the `visual_presence` tool. Gestures are momentary overlays (200-10,000ms) that decay back to the emotional baseline: | Gesture | Effect | | ----------- | ------------------------------- | | `brighten` | Glow up, expand, lighten colors | | `dim` | Fade, contract, fewer particles | | `warm_up` | Shift color temperature warmer | | `cool_down` | Shift color temperature cooler | | `expand` | Grow larger, increase glow | | `contract` | Shrink, slow particles | | `pulse` | Energy burst + wobble | | `still` | Stop all motion | | `soften` | Dissolve edges | | `sharpen` | Crisp edges | The agent also has the ability to request persistent identity changes (switching presets). ## Tool Categories AEVP classifies tools into visual categories that affect particle behavior: ```typescript theme={null} import { classifyTool, getResonanceTargets } from "./toolCategories"; ``` When the agent uses a tool, the particle system responds with tool-appropriate visual effects. For example, memory recall might trigger an inward spiral, while web search triggers an outward expansion. ## Speech Analysis The `speechAnalyser.ts` module provides real-time speech metrics that drive AEVP: * **Amplitude**: Drives particle burst intensity during speech * **Phoneme detection**: Could drive future lip-sync or phoneme-specific particle patterns ## Speech Reactivity When TTS is playing, the orb responds to audio amplitude: * **Squash/stretch** deformation proportional to amplitude * **Increased wobble** creating the impression of speaking through light * A speech analyser bridges the ElevenLabs TTS audio to the render state ## Dashboard Climate The orb's mood radiates into the surrounding dashboard UI through CSS custom properties: * `--climate-temp` -- Color temperature (warm/cool) * `--climate-intensity` -- Strength of influence * `--climate-hue` -- Dominant hue from mood Panels near the orb show resonance glow effects when the agent is working on related content. ## Tonal Presence (Accessibility) An opt-in audio layer using Web Audio API -- extremely quiet, designed as non-visual presence: | Feature | Description | | ------------------- | ----------------------------------------------- | | **Ambient tone** | Sine wave at mood-mapped frequency (190-370 Hz) | | **Breathing audio** | Volume modulated at breathing rate | | **State chimes** | Brief micro-sounds on mood changes (50-300ms) | | **Pre-speech cue** | Rising tone before TTS starts speaking | Enable via **ConfigPanel > Accessibility > Tonal Presence**. ### Reduced Motion When enabled (manual toggle or `prefers-reduced-motion` media query): * Particles disabled * Pulse and wobble zeroed * Breathing rate capped * Transitions slowed ## Implementation Status | Phase | Description | Status | | ----------- | ------------------------------------------------------------------------- | ----------- | | **Phase 1** | State Aggregator -- normalize agent state into renderable format | Complete | | **Phase 2** | Ambient Mode -- WebGL2 renderer, particle system, mood color mapping | Complete | | **Phase 3** | Environmental Inhabitation -- lerped transitions, context-aware rendering | Complete | | **Phase 4** | Gesture System -- tool-reactive particle formations, symbol expressions | In Progress | | **Phase 5** | Personality Modulation -- per-agent visual identity, accessibility | Complete | ## Dashboard Integration AEVP renders in the main dashboard view, replacing the previous Live2D avatar. The dashboard `climate` system translates emotional state updates into CSS custom properties that coordinate the AEVP canvas with surrounding UI elements (background gradients, accent colors, etc.). The renderer includes: * **WebGL2 context loss recovery**: Handles GPU context loss gracefully * **Resize handling**: Adapts to container size changes * **Performance monitoring**: Frame time tracking for optimization ## Performance * \< 5% CPU in ambient mode * 60fps rendering via `requestAnimationFrame` * WebGL2 fragment shader handles all heavy lifting on GPU * State updates batched through React scheduling * Tonal presence uses minimal Web Audio resources (3 oscillators max) ## Configuration | Setting | Location | Description | | ------------------- | ----------------------------- | --------------------------------------------- | | Identity preset | ConfigPanel > Visual Identity | Switch between 5 visual styles | | Personality sliders | ConfigPanel > Visual Identity | Fine-tune warmth, energy, formality, openness | | Tonal presence | ConfigPanel > Accessibility | Enable/disable audio presence features | | Reduced motion | ConfigPanel > Accessibility | Disable animations for accessibility | | Volume | ConfigPanel > Accessibility | Tonal presence volume (very quiet range) | Identity and accessibility settings persist to `localStorage`. ## Key Files | File | Description | | --------------------------------------- | ------------------------------------------------ | | `src/infra/aevp-types.ts` | Backend state types and WebSocket event payloads | | `dashboard/src/aevp/renderer.ts` | WebGL2 3-pass renderer engine | | `dashboard/src/aevp/colorMapping.ts` | Mood-to-visual-profile mapping | | `dashboard/src/aevp/particles.ts` | Particle system with formations | | `dashboard/src/aevp/types.ts` | Frontend render state types | | `dashboard/src/aevp/identityPresets.ts` | Per-agent visual identity configs | | `dashboard/src/aevp/environment.ts` | Environmental context rendering | | `dashboard/src/aevp/speechAnalyser.ts` | Speech-driven visual effects | | `dashboard/src/aevp/tonalPresence.ts` | Ambient tonal feedback | | `dashboard/src/aevp/toolCategories.ts` | Tool classification for particle effects | | `dashboard/src/aevp/shaders/` | GLSL vertex and fragment shaders | # Dashboard Features Source: https://docs.argentos.ai/dashboard/features Chat interface, task management, session history, model badges, and more. ## Chat Interface The main chat panel provides a real-time conversation with your agent: * **Streaming responses**: See the agent's response as it is generated, token by token * **Tool use visibility**: Tool calls are displayed inline so you can see what the agent is doing * **File attachments**: Drag and drop files to send to the agent * **Markdown rendering**: Responses are rendered with full Markdown support (code blocks, tables, lists) ## Model Badges Each message displays a colored badge indicating which model tier processed it: | Color | Tier | Model | | ------ | -------- | ------------------ | | Green | LOCAL | Local model (free) | | Yellow | FAST | Claude Haiku | | Blue | BALANCED | Claude Sonnet | | Purple | POWERFUL | Claude Opus | This gives you visibility into how the model router is working and what each interaction costs. ## Task Management The dashboard includes a full task management interface: * **Task list**: View all tasks with status, priority, and assignee * **Create tasks**: Add new tasks directly from the UI * **Play/Complete flow**: Click play to start a task, the agent works on it, click complete when done * **Progress tracking**: Real-time updates as the agent works on tasks See [Tasks UI](/dashboard/tasks-ui) for the full task management workflow. ## Session History View and manage all conversation sessions: * **Session list**: All active and past sessions * **Context usage**: See how much of the context window is used * **Switch sessions**: Click to switch the chat to a different session * **Clear context**: Reset a session's context window ## Document Panel The slide-out document panel (`doc_panel` tool) displays reports, documents, and structured content alongside the chat: * Opens as a side panel without leaving the chat * Supports Markdown rendering * Can be used for code reviews, reports, and documentation ## Settings ### Audio Settings Configure text-to-speech voice and behavior. See [TTS](/dashboard/tts). ### Display Settings * Theme (light/dark) * Font size * Message density ## Keyboard Shortcuts | Shortcut | Action | | ------------- | ------------------ | | `Enter` | Send message | | `Shift+Enter` | New line | | `Ctrl+L` | Clear chat display | | `Ctrl+K` | Command palette | # Dashboard Overview Source: https://docs.argentos.ai/dashboard/index The ArgentOS web dashboard — a React UI for chatting, managing tasks, and monitoring your agent. ## Overview The ArgentOS dashboard is a React web application that provides a visual interface for interacting with your agent. It connects to the gateway via WebSocket and provides real-time chat, task management, session history, and system monitoring. ## Launching the Dashboard ```bash theme={null} argent dashboard ``` This opens the dashboard in your default browser at `http://localhost:3141`. The dashboard can also be accessed remotely if the gateway is configured for external access. See [Remote Access](/gateway/remote-access). ## Architecture ```mermaid theme={null} graph TD Browser["Browser (React App)"] GW["Gateway (port 18789)"] API["Dashboard API Server (port 3141)"] Agent["Agent Runtime"] DB["dashboard.db (SQLite)"] Browser -->|WebSocket| GW GW --> Agent Browser -->|HTTP API| API API --> DB ``` The dashboard communicates over two channels: * **WebSocket**: Real-time chat messages, streaming responses, and live status updates * **HTTP API**: Task management, session history, and configuration ## Dashboard Database The dashboard maintains its own SQLite database for task data and UI state: ``` ~/.argentos/data/dashboard.db ``` This database is shared between the dashboard API server and the agent's task tools, ensuring both sides see the same task state. ## Requirements * A modern web browser (Chrome, Firefox, Safari, Edge) * Gateway running (`argent gateway start`) * Node.js for the API server ## Configuration Dashboard settings are in `argent.json`: ```json theme={null} { "dashboard": { "port": 3141, "host": "localhost" } } ``` ## Key Pages Primary interface for conversing with your agent Task management with create, track, and complete flows View and switch between conversation sessions Audio, model, and display preferences # Task Management UI Source: https://docs.argentos.ai/dashboard/tasks-ui Creating tasks, tracking progress, and the play/complete workflow in the dashboard. ## Overview The dashboard's task management interface gives you a visual way to create, track, and manage tasks that your agent works on. Tasks are stored in a shared SQLite database (`~/.argentos/data/dashboard.db`) that both the dashboard and the agent's tools access. ## Task List View The task list shows all tasks with: * **Title**: What the task is about * **Status**: pending, in\_progress, completed, failed, blocked * **Priority**: urgent, high, normal, low, background * **Source**: Who created it (user, agent, heartbeat, schedule) * **Created/Updated**: Timestamps ## Creating Tasks Click the **+ New Task** button and fill in: * Title (required) * Description (optional) * Priority (defaults to normal) Tell the agent to create a task: ``` Create a task to review the Q4 security audit ``` The agent uses the `tasks_add` tool and the task appears in the dashboard immediately. ``` /task Review the Q4 security audit ``` ## The Play/Complete Flow This is the core task workflow: Click the **play button** on a task. This: * Calls `POST /api/tasks/:id/start` to update the status * Sends a chat message to the gateway telling the agent to work on this task * The task status changes to `in_progress` The agent receives the message and begins working. It may: * Use tools (exec, browser, memory) to complete the task * Stream progress updates back through the chat * Call `tasks_complete` when finished When the agent finishes, it: * Calls the `tasks` tool with `action: complete` * Emits a `[TASK_DONE:title]` marker in the response stream The dashboard detects the marker for instant UI updates and also polls the database every 5 seconds as a backup. ## Task Status Flow ```mermaid theme={null} graph LR P[pending] --> IP[in_progress] IP --> C[completed] IP --> F[failed] IP --> B[blocked] B --> IP2[in_progress] IP2 --> C2[completed] ``` | Status | Description | | ------------- | ------------------------------------- | | `pending` | Created but not started | | `in_progress` | Agent is actively working on it | | `completed` | Task finished successfully | | `failed` | Task could not be completed | | `blocked` | Task is waiting on something external | ## Real-Time Updates The dashboard updates task status through two mechanisms: 1. **Stream markers**: `[TASK_DONE:title]` parsed from the agent's response stream for instant feedback 2. **Database polling**: Every 5 seconds, the dashboard polls the database to catch any changes made directly by the agent This dual approach ensures the UI stays current even if a marker is missed. # Text-to-Speech Source: https://docs.argentos.ai/dashboard/tts ElevenLabs integration, voice selection, and TTS markers in ArgentOS. ## Overview ArgentOS supports text-to-speech (TTS) through ElevenLabs integration, allowing your agent to speak responses aloud through the dashboard. The dashboard handles voice synthesis using the user's selected voice. ## TTS Priority System The dashboard processes speech in this priority order: `[TTS:text]` markers -- the agent explicitly marks text to be spoken Long responses are automatically summarized and spoken Brief responses are spoken directly Agent-generated audio files (may use a different voice) The dashboard TTS always uses the voice selected in **Audio Settings**, ensuring a consistent voice experience regardless of how the speech was triggered. ## TTS Markers The agent can explicitly control what gets spoken using markers in its response: ``` Here's the full analysis of your server logs... [TTS:Your server logs show three critical errors in the last hour. I've documented the details below.] ``` The text inside `[TTS:...]` is spoken aloud. The rest of the response is displayed visually but not spoken. This lets the agent provide detailed written content while speaking a concise summary. ## Voice Selection ### ElevenLabs Voices Configure your preferred voice in the dashboard's Audio Settings: ### Configuration ```json theme={null} { "dashboard": { "tts": { "provider": "elevenlabs", "voice": "jessica", "rate": 1.0, "volume": 0.8, "autoSpeak": true } } } ``` ## Agent-Generated Audio The agent's `sag` (Speech Audio Generation) tool can generate audio files directly. However, these may use a different voice than the dashboard's selected voice. The dashboard's own TTS takes priority over agent-generated audio files for consistency. ## Disabling TTS Set `autoSpeak: false` in settings to disable automatic speech. The agent can still generate `[TTS:]` markers, but they will be ignored unless you manually trigger playback. ## Requirements * An ElevenLabs API key (configured in dashboard settings) * Browser with Web Audio API support * Speakers or headphones # API Reference Source: https://docs.argentos.ai/gateway/api-reference WebSocket RPC protocol reference for ArgentOS gateway — connection, authentication, and all available methods. ## Overview The ArgentOS gateway exposes a WebSocket-based RPC interface on port 18789 (configurable). All dashboard interactions, CLI commands, and external integrations communicate through this protocol. The protocol uses JSON-RPC style messages: each request has a `method` and `params`, each response returns a `result` or `error`. ## Connection ### WebSocket URL ```text Local theme={null} ws://localhost:18789 ``` ```text Remote theme={null} wss://your-domain.com:18789 ``` ### Authentication After connecting, the client must authenticate with a challenge-response: Server sends `connect.challenge` event with a nonce Client responds with the gateway token (from `~/.argentos/argent.json` or `ARGENT_GATEWAY_TOKEN`) Server validates and grants access The gateway token is auto-generated on first run. It can be found in `argent.json` under `gateway.token` or retrieved via `argent gateway status`. ### Client Registration On successful auth, the client registers with: ```json theme={null} { "method": "connect", "params": { "clientName": "dashboard", "clientDisplayName": "ArgentOS Dashboard", "mode": "operator" } } ``` Client modes: * `operator` -- Full access (dashboard, CLI) * `node` -- Limited access (compute nodes) * `device` -- Device access (paired devices) ## Request Format ```json theme={null} { "id": "req-1", "method": "method.name", "params": { } } ``` ## Response Format ```json Success theme={null} { "id": "req-1", "result": { } } ``` ```json Error theme={null} { "id": "req-1", "error": { "code": -32600, "message": "Invalid request", "data": { } } } ``` ## Server-Sent Events The gateway pushes events to connected clients: | Event | Description | | ------------------------- | ------------------------------------------------------- | | `connect.challenge` | Authentication challenge | | `agent` | Agent streaming output (tokens, tool calls, completion) | | `chat` | Chat message updates | | `presence` | Agent presence changes | | `tick` | Periodic tick (dashboard heartbeat) | | `talk.mode` | Voice mode changes | | `health` | Health status updates | | `heartbeat` | Heartbeat cycle results | | `cron` | Cron job events | | `shutdown` | Gateway shutting down | | `exec.approval.requested` | Command approval needed | | `exec.approval.resolved` | Command approval resolved | | `terminal` | Terminal output | | `node.pair.requested` | Node pairing request | | `device.pair.requested` | Device pairing request | ## Chat Methods ### chat.send Send a message to the agent and receive a streaming response. ```json theme={null} { "method": "chat.send", "params": { "message": "What tasks are pending?", "sessionKey": "main", "model": "anthropic/claude-sonnet-4-20250514", "thinking": "medium", "images": [] } } ``` Response streams via `agent` events with token deltas. ### chat.history Retrieve chat history for a session. ```json theme={null} { "method": "chat.history", "params": { "sessionKey": "main", "limit": 50 } } ``` ### chat.abort Stop a running agent turn. ```json theme={null} { "method": "chat.abort", "params": { "sessionKey": "main" } } ``` ## Agent Methods ### agent Send a command to the agent (general purpose). ```json theme={null} { "method": "agent", "params": { "message": "Run the daily report", "sessionKey": "main" } } ``` ### agent.wait Wait for a running agent turn to complete. ```json theme={null} { "method": "agent.wait", "params": { "sessionKey": "main", "timeoutMs": 30000 } } ``` ### agent.identity.get Get the agent's identity information. ```json theme={null} { "method": "agent.identity.get", "params": {} } ``` ## Configuration Methods ### config.get Get the current configuration. ```json theme={null} { "method": "config.get", "params": {} } ``` ### config.set Set a configuration value. ```json theme={null} { "method": "config.set", "params": { "path": "agents.defaults.thinkingDefault", "value": "medium" } } ``` ### config.patch Apply multiple configuration changes atomically. ```json theme={null} { "method": "config.patch", "params": { "patches": [ { "path": "agents.defaults.heartbeat.every", "value": "45m" }, { "path": "agents.defaults.contemplation.enabled", "value": true } ] } } ``` ### config.schema Get the full configuration schema. ```json theme={null} { "method": "config.schema", "params": {} } ``` ## Session Methods ### sessions.list List all agent sessions. ```json theme={null} { "method": "sessions.list", "params": {} } ``` ### sessions.preview Preview a session's content. ```json theme={null} { "method": "sessions.preview", "params": { "sessionKey": "main" } } ``` ### sessions.reset Reset a session (clear history). ```json theme={null} { "method": "sessions.reset", "params": { "sessionKey": "main" } } ``` ### sessions.compact Compact a session (summarize and truncate old messages). ```json theme={null} { "method": "sessions.compact", "params": { "sessionKey": "main" } } ``` ## Cron Methods ### cron.list List all cron jobs. ```json theme={null} { "method": "cron.list", "params": { "includeDisabled": false } } ``` ### cron.add Create a new cron job. ```json theme={null} { "method": "cron.add", "params": { "name": "Morning Briefing", "schedule": { "kind": "at", "at": "06:00" }, "sessionTarget": "isolated", "wakeMode": "now", "payload": { "kind": "agentTurn", "message": "Generate the daily briefing" } } } ``` ### cron.update Update an existing cron job. ```json theme={null} { "method": "cron.update", "params": { "id": "job-uuid", "enabled": false } } ``` ### cron.run Force-run a cron job. ```json theme={null} { "method": "cron.run", "params": { "id": "job-uuid", "mode": "force" } } ``` ### cron.remove Delete a cron job. ```json theme={null} { "method": "cron.remove", "params": { "id": "job-uuid" } } ``` ## Model Methods ### models.list List available models and providers. ```json theme={null} { "method": "models.list", "params": {} } ``` Returns provider registry entries with model capabilities, pricing, and availability status. ## Knowledge Methods ### knowledge.search Search the knowledge library. ```json theme={null} { "method": "knowledge.search", "params": { "query": "deployment procedures", "collection": "corporate", "limit": 10 } } ``` ### knowledge.ingest Ingest a document into the knowledge library. ```json theme={null} { "method": "knowledge.ingest", "params": { "collection": "corporate", "filename": "handbook.pdf", "content": "base64-encoded-content" } } ``` ### knowledge.library.list List documents in the knowledge library. ```json theme={null} { "method": "knowledge.library.list", "params": { "collection": "corporate" } } ``` ### knowledge.collections.list List all knowledge collections. ```json theme={null} { "method": "knowledge.collections.list", "params": {} } ``` ## Execution Worker Methods ### execution.worker.status Get execution worker status and metrics. ```json theme={null} { "method": "execution.worker.status", "params": {} } ``` ### execution.worker.runNow Trigger an immediate execution worker cycle. ```json theme={null} { "method": "execution.worker.runNow", "params": {} } ``` ### execution.worker.pause / resume Pause or resume the execution worker. ```json theme={null} { "method": "execution.worker.pause", "params": {} } ``` ## Channel Methods ### channels.status Get status of all configured channels. ```json theme={null} { "method": "channels.status", "params": {} } ``` ### send Send an outbound message through a channel. ```json theme={null} { "method": "send", "params": { "channel": "telegram", "action": "send", "to": "user:123456", "message": "Hello from ArgentOS" } } ``` ## Health & Status Methods ### health Get gateway health status. ```json theme={null} { "method": "health", "params": {} } ``` ### status Get comprehensive system status. ```json theme={null} { "method": "status", "params": {} } ``` ### system-presence Get current agent presence state. ```json theme={null} { "method": "system-presence", "params": {} } ``` ## TTS Methods ### tts.status Get TTS provider status. ```json theme={null} { "method": "tts.status", "params": {} } ``` ### tts.convert Convert text to speech. ```json theme={null} { "method": "tts.convert", "params": { "text": "Hello, this is a test.", "voice": "Jessica" } } ``` ## Agents Methods ### agents.list List all configured agents. ```json theme={null} { "method": "agents.list", "params": {} } ``` ### agents.files.list / get / set Manage agent alignment documents. ```json theme={null} { "method": "agents.files.get", "params": { "agentId": "main", "filename": "SOUL.md" } } ``` ## Error Codes | Code | Name | Description | | -------- | ----------------- | -------------------------------- | | `-32600` | Invalid Request | Malformed request | | `-32601` | Method Not Found | Unknown method name | | `-32602` | Invalid Params | Parameter validation failed | | `-32603` | Internal Error | Server-side error | | `-32000` | Agent Busy | Agent is already processing | | `-32001` | Session Not Found | Requested session does not exist | | `-32002` | Auth Failed | Authentication failure | ## Scopes Methods are grouped into access scopes: | Scope | Description | Example Methods | | -------------------- | --------------------- | ----------------------------- | | `operator.read` | Read-only access | health, status, models.list | | `operator.write` | Read-write access | config.set, cron.add, send | | `operator.admin` | Administrative access | exec.approvals.set | | `operator.approvals` | Approval flow | exec.approval.request/resolve | | `operator.pairing` | Device pairing | node.pair.*, device.pair.* | ## Key Files | File | Description | | ------------------------------------ | --------------------------------- | | `src/gateway/server-methods.ts` | Method handler registration | | `src/gateway/server-methods-list.ts` | Method and event catalog | | `src/gateway/server-methods/` | Individual method handler modules | | `src/gateway/protocol/` | Protocol schemas and validation | | `src/gateway/server.impl.ts` | WebSocket server implementation | # Backup & Restore (Phoenix) Source: https://docs.argentos.ai/gateway/backup Phoenix backup system for ArgentOS workspace data — local, Git, S3, and Cloudflare R2 targets with compression, encryption, and retention policies. ## Overview Phoenix is the ArgentOS backup and restore system. It protects your agent's workspace data -- memory files, identity documents, configuration, databases, and alignment docs -- by creating versioned snapshots and distributing them across multiple storage targets. Phoenix supports four backup targets: local filesystem, Git repositories, Amazon S3, and Cloudflare R2. Backups can be compressed, encrypted, and managed with retention policies that automatically prune old snapshots. ## Why Phoenix Exists Your agent's workspace contains irreplaceable data: * **SOUL.md, IDENTITY.md, USER.md** -- Agent personality and identity * **MEMORY.md** and `memory/` -- Durable knowledge and daily notes * **observations.db** -- MemU memory database with thousands of observations * **memory.db** -- Full memory store with embeddings and entity tracking * **Configuration** -- All `argent.json` settings and channel configs Losing this data means losing the agent's accumulated knowledge, personality, and relationship context. Phoenix ensures you can always recover. ## CLI Commands ### Create a Backup ```bash theme={null} argent backup create ``` | Flag | Description | | ------------------ | ----------------------------------------------------- | | `--dry-run` | Preview what would be backed up without executing | | `--verbose` | Show detailed output during backup | | `--memory-only` | Only backup memory files (MEMORY.md, observations.db) | | `--databases-only` | Only backup SQLite databases | | `--config ` | Use a custom config file | ### List Backups ```bash theme={null} argent backup list ``` Shows all available backups with timestamps, sizes, and compression status. ### Restore from Backup ```bash theme={null} argent backup restore argent backup restore --latest argent backup restore --backup 2026-03-15-14-30 ``` | Flag | Description | | ---------------------- | -------------------------------------------------------- | | `--latest` | Restore from the most recent backup | | `--backup ` | Restore from a specific backup | | `--memory-only` | Only restore memory files | | `--databases-only` | Only restore databases | | `--identity-only` | Only restore identity files (SOUL.md, IDENTITY.md, etc.) | | `--dry-run` | Preview what would be restored | ### Initialize Configuration ```bash theme={null} argent backup init ``` Creates an example configuration file at `~/.argentos/backup.json` with sensible defaults. ## Configuration Phoenix is configured via `~/.argentos/backup.json` (also searched at `~/.argentos/phoenix.json` and `~/.config/argentos/backup.json`): ```json theme={null} { "workspace": "~/argent", "backupDir": "~/backups/argent", "targets": { "local": { "enabled": true, "path": "~/backups/argent" }, "git": { "enabled": false, "repo": "git@github.com:youruser/agent-backup.git", "branch": "main", "autoCommit": true }, "s3": { "enabled": false, "bucket": "my-agent-backups", "prefix": "argent/", "storageClass": "STANDARD_IA" }, "r2": { "enabled": false, "accountId": "YOUR_CLOUDFLARE_ACCOUNT_ID", "bucket": "agent-backups", "prefix": "argent/" } }, "include": [ "MEMORY.md", "SOUL.md", "USER.md", "AGENTS.md", "IDENTITY.md", "memory/*.md", "scripts/", "config/", "~/.argentos/observations.db" ], "exclude": [ "*.log", "node_modules/", ".git/", "*.tmp", ".DS_Store" ], "compression": true, "retention": { "daily": 7, "weekly": 4, "monthly": 12 }, "notifications": { "enabled": false, "onSuccess": "silent", "onFailure": "alert" }, "encryption": { "enabled": false, "method": "gpg" } } ``` ### Configuration Fields | Field | Type | Description | | --------------- | ---------- | ------------------------------------------ | | `workspace` | `string` | Root directory of the workspace to back up | | `backupDir` | `string` | Directory to store backup snapshots | | `targets` | `object` | Backup target configurations (see below) | | `include` | `string[]` | Glob patterns for files to include | | `exclude` | `string[]` | Glob patterns for files to exclude | | `compression` | `boolean` | Enable gzip compression (default: `true`) | | `retention` | `object` | Retention policy for automatic pruning | | `notifications` | `object` | Notification settings for success/failure | | `encryption` | `object` | Encryption settings (GPG or age) | ## Storage Targets The simplest target. Copies backup snapshots to a local directory. ```json theme={null} { "local": { "enabled": true, "path": "~/backups/argent" } } ``` Commits backups to a Git repository with optional auto-push. ```json theme={null} { "git": { "enabled": true, "repo": "git@github.com:youruser/agent-backup.git", "branch": "main", "autoCommit": true } } ``` Git backup creates a commit for each snapshot. With `autoCommit: true`, it also pushes to the remote after each commit. This provides version history and off-site backup in one step. Uploads backup snapshots to an S3 bucket. Requires AWS CLI configured with appropriate credentials. ```json theme={null} { "s3": { "enabled": true, "bucket": "my-agent-backups", "prefix": "argent/", "storageClass": "STANDARD_IA" } } ``` Supported storage classes: * `STANDARD` -- Frequent access * `STANDARD_IA` -- Infrequent access (lower cost, retrieval fees) * `GLACIER` -- Archive storage (minutes to hours retrieval) * `DEEP_ARCHIVE` -- Long-term archive (12+ hours retrieval) Uploads to Cloudflare R2 object storage. R2 has no egress fees, making it ideal for backups that may need frequent restores. ```json theme={null} { "r2": { "enabled": true, "accountId": "YOUR_CLOUDFLARE_ACCOUNT_ID", "bucket": "agent-backups", "prefix": "argent/", "accessKeyId": "optional-if-using-wrangler", "secretAccessKey": "optional-if-using-wrangler" } } ``` ## Retention Policies Retention policies automatically prune old backups to manage storage: ```json theme={null} { "retention": { "daily": 7, "weekly": 4, "monthly": 12 } } ``` | Policy | Description | Default | | --------- | --------------------------------- | ------- | | `daily` | Number of daily backups to keep | 7 | | `weekly` | Number of weekly backups to keep | 4 | | `monthly` | Number of monthly backups to keep | 12 | Set any value to `-1` for unlimited retention. ## Database Backup SQLite databases are backed up using the SQLite `.backup` command, which creates a consistent snapshot even while the database is in use. This is safer than simple file copy, which can capture a database in an inconsistent state. Databases backed up include: * `~/.argentos/observations.db` -- MemU memory store * `~/.argentos/memory.db` -- Legacy memory database * `~/.argentos/data/dashboard.db` -- Dashboard task database ## Compression When `compression: true` (the default), backup snapshots are compressed with gzip. This typically reduces backup size by 60-80% for text-heavy workspace content. The system checks for `gzip` availability on the host before attempting compression. ## Encryption Phoenix supports optional encryption for backup snapshots: ```json theme={null} { "encryption": { "enabled": true, "method": "gpg", "keyId": "your-gpg-key-id" } } ``` Supported methods: * `gpg` -- GnuPG encryption with a specified key ID * `age` -- Modern encryption with age ([https://age-encryption.org](https://age-encryption.org)) ## Restore Process Select a backup by timestamp (or use `--latest`) Verify the backup integrity (checksums, decompression) Stop the gateway if running (to prevent database conflicts) Copy files from the backup to the workspace Restore databases using SQLite `.restore` Restart the gateway Partial restores are supported via `--memory-only`, `--databases-only`, and `--identity-only` flags. This lets you restore specific components without overwriting everything. ## Workspace Zip Backup In addition to Phoenix, the alignment docs system creates workspace zip backups independently. These are created through the dashboard and stored locally. Phoenix and workspace zip backups are complementary -- Phoenix handles scheduled, multi-target backups while workspace zip is for ad-hoc dashboard-initiated snapshots. ## Backup State Phoenix tracks backup state in `~/.argentos/backup/.last-backup`: ```typescript theme={null} interface BackupState { timestamp: number; // Unix timestamp date: string; // ISO date string backupPath: string; // Path to the backup compression: boolean; // Whether compression was used success: boolean; // Whether the backup succeeded } ``` This state file is used to report the last backup status and determine when the next backup should run. ## Key Files | File | Description | | ------------------------- | ------------------------------------------ | | `src/backup/runner.ts` | Core backup and restore operations | | `src/backup/types.ts` | Type definitions for config and operations | | `src/backup/config.ts` | Configuration loading and validation | | `src/backup/index.ts` | Module exports | | `~/.argentos/backup.json` | Backup configuration file | | `~/.argentos/backup/` | Backup state directory | # Gateway Configuration Source: https://docs.argentos.ai/gateway/configuration Configure the gateway port, host, authentication, and service options. ## Overview The gateway is configured through `argent.json`, the main configuration file located at `~/.argentos/argent.json`. ## Configuration File ```json theme={null} { "gateway": { "port": 18789, "host": "0.0.0.0", "auth": { "enabled": true, "token": "your-gateway-auth-token" } } } ``` ## Core Settings ### Port The WebSocket port the gateway listens on: ```json theme={null} { "gateway": { "port": 18789 } } ``` Change this if port 18789 conflicts with another service. ### Host The interface to bind to: * `"localhost"` -- Only accept local connections (default for security) * `"0.0.0.0"` -- Accept connections from any interface (needed for remote access) ### Authentication Gateway auth prevents unauthorized access to the WebSocket API: ```json theme={null} { "gateway": { "auth": { "enabled": true, "token": "a-long-random-string" } } } ``` When enabled, clients must include the token in the WebSocket connection handshake. Without authentication, anyone with network access to the gateway port can control your agent. ## State Directory The gateway stores its state in: ``` ~/.argentos/ argent.json # Main configuration memory.db # MemU database data/ dashboard.db # Dashboard/tasks database agents/ main/ sessions/ # Session data agent/ auth-profiles.json # Auth profiles ``` ## LaunchAgent Configuration (macOS) The `argent gateway install` command generates a plist at: ``` ~/Library/LaunchAgents/ai.argent.gateway.plist ``` The plist uses whatever `node` binary is first in PATH at install time. If Homebrew's node comes first, the gateway will use it instead of nvm's node, causing native module ABI mismatches. Verify the node path in the plist matches your nvm installation. To fix the node path: Edit `~/Library/LaunchAgents/ai.argent.gateway.plist` Update to your nvm node (e.g., `/Users/you/.nvm/versions/node/v22.22.0/bin/node`) ```bash theme={null} launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist ``` ## Environment Variables | Variable | Description | | ------------------- | ------------------------------------------------- | | `ANTHROPIC_API_KEY` | Fallback API key (auth profiles take precedence) | | `ARGENT_HOME` | Override state directory (default: `~/.argentos`) | | `ARGENT_LOG_LEVEL` | Logging level: debug, info, warn, error | # Health Checks Source: https://docs.argentos.ai/gateway/health Gateway health monitoring and zombie process reaping. ## Overview The gateway runs periodic health checks to ensure the system is operating correctly. This includes monitoring service health, connection status, and cleaning up orphaned processes that can accumulate during normal operation. ## Health Check Timer The health check runs every **60 seconds** and performs: 1. Channel connection status checks 2. Memory database accessibility 3. Zombie process reaping 4. Disk space monitoring (optional) ## Zombie Process Reaper During normal operation, the gateway spawns `claude --stream-json` subprocesses for agent interactions. If these processes crash or timeout without cleanup, they become zombies that consume system resources. The reaper: 1. Scans for `claude` processes with the `stream-json` flag 2. Checks their age using POSIX `etime` format 3. Kills any that are older than **5 minutes** ```bash theme={null} # What the reaper does internally (macOS-compatible) ps -eo pid,etime,command | grep "stream-json" ``` The reaper specifically greps for `"stream-json"` only. It must NEVER grep broadly for `"claude"` as that would kill active Claude Code sessions running on the same machine. ### etime Parsing The reaper uses the POSIX `etime` format (`[[dd-]hh:]mm:ss`) which works on macOS. It does **not** use `etimes` (seconds format) which is Linux-only. ## Checking Health ```bash theme={null} argent gateway status ``` Output includes: * Gateway process status (running/stopped) * RPC probe result (ok/failed) * Listening port * Uptime * Connected channels The dashboard header shows a connection indicator: * **Green**: Connected and healthy * **Yellow**: Connected with warnings * **Red**: Disconnected or unhealthy ## Common Health Issues The gateway is running but not responding to RPC calls: * Check the gateway logs: `argent gateway logs` * Verify the port is not blocked by a firewall * Check for native module ABI mismatches (see [Configuration](/gateway/configuration)) If you see many zombie processes accumulating: * The reaper should handle these automatically * If they persist, check if the 5-minute timeout is appropriate for your workload * Manual cleanup: `argent gateway restart` If the health check reports a locked database: * Check for other processes accessing `~/.argentos/memory.db` * The WAL (Write-Ahead Logging) mode should prevent most lock issues * Restart the gateway if the lock persists # Heartbeat System Source: https://docs.argentos.ai/gateway/heartbeat Periodic agent wake-ups for autonomous task work and proactive check-ins. ## Overview The heartbeat system periodically wakes the agent even when no user messages are coming in. This enables autonomous behaviors like: * Working through the task queue * Checking for scheduled actions * Proactive status updates * Background maintenance ## How It Works The gateway fires a heartbeat at configured intervals The agent receives a special heartbeat message The agent checks for pending tasks, schedules, and conditions If there is work to do, the agent processes it. If not, the agent returns to idle. ## Configuration ```json theme={null} { "gateway": { "heartbeat": { "enabled": true, "interval": 300000, "taskCheck": true, "quietHours": { "start": "22:00", "end": "07:00", "timezone": "America/Chicago" } } } } ``` ### Settings | Setting | Default | Description | | ------------ | -------- | -------------------------------------- | | `enabled` | `true` | Enable/disable heartbeat | | `interval` | `300000` | Interval in milliseconds (5 minutes) | | `taskCheck` | `true` | Check task queue on each heartbeat | | `quietHours` | -- | Suppress heartbeats during these hours | ## Quiet Hours During quiet hours, the heartbeat is suppressed to avoid unnecessary API calls and potential notifications during off-hours: ```json theme={null} { "quietHours": { "start": "22:00", "end": "07:00", "timezone": "America/Chicago" } } ``` Urgent tasks can override quiet hours. ## Task Queue Integration When `taskCheck` is enabled, each heartbeat: 1. Queries pending tasks ordered by priority 2. Picks the highest-priority task 3. Starts the task (status -> `in_progress`) 4. Works on it using available tools 5. Completes or blocks the task This means high-priority tasks get worked on automatically without user intervention. ## Cost Considerations Each heartbeat that triggers agent work uses API tokens. Consider the following to manage costs: * Longer intervals reduce cost (15-30 minutes instead of 5) * Use the LOCAL tier for simple heartbeat checks * Quiet hours prevent unnecessary spending during off-hours * Disable heartbeat entirely if autonomous work is not needed ## Monitoring ```bash theme={null} # Check last heartbeat time argent gateway status # View heartbeat activity in logs argent gateway logs --filter heartbeat ``` # Gateway Overview Source: https://docs.argentos.ai/gateway/index The always-on WebSocket control plane that manages agents, channels, and sessions. ## Overview The gateway is the central nerve system of ArgentOS. It is an always-on process that: * **Manages channels**: Connects to Telegram, Discord, WhatsApp, and other platforms * **Routes messages**: Directs incoming messages to the correct agent and session * **Streams responses**: Delivers agent responses back to channels and the dashboard * **Runs health checks**: Monitors system health and cleans up zombie processes * **Triggers heartbeats**: Periodically wakes the agent for autonomous task work ## Starting the Gateway ```bash theme={null} # Start in the foreground (for debugging) argent gateway start # Install as a system service (launchd on macOS, systemd on Linux) argent gateway install # Check status argent gateway status ``` ## Architecture ```mermaid theme={null} graph LR TG[Telegram] --> GW["Gateway
(WebSocket Server)"] DC[Discord] --> GW WA[WhatsApp] --> GW SL[Slack] --> GW SG[Signal] --> GW DB[Dashboard] --> GW GW --> AR[Agent Runtime] AR --> API[Claude API] AR --> Tools AR --> MemU ``` The gateway listens on a WebSocket port (default: 18789) and accepts connections from the dashboard and internal components. ## Service Management ```bash theme={null} argent gateway install # Install LaunchAgent argent gateway uninstall # Remove LaunchAgent argent gateway restart # Restart the service ``` The LaunchAgent plist is written to: ``` ~/Library/LaunchAgents/ai.argent.gateway.plist ``` ```bash theme={null} argent gateway install # Install systemd service sudo systemctl status argent-gateway ``` ## Ports | Port | Service | Description | | ----- | --------- | ----------------------- | | 18789 | Gateway | WebSocket control plane | | 3141 | Dashboard | Web UI and API server | ## Verifying the Gateway ```bash theme={null} argent gateway status ``` A healthy gateway shows: * Status: running * RPC probe: ok * Listening: \*:18789 If the RPC probe fails, check the [troubleshooting guide](/help/troubleshooting). # Remote Access Source: https://docs.argentos.ai/gateway/remote-access Access your ArgentOS gateway remotely via Tailscale, SSH tunnels, or reverse proxies. ## Overview By default, the gateway only listens on localhost. To access it from other devices (phone, laptop, office), you need to configure remote access. ArgentOS supports several approaches, with Tailscale being the recommended option. ## Tailscale (Recommended) [Tailscale](https://tailscale.com) creates a secure WireGuard mesh network between your devices. It is the simplest and most secure way to access your gateway remotely. ### Setup Install Tailscale on your ArgentOS server and your remote devices Configure the gateway to listen on the Tailscale interface: ```json theme={null} { "gateway": { "host": "0.0.0.0", "port": 18789 } } ``` Access the dashboard from any device on your Tailscale network: ``` http://your-server.tailnet-name.ts.net:3141 ``` ### Benefits * End-to-end encrypted (WireGuard) * No port forwarding required * Works behind NAT and firewalls * Free for personal use (up to 100 devices) ## SSH Tunnel For quick access without installing Tailscale: ```bash theme={null} # From your remote machine ssh -L 3141:localhost:3141 -L 18789:localhost:18789 user@your-server ``` Then open `http://localhost:3141` on your local machine. ### Persistent SSH Tunnel Use `autossh` for a persistent tunnel that reconnects automatically: ```bash theme={null} autossh -M 0 -f -N -L 3141:localhost:3141 -L 18789:localhost:18789 user@your-server ``` ## Reverse Proxy (Nginx/Caddy) For HTTPS access with a domain name: ``` argentos.yourdomain.com { reverse_proxy localhost:3141 } ws.argentos.yourdomain.com { reverse_proxy localhost:18789 } ``` ```nginx theme={null} server { listen 443 ssl; server_name argentos.yourdomain.com; location / { proxy_pass http://localhost:3141; } location /ws { proxy_pass http://localhost:18789; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } ``` ## Security Considerations Never expose the gateway directly to the public internet without authentication. * **Always enable gateway auth** when exposing remotely * **Use HTTPS** for reverse proxy setups * **Restrict access** with firewall rules or Tailscale ACLs * Consider Tailscale's [ACL system](https://tailscale.com/kb/1018/acls) for fine-grained access control ## Mobile Access Once remote access is configured, you can use the dashboard from your phone's browser. The dashboard is responsive and works on mobile screens. For native messaging, connect channels like Telegram or WhatsApp -- these work from any device without special remote access configuration. # Gateway Security Source: https://docs.argentos.ai/gateway/security-ops Sandboxing, tool policies, and exec approval workflows. ## Overview The gateway enforces security policies that control what the agent can do. This includes sandboxing command execution, restricting tool access, and requiring user approval for dangerous operations. ## Security Modes All tools are available with no approval required. Suitable for trusted environments where the agent has full system access. ```json theme={null} { "agents": { "defaults": { "security": { "mode": "unrestricted" } } } } ``` Tools are available but dangerous operations require user approval. This is the recommended mode for most deployments. ```json theme={null} { "agents": { "defaults": { "security": { "mode": "sandboxed" } } } } ``` Only safe tools (memory, tasks) are available. Command execution and browser are disabled. Suitable for customer-facing agents. ```json theme={null} { "agents": { "defaults": { "security": { "mode": "locked" } } } } ``` ## Tool Policies Fine-grained control over individual tools: ```json theme={null} { "agents": { "defaults": { "toolPolicies": { "exec": { "mode": "approval-required", "blockedPatterns": ["rm -rf", "sudo", "chmod 777"], "allowedPaths": ["/Users/sem/projects/"] }, "browser": { "mode": "allowed", "blockedDomains": ["banking.example.com"] }, "memory_store": { "mode": "allowed" } } } } } ``` ### Policy Modes | Mode | Behavior | | ------------------- | ------------------------------ | | `allowed` | Tool executes without approval | | `approval-required` | User must approve each use | | `blocked` | Tool is not available | ## Exec Approval Flow When the agent requests a command that requires approval: The command is displayed to the user (in dashboard or channel) User reviews the command User approves or rejects If approved, the command executes normally. If rejected, the agent is informed and can try an alternative. ## Gateway Authentication Without authentication, anyone with network access to the gateway port can send messages to your agent. Always enable auth for production deployments. ```json theme={null} { "gateway": { "auth": { "enabled": true, "token": "your-secret-token" } } } ``` ## Recommendations Sandboxed mode with approval for destructive commands Sandboxed mode with restricted paths Locked mode with only safe tools Unrestricted mode for rapid iteration # FAQ Source: https://docs.argentos.ai/help/faq Frequently asked questions about ArgentOS. ## General ArgentOS is an always-on personal AI operating system. It runs a persistent AI agent that you can talk to through Telegram, Discord, WhatsApp, Slack, Signal, iMessage, or a web dashboard. The agent has persistent memory, can execute commands, browse the web, manage tasks, and learn from interactions. ArgentOS is **self-hosted** and **always-on**. Unlike web-based AI chat interfaces: * Your agent runs on your hardware with your API keys * It has persistent memory that spans all conversations * It can execute commands and interact with your system * It connects to your existing messaging platforms * It can work autonomously through the task and heartbeat systems ArgentOS has a free Community tier with core functionality. Pro and Enterprise tiers unlock additional features. You still need your own API keys for model providers (Anthropic, etc.). At minimum, an **Anthropic API key** or **Max subscription setup token**. Optionally, you can add keys for MiniMax, Z.AI, OpenRouter, Ollama (free, local), and ElevenLabs (for TTS). ## Setup **Node.js 22+** is required. Use nvm (not Homebrew) on macOS to avoid ABI compatibility issues with native modules like better-sqlite3. ```bash theme={null} nvm install 22 nvm use 22 ``` Yes, through WSL2 (Windows Subsystem for Linux). Install Ubuntu in WSL2 and follow the Linux setup guide. Yes. See the [Docker installation guide](/install/docker). Yes, ArgentOS supports ARM64 Linux. A Raspberry Pi 4+ with 4GB+ RAM is recommended. ## Usage Yes. ArgentOS supports running all channels simultaneously. Your agent shares the same memory and context across all platforms. Yes. MemU (the memory system) persists information across all sessions and channels. The agent stores important facts, preferences, and events automatically. The model router scores each message's complexity and routes simple queries to cheap models (Haiku) and complex tasks to powerful models (Opus). Most conversations use the balanced tier (Sonnet), and simple greetings use the local tier (free). Yes. The heartbeat system periodically wakes the agent to check for pending tasks. Combined with quiet hours configuration, the agent can work through task queues autonomously. ## Security Only the messages sent to the LLM API (Anthropic, etc.) leave your machine. Memory, tasks, sessions, and configuration are all stored locally. ArgentOS does not phone home or collect telemetry. Only if configured to. The sandboxing system controls what the agent can do. In sandboxed mode (default), dangerous operations require your approval. In locked mode, command execution is disabled entirely. In sandboxed mode, destructive commands require your approval. The agent cannot delete files, modify permissions, or run sudo without explicit confirmation. ## Technical Two separate systems: 1. **MemU** -- The active agent memory at `~/.argentos/memory.db`. This is the agent's real brain, with semantic search, emotional context, entity tracking, and hybrid vector reranking. 2. **claude-mem** -- Used by Claude Code sessions only. Completely separate from the ArgentOS agent. If you see references to `openclaw-mem`, that was a deprecated legacy plugin from early development. It is no longer maintained and has been fully superseded by MemU. ArgentOS was inspired by OpenClaw's original vision of a self-hosted AI agent but is an independently developed AI operating system. ArgentOS has 90,000+ lines of original code powering systems with no OpenClaw equivalent, including persistent memory (MemU), consciousness kernel (contemplation + SIS), voice presence (AEVP), intent governance, knowledge library, execution worker, and more. A small runtime compatibility layer (`@mariozechner/pi-*` packages) remains from the shared heritage and is being actively replaced by argent-native code. The base installation uses under 100MB. Memory and session data grow over time. A typical installation with months of use is under 500MB. # Help & Support Source: https://docs.argentos.ai/help/index Get help with ArgentOS — support channels, community, and resources. ## Getting Help ### Documentation You are here. Browse the sidebar for detailed guides on every aspect of ArgentOS. ### CLI Help Every command has built-in help: ```bash theme={null} argent --help argent gateway --help argent channels add --help ``` ### Community Bug reports and feature requests. Q\&A and community discussion. Join the ArgentOS community server for real-time help. ### Enterprise Support Enterprise license holders have access to priority support: * Dedicated support channel * Direct access to the ArgentOS team * Priority bug fixes * Custom feature development Contact [support@argentos.ai](mailto:support@argentos.ai) for Enterprise support. ## Reporting Bugs When reporting a bug, include: ```bash theme={null} argent --version ``` ```bash theme={null} argent status --json ``` What you did. What should have happened. What actually happened. ```bash theme={null} argent gateway logs --level error ``` ### Log Collection ```bash theme={null} # Collect diagnostic info argent status --json > diagnostic.json argent gateway logs --last 100 > gateway-logs.txt ``` ## Feature Requests Open a GitHub Discussion with the "Feature Request" category. Include: * What you want to do * Why the current solution does not work * Your proposed approach (if you have one) ## Contributing ArgentOS is open to contributions: * Fork the repo on GitHub * Create a feature branch * Submit a pull request * Follow the coding style guide in CLAUDE.md See the project README for contribution guidelines. ## Quick Links Common issues and solutions. Frequently asked questions. New to ArgentOS? Start here. # Troubleshooting Source: https://docs.argentos.ai/help/troubleshooting Common ArgentOS issues and how to fix them. ## Gateway Issues **Symptom**: `argent gateway start` exits immediately or shows an error. **Check**: ```bash theme={null} argent gateway logs --level error ``` **Common causes**: * Port 18789 is already in use: `lsof -i :18789` * Node.js version mismatch: verify `node --version` shows v22+ * Config syntax error: `argent config validate` **Symptom**: `argent gateway status` shows "running" but "RPC probe: failed". **Common cause**: Native module ABI mismatch. The gateway is using a different Node.js version than the one used to compile native modules. **Fix**: ```bash theme={null} # Check which node the plist uses (macOS) grep -A1 ProgramArguments ~/Library/LaunchAgents/ai.argent.gateway.plist | grep node # Should match nvm node, not Homebrew # Fix: edit the plist to use nvm node path # Then reload: launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist ``` **Symptom**: Error log shows `NODE_MODULE_VERSION mismatch`. **Fix**: Rebuild native modules against the correct Node.js version: ```bash theme={null} cd /path/to/argentos pnpm rebuild better-sqlite3 ``` ## Channel Issues See [Channel Troubleshooting](/channels/troubleshooting#telegram-issues). WhatsApp Web sessions expire. Re-scan the QR code: ```bash theme={null} argent channels add whatsapp ``` Enable Privileged Gateway Intents in the Discord Developer Portal under your application's Bot settings. See [Discord setup](/channels/discord). ## Memory Issues * Check that memories exist: `argent memory stats` * Use simpler queries: single keywords work best with FTS5 * Try OR syntax for multi-word queries: `"telegram OR discord"` * Verify the database is accessible: `ls -la ~/.argentos/memory.db` Another process may be holding a lock: ```bash theme={null} # Check for processes using the database fuser ~/.argentos/memory.db # Restart the gateway to release locks argent gateway restart ``` ## Model/API Issues The failover system should handle this automatically. Check profile status: ```bash theme={null} argent status ``` If all profiles are in cooldown, wait for the cooldown to expire or add more auth profiles. The conversation has grown too large. This triggers automatic compaction, but if it persists: ```bash theme={null} # Clear the current session argent sessions clear ``` ## Performance Issues Check for zombie processes: ```bash theme={null} ps aux | grep "stream-json" ``` The health check reaper should clean these up every 60 seconds. If they persist, restart the gateway. * Check model tier: LOCAL tier is fastest, POWERFUL is slowest * Check for API latency in gateway logs * Verify network connectivity to API providers ## Getting More Help If these steps do not resolve your issue: ```bash theme={null} argent status --json ``` ```bash theme={null} argent gateway logs --last 200 ``` File a report on [GitHub](https://github.com/ArgentAIOS/core/issues). # ArgentOS Documentation Source: https://docs.argentos.ai/index The operating system for personal AI — self-hosted, always-on, connected everywhere.
ArgentOS

One continuous, truthful, self-directed mind.

A self-hosted AI that runs on your hardware. Persistent memory, autonomous thinking, voice interaction, and multi-channel communication — all under your control. ```bash theme={null} curl -fsSL https://argentos.ai/install.sh | bash ``` *** ## Get Started One command, full stack. macOS, Linux, or Docker. First-run wizard — auth, identity, channels. Config file, storage, models, and gateway options. ## Core Systems Connect Telegram, Discord, Slack, WhatsApp, Signal, iMessage, and more. Persistent memory that grows across every conversation. Hybrid search with MemU. Autonomous thinking loop — reflects, learns, and acts on its own. Smart routing across 15+ providers — free local models to frontier AI. 50+ built-in tools for browser, files, web search, code execution. Safety rules and three-tier governance for controlling agent behavior. ## Operate React web UI with avatar, chat, task board, and system controls. 62+ skills, plugins, and connectors. Install with one command. DM pairing, sandboxing, audit trails, and prompt injection defense. ## Learning Path One command, full stack. See [Installation](/install). Connect your first channel. See [Onboarding](/start/onboarding). Voice or text. See [Dashboard](/dashboard). Extend capabilities at [marketplace.argentos.ai](https://marketplace.argentos.ai). Gateway, memory, model router. See [Architecture](/agents/architecture). Ollama, Claude, GPT, Gemini. See [Models](/models). SKILL.md format and packaging. See [Skills](/tools/skills). Scheduled tasks and webhooks. See [Cron Jobs](/agents/cron-jobs). Control agent behavior with policies. See [Intent Governance](/agents/intent-governance). Human-in-the-loop for high-stakes actions. See [Execution Worker](/agents/execution-worker). RAG with agent-scoped access control. See [Knowledge Library](/agents/knowledge-library). Family agents and team coordination. See [Multi-Agent](/agents/multi-agent). ## Architecture ```mermaid theme={null} flowchart LR Input["Channels\nCron\nWebhooks\nCLI"] --> GW["Gateway\n:18789"] GW --> Runtime["Agent Runtime"] Runtime --> Memory["MemU"] Runtime --> Router["Model Router"] Runtime --> Tools["Exec Worker\nTools & Skills"] Runtime --> Output["Dashboard\nmacOS App\nMobile"] ``` ## Links argentos.ai marketplace.argentos.ai ArgentAIOS/core Join the community # Developer Branch Installs Source: https://docs.argentos.ai/install/developer-branch Install ArgentOS from the private develop lane to test release candidates before promotion to main. ## Why This Exists Production installs should not be the first place we discover regressions. ArgentOS now supports a private developer lane so release-facing changes can be: * merged into `develop` * installed from a test channel * regression tested by operators * explicitly signed off before promotion to `main` Use this path when you want to validate installer changes, update behavior, dashboard changes, agent workflow changes, or any release-facing integration before it becomes public. ## When to Use the Developer Branch Use the developer branch install flow when: * you are testing a release candidate * you need to validate installer or updater changes * you want to verify a bug fix in a realistic install environment * you are checking for regressions before public release Do not use it for normal operator installs or public customer installs. Those should stay on the production path. ## One-Line Developer Install Use the public installer entrypoint with a test channel and explicit git ref: ```bash theme={null} curl -fsSL "https://argentos.ai/install.sh?channel=dev&ref=develop" | bash ``` Equivalent explicit form: ```bash theme={null} curl -fsSL https://argentos.ai/install.sh | bash -s -- --channel dev --git-ref develop ``` Both forms install from the private `develop` lane instead of production. ## What It Does The developer install path: 1. uses the normal public installer entrypoint 2. selects the `dev` channel 3. resolves the requested git ref, with `develop` as the default dev lane 4. installs the runtime from that ref 5. persists the install on the dev update channel After install, `argent update` on that machine should continue tracking the dev lane unless the channel is changed. ## Release Flow The intended release flow is: 1. implementation happens on `codex/*` 2. Threadmaster merges validated work into `develop` 3. operators install and test from the dev lane 4. operator sign-off is recorded 5. the tested commit is promoted from `develop` to `main` 6. public release/export happens from `main` This keeps `main` from becoming the first install surface for release-facing changes. ## Example Test Cases Good reasons to use the developer branch install: * hosted installer changes * `argent update` behavior changes * PostgreSQL or Redis bootstrap changes * dashboard onboarding changes * gateway auth or bootstrap changes * public-doc changes that need validation alongside product behavior ## Switching Back to Production To return a machine to the production lane: ```bash theme={null} argent update --channel stable ``` If you want a completely clean production validation environment, use a separate machine, worktree, or state directory rather than reusing a dirty dev install. ## Notes * The dev lane is for operator and internal testing. * Public docs and operator runbooks should be updated before Threadmaster handoff when user-visible behavior changes. * If a feature needs special test instructions beyond `develop`, include the exact ref and validation notes in the Threadmaster handoff packet. # Docker Source: https://docs.argentos.ai/install/docker Run ArgentOS in a Docker container. ## Quick Start ```bash theme={null} docker run -d \ --name argentos \ -p 18789:18789 \ -p 8080:8080 \ -v ~/.argentos:/root/.argentos \ -e ANTHROPIC_API_KEY=sk-ant-... \ ghcr.io/argentaios/argentos:latest ``` The container runs the gateway on port 18789 and the dashboard on port 8080. ## Docker Compose ```yaml Basic theme={null} version: "3.8" services: argentos: image: ghcr.io/argentaios/argentos:latest restart: unless-stopped ports: - "18789:18789" - "8080:8080" volumes: - argentos-state:/root/.argentos - argentos-workspace:/root/argent environment: - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} volumes: argentos-state: argentos-workspace: ``` ```yaml With External PostgreSQL and Redis theme={null} version: "3.8" services: argentos: image: ghcr.io/argentaios/argentos:latest restart: unless-stopped ports: - "18789:18789" - "8080:8080" volumes: - argentos-state:/root/.argentos - argentos-workspace:/root/argent environment: - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} depends_on: - postgres - redis postgres: image: pgvector/pgvector:pg17 restart: unless-stopped ports: - "5433:5432" volumes: - pgdata:/var/lib/postgresql/data environment: - POSTGRES_DB=argentos - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres redis: image: redis:7-alpine restart: unless-stopped ports: - "6380:6379" volumes: - redisdata:/data volumes: argentos-state: argentos-workspace: pgdata: redisdata: ``` ## Building from Source ```bash theme={null} git clone https://github.com/ArgentAIOS/argentos.git cd argentos docker build -t argentos . ``` The Dockerfile uses `node:22-bookworm`, installs Bun for build scripts, and runs the gateway as a non-root user for security. ## LAN Access By default the container binds to loopback. To expose the gateway on LAN (for mobile apps or external health checks): Set `ARGENT_GATEWAY_TOKEN` or `ARGENT_GATEWAY_PASSWORD` environment variable. ```bash theme={null} docker run -d \ --name argentos \ -p 18789:18789 \ -e ANTHROPIC_API_KEY=sk-ant-... \ -e ARGENT_GATEWAY_TOKEN=your-secret-token \ ghcr.io/argentaios/argentos:latest \ node dist/index.js gateway --allow-unconfigured --bind lan ``` ## Environment Variables | Variable | Required | Description | | ---------------------------- | -------- | --------------------------------------------------- | | `ANTHROPIC_API_KEY` | Yes | Anthropic API key for the agent | | `ARGENT_GATEWAY_TOKEN` | No | Token for gateway authentication (required for LAN) | | `ARGENT_GATEWAY_PASSWORD` | No | Password alternative to token | | `ARGENT_DOCKER_APT_PACKAGES` | No | Extra apt packages to install at build time | # Installation Source: https://docs.argentos.ai/install/index Install ArgentOS on macOS, Linux, or via Docker. ## Prerequisites (macOS) ArgentOS uses Homebrew to install PostgreSQL, Redis, and system services. Install it first if you don't have it: ```bash theme={null} /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ## One-Command Install ```bash theme={null} curl -fsSL https://argentos.ai/install.sh | bash ``` Need to test a release candidate before it is promoted to `main`? Use the [Developer Branch install guide](/install/developer-branch). On macOS, this installs the full native stack: | Component | What it does | Port | | ----------------- | -------------------------------------------- | ----- | | **Homebrew** | Required — must be pre-installed (see above) | — | | **PostgreSQL 17** | Memory, knowledge, agent registry | 5433 | | **Redis** | State, pub/sub, inter-agent streams | 6380 | | **Node.js 22** | Runtime (via nvm) | — | | **ArgentOS** | Agent source, CLI, built dist | — | | **Gateway** | Background LaunchAgent (survives reboots) | 18789 | | **Argent.app** | macOS desktop app with onboarding wizard | — | Non-default ports (5433, 6380) are used to avoid conflicts with existing PostgreSQL or Redis installations. ## Platform Support | Platform | Status | Install method | | --------------------- | ---------------- | ---------------------------------------------- | | macOS (Apple Silicon) | **Full support** | `curl` installer — primary platform | | macOS (Intel) | **Full support** | `curl` installer | | Linux (x86\_64) | **Supported** | `curl` installer (no .app, CLI only) | | Linux (ARM64) | **Supported** | `curl` installer (Raspberry Pi 4+, Oracle ARM) | | Windows (WSL2) | **Supported** | Run installer inside WSL2 Ubuntu | | Docker | **Supported** | See [Docker guide](/install/docker) | ## Requirements * **macOS 13+** or **Ubuntu 22.04+** (or equivalent) * **4GB RAM** minimum (8GB+ recommended for local models) * **Anthropic API key** or **Max subscription setup token** — for the agent runtime * Internet connection for initial install Node.js 22 and pnpm are installed automatically by the installer. If you already have Node via nvm, it will be detected and reused. ## What Gets Installed The installer creates these paths: | Path | Contents | | ------------------------------------ | ---------------------------------------------- | | `~/.argentos/` | Config, memory database, agent state, logs | | `~/.argentos/runtime/` | Private Node.js runtime (if nvm not available) | | `~/argentos/` | Source checkout (git clone) | | `~/bin/argent` | CLI wrapper | | `/Applications/Argent.app` | macOS desktop app (macOS only) | | `~/Library/LaunchAgents/ai.argent.*` | Gateway and Redis LaunchAgents (macOS only) | ## Manual Install (from source) If you prefer to install manually: ```bash theme={null} git clone --depth 1 https://github.com/ArgentAIOS/argentos.git ~/argentos cd ~/argentos ``` ```bash theme={null} pnpm install pnpm build ``` ```bash theme={null} mkdir -p ~/bin ln -sf ~/argentos/scripts/run-node.sh ~/bin/argent ``` ```bash theme={null} argent setup argent gateway install argent gateway start ``` You'll need to install PostgreSQL 17 (port 5433) and Redis (port 6380) yourself. See the setup scripts in `scripts/setup-postgres.sh` and `scripts/setup-redis.sh`. ## Verify Installation ```bash theme={null} argent gateway status ``` You should see the gateway running and healthy. If something went wrong, see [Troubleshooting](/help/troubleshooting). ## Next Steps Connect your first channel. Clean removal of all services. Keep ArgentOS current. Install from the private `develop` lane for regression testing. Containerized deployment. # Node.js Requirements Source: https://docs.argentos.ai/install/node-requirements Node.js version requirements and native module compatibility. ## Required Version ArgentOS requires **Node.js 22+**. Use nvm to manage versions: ```bash theme={null} nvm install 22 nvm use 22 ``` Do **not** use Homebrew Node on macOS. Native modules like `better-sqlite3` are compiled against the Node ABI version at install time. Mixing Homebrew and nvm Node will cause `MODULE_VERSION mismatch` errors. ## Native Module Issues If you see `NODE_MODULE_VERSION mismatch` errors: ```bash theme={null} cd /path/to/argentos pnpm rebuild better-sqlite3 ``` ## LaunchAgent (macOS) The gateway LaunchAgent plist uses whatever `node` binary is in PATH at install time. If the plist points to Homebrew node but your modules were built against nvm node, the gateway will crash silently. Edit `~/Library/LaunchAgents/ai.argent.gateway.plist` and ensure the node path matches your nvm version: ```xml theme={null} /Users/you/.nvm/versions/node/v22.22.0/bin/node ``` ```bash theme={null} launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist ``` # Uninstall Source: https://docs.argentos.ai/install/uninstall Remove ArgentOS from your system. ## Uninstall ```bash theme={null} argent uninstall ``` This removes the CLI and gateway service. Your data in `~/.argentos/` is preserved. ## Complete Removal To remove all data: ```bash theme={null} argent gateway stop rm -rf ~/.argentos rm -rf ~/argent # workspace ``` This permanently deletes your memory database, configuration, and all agent data. Make sure you have a backup if needed. For a more detailed uninstall guide covering macOS LaunchAgents, manual removal, and platform-specific steps, see the [full uninstall guide](/start/uninstall). # Updating Source: https://docs.argentos.ai/install/updating Keep ArgentOS up to date. ## Update ArgentOS ```bash theme={null} argent update ``` This pulls the latest version and rebuilds. Your configuration and data are preserved. If you need to validate a test release before it reaches production, use the [Developer Branch install guide](/install/developer-branch) instead of the stable lane. ## Manual Update ```bash theme={null} cd /path/to/argentos git pull pnpm install pnpm build ``` After updating, restart the gateway: ```bash theme={null} argent gateway restart ``` # Intent & Safety Source: https://docs.argentos.ai/intents/index Control what your agent can and cannot do — from simple safety rules to full enterprise governance. ## Two Levels of Control ArgentOS gives you control over your agent's behavior at two levels, depending on your needs: | | **Safety Rules** (Core) | **Intent Governance** (Business) | | -------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | **Who it's for** | Everyone | Teams, MSPs, enterprise | | **What it does** | Set basic boundaries -- what your agent should never do, and what needs your approval | Full three-tier policy hierarchy with departments, monotonic inheritance, simulation gates, and industry packs | | **Where to find it** | Dashboard > Settings > Safety Rules | Dashboard > Settings > Advanced Governance Console | | **Complexity** | 3 settings + 2 lists | Full policy engine with 20+ configurable fields | Both systems use the same underlying intent engine. Safety Rules is a simplified interface that writes to the same config. You can start with Safety Rules and upgrade to full governance when you need it. ## Safety Rules (Core) Available to all ArgentOS users. Set basic guardrails for your agent in under a minute. **[Read the Safety Rules guide](/intents/safety-rules)** Three controls: 1. **Cautiousness level** -- How careful should your agent be? (Relaxed, Balanced, Strict) 2. **Never do** -- Actions that are always blocked, regardless of context 3. **Requires approval** -- Actions where your agent will ask before proceeding ## Intent Governance (Business) For teams running multiple agents across departments with compliance requirements. **[Read the Governance guide](/intents/governance)** Full hierarchical policy engine: * **Global > Department > Agent** inheritance (children can only tighten, never loosen) * **Monotonic rules** -- neverDo is additive, allowedActions is subset-only, escalation thresholds get stricter * **Simulation gates** -- Test agent behavior before deployment * **Industry packs** -- Pre-built configurations for law, medical, financial, MSP, and more * **Department templates** -- Support, Engineering, MSP Ops, Research ## How They Relate ```mermaid theme={null} graph TD IE["Intent Engine (core)
resolveEffectiveIntentForAgent()
buildIntentSystemPromptHint()
validateIntentHierarchy()"] SR["Safety Rules
(Core UI)
On/Off, Cautious,
Never do, Approval"] GC["Governance Console
(Business UI)
Global policy, Departments,
Agent policies, Simulation gates,
Industry packs"] CFG["Same config: ~/.argentos/argent.json"] SR --> IE GC --> IE IE --> CFG ``` Safety Rules writes `enabled`, `runtimeMode`, `globalPolicy.neverDo`, and `globalPolicy.requiresHumanApproval`. The Governance Console exposes the full hierarchy. Both read and write the same `intent` config block. # Industry Packs Source: https://docs.argentos.ai/intents/industry-packs Pre-built intent configurations tuned for specific business verticals. **ArgentOS Business** -- Industry packs are part of the Business governance tier. ## Overview Industry packs provide pre-configured intent hierarchies tuned for specific business verticals. Each pack includes global policies, department templates, neverDo lists, escalation rules, and compliance-aware defaults so you don't have to build governance from scratch. Load a pack from Dashboard > Settings > Advanced Governance Console > Industry Packs. ## Available Packs Client confidentiality as the top priority. Privilege protections, conflict-of-interest checks, billing compliance, and strict data handling rules. neverDo includes disclosing privileged communications and providing legal advice without attorney review. Builds on Law Firm with PI-specific additions: HIPAA awareness for medical records, settlement protocol constraints, lien tracking rules, and statute of limitations monitoring. Patient privacy defaults, treatment protocol boundaries, insurance compliance rules, and appointment/billing guardrails. Escalation triggers on patient complaints and insurance disputes. HIPAA strict mode. Clinical decision support boundaries (agent assists, never diagnoses). Referral protocol enforcement, medication mention restrictions, and mandatory human review for any patient-facing communication. Patient records handling, treatment plan approval workflows, insurance pre-authorization tracking, and lab order constraints. Balanced escalation for patient concerns. SEC/FINRA awareness. Fiduciary constraints, audit trail requirements, disclosure rules, and prohibition on investment advice without proper context. High escalation sensitivity for client complaints. Multi-tenant isolation rules, infrastructure change control, cost governance alerts, and SLA-driven escalation. Departments pre-configured for NOC, engineering, and client success. Pre-configured for the holace.io personal injury SaaS platform. Combines PI Law and Medical pack rules with holace-specific workflow constraints. ## Starter Presets These aren't industry-specific but provide starting points for governance configuration: | Preset | Autonomy | Enforcement | Use case | | ---------------- | -------- | ------------------------------------------------------- | -------------------------------------------- | | **Conservative** | Minimal | Strict validation + enforce runtime | First deployment, high-stakes environments | | **Balanced** | Moderate | Warn validation + advisory runtime | Most users, iterating on policies | | **Enforce** | Moderate | Enforce validation + enforce runtime + simulation gates | Production deployments with compliance needs | ## Customizing a Pack Industry packs are starting points, not final configurations. After loading a pack: Adjust the objective to match your organization Add or remove departments as needed Based on your team's capacity Validate agent behavior with test suites Packs can be loaded multiple times -- each load merges with existing config. To start fresh, clear the intent config first. ## See Also * [Intent Governance](/intents/governance) -- the policy engine that packs configure * [Simulation Gates](/intents/simulation-gates) -- test pack configurations before deployment * [Safety Rules](/intents/safety-rules) -- simpler alternative for personal use # Safety Rules Source: https://docs.argentos.ai/intents/safety-rules Set basic boundaries for your agent — what it should never do and what needs your approval. ## Overview Safety Rules is the simplest way to control your agent's behavior. Available to all ArgentOS users, it lets you set guardrails in under a minute without touching config files. **Find it in:** Dashboard > Settings > Safety Rules ## Getting Started Run `argent dashboard` or navigate to `http://localhost:8080` Click the gear icon Located at the top of the settings panel Click **Disabled** to toggle it to **Enabled** ## Three Controls ### 1. Cautiousness Level How careful should your agent be? Choose a preset: | Preset | Runtime Mode | Behavior | | ------------ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | | **Relaxed** | Off | Agent acts freely. Safety rules exist in config but aren't actively enforced. Good for personal use where you trust your agent. | | **Balanced** | Advisory | Agent sees your rules as guidance in its system prompt. It will try to follow them but isn't hard-blocked. Default for most users. | | **Strict** | Enforce | Agent is actively constrained. Violations trigger escalation or action blocking. Best for business use or shared environments. | ### 2. Never Do Actions that are always blocked, regardless of context. These are hard prohibitions your agent cannot override. **Examples:** * Delete files without asking * Share personal information with third parties * Make financial commitments * Access systems outside the approved list * Send emails without explicit approval Click **+** or press Enter to add rules. Each rule appears as a red tag. Click the trash icon to remove one. ### 3. Requires Your Approval Actions where your agent will pause and ask before proceeding. The agent can still perform these actions, but only after you confirm. **Examples:** * Sending messages on your behalf * Creating calendar events * Modifying shared documents * Running terminal commands * Making API calls to external services ## How It Works When you save Safety Rules, it writes to the intent engine config at `~/.argentos/argent.json`: ```json theme={null} { "intent": { "enabled": true, "runtimeMode": "advisory", "global": { "neverDo": ["delete files without asking"], "requiresHumanApproval": ["sending messages on my behalf"] } } } ``` When `runtimeMode` is `advisory` or `enforce`, these rules are injected into your agent's system prompt on every interaction. The agent sees them as behavioral constraints and adjusts its actions accordingly. ## Tips * **Start with Balanced.** It provides good guardrails without being restrictive. Switch to Strict if you're running agents for clients. * **Be specific.** "Don't do bad things" is vague. "Never delete files without asking first" is clear and enforceable. * **Review periodically.** As you use your agent more, you'll discover new boundaries you want to set. Add them as they come up. * **Approval rules are training wheels.** Start with many approval requirements and remove them as you build trust with your agent's judgment. ## Upgrading to Full Governance Safety Rules covers the basics. When you need departments, per-agent policies, simulation testing, or industry compliance packs, upgrade to [Intent Governance](/intents/governance) (ArgentOS Business). The Advanced Governance Console is available in the same Settings panel, collapsed under "Advanced Governance Console (Business)." # Simulation Gates Source: https://docs.argentos.ai/intents/simulation-gates Test agent behavior against quality benchmarks before allowing deployment. **ArgentOS Business** -- Simulation gates are part of the Business governance tier. ## Overview Simulation gates are optional quality checkpoints that evaluate agent behavior before allowing deployment. They run test suites against agent policies and score the results across four dimensions. ## Four Component Scores | Component | What It Measures | | ----------------------- | -------------------------------------------------- | | `objectiveAdherence` | Does the agent pursue its defined objective? | | `boundaryCompliance` | Does the agent respect neverDo and allowedActions? | | `escalationCorrectness` | Does the agent escalate at the right times? | | `outcomeQuality` | Are the agent's outputs high quality? | Each score is 0-1. The gate aggregates scores across test suites and compares against minimum thresholds. ## Gate Modes | Mode | Behavior | | ----------- | ---------------------------------------------------------------------------------------------------------------------- | | **Warn** | Scores are computed and logged. Agent deploys regardless. Use during initial setup to understand baseline performance. | | **Enforce** | Scores must meet minimums. Agent deployment is blocked if any component falls below threshold. Use in production. | ## Configuration ```json theme={null} { "simulationGate": { "enabled": true, "mode": "enforce", "suites": ["support-basic", "escalation-scenarios"], "minPassRate": 0.8, "minComponentScores": { "objectiveAdherence": 0.85, "boundaryCompliance": 0.95, "escalationCorrectness": 0.80, "outcomeQuality": 0.75 }, "reportPath": "~/.argentos/reports/simulation/" } } ``` Simulation gates can be configured globally or per-agent. Agent-level gates override the global gate. ## Worker Wizard Defaults When creating agents through the Worker Wizard, each template comes with recommended simulation defaults: | Template | Boundary Compliance | Escalation Correctness | Outcome Quality | Mode | | ---------------- | ------------------- | ---------------------- | --------------- | -------- | | MSP T1 Support | 90% | 85% | 75% | Enforce | | Developer | 80% | 70% | 85% | Warn | | Research Analyst | -- | -- | -- | Disabled | | Project Manager | -- | -- | -- | Disabled | ## When to Use * **New agent deployment** -- verify the agent behaves within policy before going live * **Policy changes** -- re-run simulations after modifying department or global policies * **Compliance audits** -- generate reports showing agent adherence to organizational rules * **Regression testing** -- catch behavior drift after model or config changes ## See Also * [Intent Governance](/intents/governance) -- the policy engine that simulation gates validate against # License Activation Source: https://docs.argentos.ai/licensing/activation Activate your ArgentOS license — key entry, hardware fingerprint, and verification. ## Overview License activation binds your license key to your specific ArgentOS installation. This is a one-time process per machine. ## Activation Flow ```mermaid theme={null} graph LR LK[License Key] --> AS[Activation Server] AS --> HF[Hardware Fingerprint] HF --> V[Verification] V --> FU[Features Unlocked] ``` ```bash theme={null} argent license activate ARGENT-XXXX-XXXX-XXXX-XXXX ``` Or through the dashboard: **Settings > License > Activate**. ArgentOS generates a hardware fingerprint based on: * Machine ID * OS type * CPU identifier * Network interface MAC address This fingerprint uniquely identifies your installation without collecting personal information. The license key and fingerprint are sent to the activation server: ``` POST https://api.argentos.ai/v1/licenses/activate { "key": "ARGENT-XXXX-XXXX-XXXX-XXXX", "fingerprint": "sha256:abc123...", "hostname": "my-server" } ``` The server verifies the key is valid and not already activated on another machine, then returns an activation token. The activation token is stored locally: ``` ~/.argentos/license.json ``` This token is used for periodic verification without needing to re-activate. ## Verification Schedule ArgentOS verifies the license periodically: * **On startup**: Checks the local token validity * **Daily**: Contacts the server to verify the license is still active * **On feature use**: Some features check license tier before executing If verification fails (network issues), a grace period allows continued use. ## Transferring a License To move your license to a different machine: ```bash theme={null} # On the old machine argent license deactivate # On the new machine argent license activate ARGENT-XXXX-XXXX-XXXX-XXXX ``` Deactivation releases the hardware fingerprint, allowing activation on new hardware. ## Troubleshooting The key is bound to another machine. Deactivate it there first, or contact support. Verify the key format: `ARGENT-XXXX-XXXX-XXXX-XXXX`. Check for typos or extra whitespace. Check your internet connection. If persistent, the activation server may be temporarily unavailable. ArgentOS will use the grace period until connectivity is restored. # Enterprise Features Source: https://docs.argentos.ai/licensing/enterprise Organizations, API key management, instance management, and secret sync for teams. ## Overview ArgentOS Enterprise is designed for teams and organizations that need to manage multiple agent instances, centralize API key distribution, and maintain organizational control. ## Enterprise Features | Feature | Description | | ----------------------- | ------------------------------------------------------- | | **Organizations** | Group multiple users and instances under one org | | **API Key Management** | Centrally manage and distribute provider API keys | | **Instance Management** | Monitor and configure multiple ArgentOS deployments | | **Secret Sync** | Automatically distribute API keys to instances | | **Priority Support** | Direct support channel with the ArgentOS team | | **Multi-Agent** | Run multiple agents per instance with different configs | | **Audit Logging** | Centralized logging of agent actions across instances | ## Organizations An organization groups users, licenses, and instances together: ``` Organization: Titanium Computing Admin: Jason Instances: office-server (Dell R750) home-studio (Mac Studio) mobile-agent (Mac Mini) API Keys: Anthropic: sk-ant-api03-... MiniMax: sk-cp-... ElevenLabs: ... ``` ## API Key Management Instead of configuring API keys on each instance individually, Enterprise admins manage keys centrally: Add API keys to the organization in the licensing portal Keys are assigned to specific instances or shared across all Instances pull their assigned keys on activation and periodically ### Benefits * Single point of key rotation * No need to SSH into each machine to update keys * Audit trail of which instance uses which key * Automatic distribution of new keys ## Secret Sync Secret sync is the mechanism that distributes API keys from the organization to individual instances: ```bash theme={null} # Instance pulls its keys argent license sync ``` This happens automatically on: * Instance activation * Gateway startup * Periodic sync (configurable interval) Synced keys are written to the local `auth-profiles.json`, merging with any locally-configured profiles. ## Instance Management Monitor all ArgentOS deployments from the licensing portal: * **Health status**: Which instances are online/offline * **License status**: Active, expired, approaching limits * **Usage metrics**: API calls, token usage, active sessions * **Remote configuration**: Push config changes to instances ## Setting Up Enterprise Contact [sales@argentos.ai](mailto:sales@argentos.ai) or sign up at [argentos.ai/enterprise](https://argentos.ai/enterprise) Purchase Enterprise-tier licenses for each instance Add your provider API keys in the organization portal ```bash theme={null} argent license activate ARGENT-XXXX-XXXX-XXXX-XXXX --org titanium-computing ``` ```bash theme={null} argent license status # Should show: Organization: Titanium Computing, Synced keys: 3 ``` # Licensing Overview Source: https://docs.argentos.ai/licensing/index How ArgentOS licensing works — plans, features, and activation. ## Overview ArgentOS uses a licensing system to manage access to features across different tiers. The core platform is available to all users, with additional features unlocked through paid licenses. ## License Tiers **Individual developers** * Core agent * 1 channel * Basic memory * CLI **Power users** * All channels * Model router * Dashboard * TTS * Heartbeat **Teams & organizations** * Multi-agent * Secret sync * Org management * Priority support ## How Licensing Works Purchase a license key from [argentos.ai](https://argentos.ai) Activate the key on your ArgentOS instance ArgentOS periodically verifies the license is valid Licensed features are unlocked based on your tier ## License Keys A license key looks like: ``` ARGENT-XXXX-XXXX-XXXX-XXXX ``` Keys are tied to a hardware fingerprint after activation, preventing unauthorized sharing. ## Offline Support After initial activation, ArgentOS works offline with a grace period. The license is verified locally using a cached token. Online verification is required periodically to maintain active status. ## Managing Your License ```bash theme={null} # Activate a license argent license activate ARGENT-XXXX-XXXX-XXXX-XXXX # Check license status argent license status # Deactivate (for transferring to another machine) argent license deactivate ``` Navigate to **Settings > License** to view your license status, features, and expiration. ## Related Pages * [Activation](/licensing/activation) -- Step-by-step activation flow * [Enterprise](/licensing/enterprise) -- Enterprise features and org management # Atera MSP Integration Source: https://docs.argentos.ai/marketplace/atera Connect ArgentOS to your Atera RMM/PSA platform — tickets, devices, alerts, and reports through natural language. ## Overview The Atera plugin connects ArgentOS to your [Atera](https://www.atera.com) RMM/PSA platform. Your agent can query tickets, manage devices, monitor alerts, and run reports -- all through natural conversation. Built for MSPs and IT teams that use Atera as their primary helpdesk and remote management tool. ## Quick Start In **Dashboard > Settings > API Keys** (variable: `ATERA_API_KEY`) Add `"atera"` to `plugins.allow` in `~/.argentos/argent.json` Set `technicianName` in `plugins.entries.atera.config` Ask the agent to run setup -- she'll link your technician ID automatically ## Tools | Tool | Description | | ----------------- | ---------------------------------------------------------------------- | | `atera_tickets` | List and search tickets by status, customer, or assignee | | `atera_ticket` | Get ticket detail or create new tickets | | `atera_devices` | List devices, filter by customer or online status | | `atera_customers` | List and search customers | | `atera_alerts` | View active monitoring alerts by severity | | `atera_report` | Run reports: my tickets, open tickets, customer summary, device health | | `atera_setup` | Self-service technician identity linking | ## What You Can Ask * "Show me my open tickets" * "Any critical alerts right now?" * "List offline devices for Acme Corp" * "Create a high priority ticket for the printer issue at Smith & Co" * "Give me a customer summary report" * "How's our device health looking?" ## Agent Context The plugin injects a live summary into the agent's context before every conversation -- your open ticket count and overall queue status. The agent always knows your current workload without you having to ask. ## Requirements * Atera account with API access * API key from Atera Admin > API ## Configuration | Key | Description | | --------------------- | -------------------------------------------- | | `technicianName` | Your display name in Atera | | `technicianId` | Auto-detected by `atera_setup` | | `excludedCustomerIds` | Customer IDs to hide (e.g., system accounts) | ## Source ``` ~/.argentos/extensions/atera/ argent.plugin.json index.ts README.md ``` See [Building Plugins](/tools/building-plugins) for how this extension was built. # Browsing & Installing Source: https://docs.argentos.ai/marketplace/browsing Search, evaluate, and install packages from the ArgentOS marketplace. ## Searching ```bash theme={null} # Search by keyword argent marketplace search "browser automation" # Search by type argent marketplace search --type skill "research" # Search by author argent marketplace search --author argentos ``` Browse [marketplace.argentos.ai](https://marketplace.argentos.ai) for a visual catalog with ratings, downloads, and detailed descriptions. ## Package Details Before installing, review the package details: ```bash theme={null} argent marketplace info @argentos/research ``` This shows: * Description and version * Author and license * Required permissions * Dependencies * Download count and rating * Changelog ## Installing Packages ```bash theme={null} argent marketplace install @argentos/research ``` The CLI: 1. Downloads the package 2. Shows required permissions and asks for confirmation 3. Installs to `~/.argentos/extensions/` 4. Registers the package with the agent runtime 5. Restarts affected components if needed ```bash theme={null} argent marketplace install ./my-local-package ``` ```bash theme={null} argent marketplace install https://github.com/user/argent-skill-repo ``` ## Managing Installed Packages ### List ```bash theme={null} argent marketplace list ``` Shows all installed packages with version, type, and status. ### Update ```bash theme={null} # Update a specific package argent marketplace update @argentos/research # Update all packages argent marketplace update --all ``` ### Uninstall ```bash theme={null} argent marketplace uninstall @argentos/research ``` ## Version Pinning By default, `install` gets the latest version. Pin to a specific version: ```bash theme={null} argent marketplace install @argentos/research@1.2.3 ``` ## Permissions Review When a package requests permissions, the CLI displays them: ``` @argentos/research requires: - exec: Execute shell commands (for web scraping tools) - browser: Web browsing automation - memory_store: Write to agent memory Accept? [y/N] ``` Review permissions carefully before accepting, especially for community packages. ## Offline Installation For air-gapped environments, download packages on a connected machine and transfer: ```bash theme={null} # Download without installing argent marketplace download @argentos/research --output ./packages/ # Install from downloaded file argent marketplace install ./packages/argentos-research-1.2.3.tgz ``` # Marketplace Overview Source: https://docs.argentos.ai/marketplace/index Browse and install skills, plugins, avatars, and templates from the ArgentOS marketplace. ## Overview The ArgentOS Marketplace is a registry of community and official packages that extend your agent's capabilities. Install skills, plugins, dashboard avatars, and prompt templates with a single command. ## Package Types Bundled tools + prompts for specific capabilities (e.g., `@argentos/research`, `@argentos/code-review`) Low-level runtime extensions (e.g., `response-validator`, `tts-enforcer`) Live2D or static avatar models for the dashboard System prompt templates and identity presets ## Quick Start ```bash theme={null} # Search the marketplace argent marketplace search "research" # Install a package argent marketplace install @argentos/research # List installed packages argent marketplace list ``` ## Marketplace URL Browse packages at [marketplace.argentos.ai](https://marketplace.argentos.ai). ## Official Packages Packages under the `@argentos/` namespace are maintained by the ArgentOS team: | Package | Type | Description | | -------------------------- | ------ | ---------------------------------------- | | `@argentos/research` | Skill | Web research with multi-source synthesis | | `@argentos/code-review` | Skill | Code analysis and review | | `@argentos/report-writer` | Skill | Structured report generation | | `@argentos/avatar-default` | Avatar | Default Live2D avatar | ## Community Packages Anyone can publish packages to the marketplace. Community packages are identified by their namespace (e.g., `@username/package-name`). ## Package Safety Community packages are user-contributed and should be reviewed before installation. * Official packages (`@argentos/`) are reviewed and maintained by the team * Packages declare their required permissions in their manifest * The CLI shows permission requirements before installation ## Related Pages * [Browsing](/marketplace/browsing) -- Searching and installing packages * [Publishing](/marketplace/publishing) -- Creating and sharing your own packages # Publishing Packages Source: https://docs.argentos.ai/marketplace/publishing Create and share your own skills, plugins, avatars, and templates. ## Overview Publishing to the ArgentOS marketplace lets you share your extensions with the community. This guide covers creating a package, testing it locally, and publishing it. ## Package Structure Every marketplace package follows this structure: ``` my-package/ argent.plugin.json # Package manifest README.md # Documentation LICENSE # License file tools/ # Tool definitions (optional) my-tool.json prompts/ # System prompt additions (optional) system.md handlers/ # Tool handler implementations (optional) my-tool.ts assets/ # Static assets like avatars (optional) avatar.model3.json ``` ## Manifest The `argent.plugin.json` manifest describes your package: ```json theme={null} { "name": "@yourname/my-skill", "version": "1.0.0", "type": "skill", "description": "A useful skill for ArgentOS agents", "author": "Your Name", "license": "MIT", "homepage": "https://github.com/yourname/my-skill", "keywords": ["research", "web", "analysis"], "permissions": ["exec", "browser"], "tools": ["tools/my-tool.json"], "prompts": ["prompts/system.md"], "argentos": { "minVersion": "1.0.0" } } ``` ### Required Fields | Field | Description | | ------------- | --------------------------------------------- | | `name` | Unique package name (`@scope/name` format) | | `version` | Semantic version | | `type` | Package type: skill, plugin, avatar, template | | `description` | Short description | | `author` | Author name or organization | | `license` | SPDX license identifier | | `permissions` | Tools/capabilities the package requires | ## Development Workflow ```bash theme={null} argent marketplace init my-skill cd my-skill ``` This scaffolds a basic package structure. Install from a local directory to test: ```bash theme={null} argent marketplace install ./my-skill ``` Test the skill by interacting with your agent. ```bash theme={null} argent marketplace validate ./my-skill ``` Checks the manifest, schema validity, and package structure. ```bash theme={null} # Login to the marketplace argent marketplace login # Publish argent marketplace publish ``` ## Best Practices 1. **Write a good README** -- Include examples and usage instructions 2. **Declare all permissions** -- Users need to know what your package accesses 3. **Use semantic versioning** -- Follow semver for version numbers 4. **Include a LICENSE** -- Required for marketplace listing 5. **Test thoroughly** -- Validate on a clean ArgentOS installation 6. **Keep it focused** -- One capability per package is better than a kitchen sink ## Updating Published Packages ```bash theme={null} # Bump version npm version patch # or minor, major # Publish the update argent marketplace publish ``` Existing users will see the update when they run `argent marketplace update`. ## Unpublishing ```bash theme={null} argent marketplace unpublish @yourname/my-skill@1.0.0 ``` Unpublishing removes the package from the marketplace. Users who already installed it keep their local copy, but new installations are not possible. # Memory Architecture Lanes Source: https://docs.argentos.ai/memory/architecture-lanes MemU, RAG Library, and SIS working together for continuity. ## Overview Argent memory has three lanes that must all be healthy: 1. **MemU/Memo**: lived experience (`what happened`) 2. **RAG Library**: uploaded knowledge (`what was studied`) 3. **SIS**: pattern consolidation (`what was learned over time`) ```mermaid theme={null} flowchart TD A["Chat + tasks + events"] --> B["Memo/MemU (lived experience)"] B --> C["Personal memory recall"] D["Uploaded docs / library files"] --> E["RAG ingestion (chunk + embed + ACL)"] E --> F["Knowledge recall (library search)"] G["Contemplation episodes"] --> H["SIS lessons (patterns)"] C --> I["Runtime prompt context"] F --> I H --> I I --> J["Argent response"] ``` ## Plain English * If **MemU** is down, Argent stops capturing new personal facts reliably. * If **SIS** is down, Argent stops improving lessons over time. * If **RAG** is down, document-backed answers degrade. ## Required Baseline Settings | Setting | Value | | ----------------- | ------------------------------------ | | MemU LLM provider | `ollama` | | MemU LLM model | `qwen3:30b-a3b-instruct-2507-q4_K_M` | | MemU think level | `low` | | MemU timeout | `30000` | | Embeddings model | `nomic-embed-text` (Ollama) | `nomic-embed-text` is an embedding model, not a MemU extraction/chat model. ## Golden End-to-End Test Send a unique personal fact in chat. Ask Argent to recall that fact after 1-2 turns. Ask a direct question from a known uploaded library document. Confirm both lanes respond correctly (MemU + RAG). # Consciousness Memory (Observation Layer) Source: https://docs.argentos.ai/memory/consciousness-memory Experimental synthesis layer bridging raw memory substrates and the Consciousness Kernel through durable knowledge observations. **Status: EXPERIMENTAL** — Architecture designed, implementation in progress. This page describes the planned system. ## Overview The Consciousness Memory layer is the bridge between ArgentOS's raw memory substrates and the [Consciousness Kernel](/agents/consciousness-kernel). It introduces **Knowledge Observations** — durable synthesized claims derived from consolidating memory items, entities, reflections, and lessons into a governed truth layer. Today, ArgentOS has four adjacent but distinct memory substrates: | Substrate | Purpose | Location | | ------------------- | -------------------------------- | ------------------------- | | **Memory Items** | Raw durable facts | `memory_items` table | | **Reflections** | Interpreted periodic summaries | `reflections` table | | **Lessons** | Actionable compressions from SIS | `lessons` table | | **Entity Profiles** | Entity-level synthesized text | `entities.profileSummary` | What is missing is a first-class layer for "current believed truth" with explicit evidence links, contradiction tracking, revision chains, freshness semantics, and deterministic retrieval precedence. Without this, retrieval repeatedly infers truth from raw facts at answer time — expensive, noisy, and hard to audit. ```mermaid theme={null} flowchart LR MI["Memory Items"] --> OC["Observation Consolidator"] EN["Entities"] --> OC RE["Reflections"] --> OC LE["Lessons"] --> OC OC --> KO["Knowledge Observations"] KO --> EL["Evidence Links"] KO --> CA["Context Assembly"] CA --> CK["Consciousness Kernel"] ``` ## Knowledge Observations A Knowledge Observation is a durable synthesized claim that represents what the agent currently believes to be true. Unlike raw memory items (which capture moments), observations represent consolidated understanding. **Example observations:** * "User prefers PostgreSQL over MongoDB for ACID compliance" * "Project callscrub.io is in active development, targeting Q2 launch" * "The Telegram channel processes approximately 40 messages per day" * "User responds best to concise technical summaries, not verbose explanations" ### Observation Kinds Observations are strictly typed by kind, each with distinct retrieval ranking, freshness rules, and revalidation cadences: | Kind | Description | Example | | --------------------- | ----------------------------------------- | ---------------------------------------------------------- | | `operator_preference` | User preferences and working style | "User prefers free/open-source when quality is comparable" | | `project_state` | Current state of a project | "holace is in active development on Next.js 14" | | `world_fact` | External factual knowledge | "Claude Opus 4 was released May 2025" | | `self_model` | Agent's understanding of its own behavior | "Memory recall skews toward knowledge type" | | `relationship_fact` | Interpersonal or entity relationships | "Richard is Jason's business partner" | | `tooling_state` | State of tools and infrastructure | "Telegram bot uses webhook mode on port 443" | ### Subject Types Each observation is scoped to a subject: | Subject Type | Description | | ------------ | --------------------------------------- | | `entity` | A person, organization, or named entity | | `project` | A project or product | | `tool` | A tool, service, or integration | | `agent` | The agent itself or another agent | | `global` | System-wide or world-level facts | ### Observation Status | Status | Description | | ------------- | ---------------------------------------- | | `active` | Current believed truth | | `stale` | Evidence is aging, revalidation needed | | `superseded` | Replaced by a newer observation | | `invalidated` | Contradicting evidence outweighs support | ## Observation Evidence Every observation maintains explicit links to its source evidence. Evidence links connect observations back to the raw substrates they were derived from. ### Evidence Sources An evidence link can reference: * A `memory_item` (raw fact) * A `lesson` (SIS-derived actionable compression) * A `reflection` (periodic summary) * An `entity` (entity context) ### Evidence Stance Each evidence link carries a stance: | Stance | Description | | ------------ | --------------------------------------------------------- | | `support` | Evidence that supports the observation's claim | | `contradict` | Evidence that contradicts the observation's claim | | `context` | Contextual evidence that neither supports nor contradicts | ### Evidence Weight Each link carries a weight (default 1.0) indicating the relative strength of that piece of evidence. Operator-confirmed evidence receives a boost. ## The Consolidation Process Memory items, entities, reflections, and lessons feed into the consolidator. Sources are grouped by topic using canonical key matching. The consolidator generates synthesized claims from grouped evidence. For example, three memory items about "user prefers PostgreSQL" become a single observation with all three linked as supporting evidence. Each observation is connected to its source evidence with stance annotations. A single observation might have 5 supporting links, 1 contradicting link, and 2 context links. Observations receive deterministic canonical keys generated by code (not LLM output): ``` entity::operator_preference: project::project_state: tool::tooling_state: agent:self:self_model: global:world_fact: ``` A partial unique index ensures only one active observation per canonical key per agent: ```sql theme={null} UNIQUE (agent_id, canonical_key) WHERE status = 'active' ``` Each observation receives an anatomical confidence score (not a vibe score) composed of: | Component | Description | | ------------------------ | ------------------------------------------------ | | `sourceCount` | Number of evidence sources (diminishing returns) | | `sourceDiversity` | Variety of source types | | `supportWeight` | Total weight of supporting evidence | | `contradictionWeight` | Total weight of contradicting evidence | | `recencyWeight` | How recent the evidence is | | `operatorConfirmedBoost` | Boost from operator confirmation | The composite score is clamped to `[0, 1]` and stored alongside its components for full explainability. ## Freshness and Supersession ### Freshness vs Confidence Freshness and confidence answer different questions: * **Confidence**: "How well supported is this belief?" * **Freshness**: "How current is this belief?" An observation can be highly confident but stale (well-supported months ago, no recent evidence) or fresh but low-confidence (recently observed but only once). ### Revalidation Jobs Periodic freshness jobs check whether observations are still valid: 1. Scan observations where `revalidationDueAt` has passed 2. Check for new supporting or contradicting evidence since `lastSupportedAt` 3. Update freshness score based on evidence recency 4. Mark observations as `stale` if freshness drops below threshold 5. Mark as `invalidated` if contradicting evidence outweighs support ### Revalidation Cadence by Kind Different observation kinds have different default revalidation intervals: | Kind | Default Cadence | Rationale | | --------------------- | --------------- | ------------------------------------------ | | `operator_preference` | 30 days | Preferences change slowly | | `project_state` | 7 days | Projects evolve regularly | | `world_fact` | 90 days | External facts are relatively stable | | `self_model` | 14 days | Self-understanding evolves with experience | | `relationship_fact` | 60 days | Relationships are relatively stable | | `tooling_state` | 3 days | Tool configurations change frequently | ### Supersession When new evidence materially changes a belief, the consolidator creates a new observation and links it to the old one via `supersedes_observation_id`. The old observation is marked `superseded` but preserved for historical context. **Hard invariant**: Observations never cite other observations as evidence. The only permitted observation-to-observation relationship is supersession. ## Context Assembly Integration The retrieval router includes observations in the ranked merge alongside other retrieval sources: ```mermaid theme={null} flowchart TD KO["Knowledge Observations\n(high-confidence, active)"] --> CA["Context Assembly"] MI["Raw Memory Items\n(keyword + vector search)"] --> CA SIS["SIS Lessons\n(actionable patterns)"] --> CA RAG["Knowledge Library\n(RAG collections)"] --> CA EP["Entity Profiles\n(relationship context)"] --> CA CA --> RP["Ranked context window\nfor agent prompt"] ``` Active observations with high confidence are injected as high-priority context, reducing the need for the agent to re-derive truth from raw facts at query time. ## Runtime Use Observations are injected into agent prompts through the existing system prompt injection path (`src/agents/system-prompt.ts`). The injection includes: * The observation summary * Confidence level indicator * Last supported timestamp * Evidence count This gives the agent immediate access to consolidated knowledge without needing to perform retrieval and synthesis on every turn. ## Feedback Loop User feedback and reinforcement flow back to update observation confidence: 1. **Operator confirmation**: Thumbs up or explicit confirmation boosts observation confidence via `operatorConfirmedBoost` 2. **Contradiction**: User corrections create contradicting evidence, potentially triggering supersession 3. **Reinforcement**: Repeated user behavior that aligns with an observation increases its support weight 4. **Memory recall success**: When an observation-derived answer satisfies the user, the observation is reinforced ## Proposed Schema ### PostgreSQL Tables Two new tables in `src/data/pg/schema.ts`: | Column | Type | Description | | --------------------------- | ------------- | ----------------------------------- | | `id` | `text PK` | Unique observation ID | | `agent_id` | `text FK` | Owning agent | | `kind` | `text` | Observation kind | | `subject_type` | `text` | Subject type | | `subject_id` | `text` | Subject identifier | | `canonical_key` | `text` | Deterministic key | | `summary` | `text` | Synthesized claim | | `confidence` | `real` | Composite confidence score | | `confidence_components` | `jsonb` | Anatomical score breakdown | | `freshness` | `real` | Recency score | | `revalidation_due_at` | `timestamptz` | Next revalidation | | `status` | `text` | active/stale/superseded/invalidated | | `supersedes_observation_id` | `text FK` | Previous version | | `embedding` | `vector(768)` | For semantic search | | Column | Type | Description | | ---------------- | --------- | -------------------------- | | `id` | `text PK` | Unique evidence link ID | | `observation_id` | `text FK` | Parent observation | | `stance` | `text` | support/contradict/context | | `weight` | `real` | Evidence strength | | `item_id` | `text FK` | Reference to memory\_items | | `lesson_id` | `text FK` | Reference to lessons | | `reflection_id` | `text FK` | Reference to reflections | | `entity_id` | `text FK` | Reference to entities | ### Indexes * `(agent_id, kind, status)` — Kind-filtered queries * `(agent_id, canonical_key)` — Canonical key lookups * `(agent_id, revalidation_due_at)` — Revalidation job scans * `(agent_id, confidence DESC, freshness DESC)` — Ranked retrieval * HNSW on `embedding` — Semantic search * GIN FTS on `summary || detail || tags` — Full-text search * Partial unique: `UNIQUE (agent_id, canonical_key) WHERE status = 'active'` ## Hard Invariants These rules are non-negotiable: 1. Observations may only derive from `memory_items`, `lessons`, `reflections`, and entity context 2. Observations may **not** cite other observations as evidence 3. The only observation-to-observation link is `supersedes_observation_id` 4. Material truth changes create a new row — never rewrite prior truth in place 5. Contradiction evidence must be preserved 6. Raw evidence must always remain reachable through observation links 7. Canonical key generation must be deterministic and code-driven ## Key Files | File | Description | | ----------------------------------------------------------- | ------------------------------------------------------- | | `docs/argent/KNOWLEDGE_OBSERVATIONS_IMPLEMENTATION_SPEC.md` | Full implementation spec | | `docs/argent/CONSCIOUSNESS_KERNEL_THESIS.md` | Consciousness Kernel thesis | | `src/data/pg/schema.ts` | PostgreSQL schema (tables to be added) | | `src/data/adapter.ts` | StorageAdapter interface (MemoryAdapter to be extended) | | `src/data/pg-adapter.ts` | PG adapter (primary implementation target) | | `src/memory/memu-types.ts` | Memory types (new observation types to be added) | | `src/agents/system-prompt.ts` | Prompt injection path | | `src/infra/sis-runner.ts` | SIS consolidation (lesson synthesis path) | # Memory Health Runbook Source: https://docs.argentos.ai/memory/health-runbook Daily operator checks and incident triage for MemU, contemplation, SIS, and RAG. ## Daily 5-Minute Check ```bash theme={null} argent gateway status argent logs --follow --plain | rg --line-buffered "health: ok|ollama=|auth=" ``` ```bash theme={null} argent logs --follow --plain | rg --line-buffered "memu|Extraction complete|memu-extract|fallback episode stored" ``` ```bash theme={null} argent logs --follow --plain | rg --line-buffered "contemplation|sis:|consolidation returned no patterns|no parseable JSON" ``` ```bash theme={null} argent logs --follow --plain | rg --line-buffered "model-router|auth-failover|provider=ollama|selected profile" ``` ```bash theme={null} argent logs --follow --plain | rg --line-buffered "knowledge|library|ingest|collection|ACL|denied" ``` ## Escalate Incident If * No successful MemU extraction for 30+ minutes during active chat. * SIS parse failures persist for 3+ consolidation windows. ## Common Critical Signatures Check that Ollama is running and accessible. Verify MemU LLM provider configuration in `argent.json`. Verify the selected provider/model for the SIS path. Check that the model supports structured output. Validate JSON contract and fallback parser behavior. During active use, MemU should be extracting regularly. Check gateway logs for errors in the memory extraction pipeline. ## Compatibility Warnings (Usually Non-Blocking) These indicate compatibility mode, not immediate outage: * `Legacy dashboard SQLite modules are quarantined...` * `Using PostgreSQL compatibility mode for memory inspector.` # Identity Fields Source: https://docs.argentos.ai/memory/identity-fields Rich metadata in MemU — emotional context, entities, relationships, and personal attributes. ## Overview MemU memories are more than just text blobs. Each memory carries **identity fields** -- structured metadata that captures the emotional, relational, and contextual dimensions of information. This enables the agent to recall not just *what* happened, but *how it felt*, *who was involved*, and *why it mattered*. ## Entity Fields ### Entities A JSON array of people, places, organizations, and things referenced in the memory: ```json theme={null} { "entities": ["Jason", "Richard", "Dell R750", "Titanium Computing"] } ``` Entities are used in: * **Search boosting**: Queries mentioning an entity boost memories about that entity * **Relationship mapping**: Understanding who is connected to whom * **Context assembly**: When the agent is talking to a specific user, relevant entity memories are prioritized ### Relationships Memories can encode relationships between entities: ```json theme={null} { "content": "Jason and Richard are business partners at Titanium Computing", "entities": ["Jason", "Richard", "Titanium Computing"], "type": "relationship" } ``` ## Emotional Context The `emotional_context` field captures the emotional tone or significance of an interaction: ```json theme={null} { "content": "Jason was frustrated with the WhatsApp connection dropping repeatedly", "emotional_context": "frustrated, technical difficulty", "significance": 6 } ``` This helps the agent: * Recall how a user felt about something * Avoid repeating approaches that caused frustration * Show appropriate empathy in responses ## Memory Types The `type` field categorizes memories: | Type | Description | Example | | -------------- | ------------------------ | -------------------------------------------------------- | | `fact` | Objective information | "Jason has 30+ years IT experience" | | `preference` | User preferences | "Prefers open-source when quality is comparable" | | `event` | Something that happened | "Deployed the new dashboard on Feb 5" | | `relationship` | People connections | "Jason and Richard are business partners" | | `instruction` | How-to knowledge | "To rebuild native modules: pnpm rebuild better-sqlite3" | | `observation` | Agent's own observations | "User tends to work late on Thursdays" | ## Significance Interaction Identity fields interact with significance scoring. A memory with: * High emotional intensity -> higher significance * Multiple entities -> likely more important * Relationship type -> higher baseline significance The agent learns to calibrate significance based on these signals over time. ## Querying by Identity Memory recall can leverage identity fields for more targeted searches: ```json theme={null} { "tool": "memory_recall", "input": { "query": "Richard preferences", "entity": "Richard", "type": "preference" } } ``` ## Privacy Considerations Identity fields can contain sensitive personal information. All memory data is stored locally in `~/.argentos/memory.db` and never transmitted externally. The agent's memory is private to the installation. # Memory Overview Source: https://docs.argentos.ai/memory/index How ArgentOS remembers — MemU is the agent's persistent brain. ## Overview Memory is what separates a personal AI from a stateless chatbot. ArgentOS uses **MemU** (Memory Unit) as its persistent memory system -- a SQLite database with full-text search, significance scoring, and rich metadata that gives your agent long-term recall. Every important fact, preference, event, and relationship your agent learns is stored in MemU and can be recalled across sessions, channels, and time. ## Architecture ```mermaid theme={null} flowchart TD A["Chat + tasks + events"] --> B["MemU (lived experience)"] B --> C["Personal memory recall"] A --> L["LCM (DAG compression)"] L --> M["Compressed history + fresh tail"] D["Uploaded docs / library files"] --> E["RAG ingestion (chunk + embed + ACL)"] E --> F["Knowledge recall (library search)"] G["Contemplation episodes"] --> H["SIS lessons (patterns)"] C --> I["Runtime prompt context"] M --> I F --> I H --> I I --> J["Argent response"] ``` DAG-based context compression — every message stored permanently, searchable even after compaction. Never lose context mid-conversation. Persistent memory — facts, preferences, relationships recalled across sessions, channels, and time. Uploaded knowledge — what was studied. Chunk, embed, ACL-scoped search. Pattern consolidation — what was learned over time. ## How Memory Works ### Storing When the agent encounters important information, it uses the `memory_store` tool to save it: ```json theme={null} { "tool": "memory_store", "input": { "content": "Jason prefers open-source solutions when quality is comparable", "type": "preference", "significance": 8, "entities": ["Jason"] } } ``` Storage can be triggered by the agent automatically (when it recognizes important information) or by the user asking the agent to remember something. ### Recalling When the agent needs context, it uses `memory_recall` to search: ```json theme={null} { "tool": "memory_recall", "input": { "query": "Jason's software preferences" } } ``` MemU searches using FTS5 full-text search, ranks results by relevance and significance, and returns the most relevant memories. ### Bootstrap Injection At session start, ArgentOS also injects relevant memories directly into the system prompt. This gives the agent immediate context without needing to explicitly search. ## Memory Database MemU stores memories in a SQLite database at: ``` ~/.argentos/memory.db ``` The database uses FTS5 (Full-Text Search 5) for fast text search and supports semantic similarity via embeddings. ## Key Concepts | Concept | Description | | ------------------- | --------------------------------------------------------------------------- | | **Significance** | A 1-10 score indicating how important a memory is (higher = more important) | | **Entities** | People, places, and things referenced in the memory | | **Identity fields** | Emotional context, relationships, and personal attributes | | **Embeddings** | Vector representations for semantic similarity search | | **Auto-capture** | The agent automatically stores important information without being asked | ## Deep Dives DAG compression with full recall — grep, describe, expand Database schema, FTS5, embeddings How search and ranking work Rich metadata for nuanced recall MemU + RAG + SIS as one runtime system PostgreSQL and Redis migration architecture Automated deduplication of operational snapshots Experimental observation layer for consolidated knowledge Daily checks + incident triage Consolidation reliability and observability # Lossless Context Management (LCM) Source: https://docs.argentos.ai/memory/lcm DAG-based context compression that preserves every message with full recall via grep, describe, and expand tools. LCM is a DAG-based context compression engine that ships with ArgentOS Core. It replaces flat compaction with hierarchical summarization — every message is stored permanently in an immutable database, and agents can search and recall any past message even after compaction. ## Why LCM Exists Standard context management has a fundamental problem: when the context window fills up, old messages are summarized into a flat blob and the originals are discarded. The agent loses access to details discussed earlier in the conversation. LCM solves this by maintaining a **hierarchical summary DAG** (directed acyclic graph) alongside an **immutable message store**. Summaries compress the history for the model's context window, but the originals are always available for recall via agent tools. **LCM** keeps the agent coherent during long conversations via DAG compression with full recall. **MemU** provides persistent memory across months and years of interaction. ## How It Works ### Immutable Message Store Every user message, assistant response, and tool result is persisted verbatim in a SQLite database (`~/.argentos/lcm.db`). Messages are never modified or deleted. This is the ground truth that everything else builds on. ### The Summary DAG As the context window fills, LCM compresses older messages into a hierarchical tree of summaries: ```mermaid theme={null} flowchart TD D2["Condensed Summary (depth 2)"] --> D1A["Summary 1 (depth 1)"] D2 --> D1B["Summary 2 (depth 1)"] D1A --> L1["Leaf ~1200 tok"] D1A --> L2["Leaf ~1200 tok"] D1B --> L3["Leaf ~1200 tok"] D1B --> L4["Leaf ~1200 tok"] L1 --> M1["Raw messages (immutable)"] L2 --> M2["Raw messages (immutable)"] L3 --> M3["Raw messages (immutable)"] L4 --> M4["Raw messages (immutable)"] ``` * **Leaf summaries** (depth 0): Created from chunks of \~20,000 tokens of raw messages, compressed to \~1,200 tokens each * **Condensed summaries** (depth 1+): Created when 4+ same-depth summaries accumulate, merged into \~2,000 token nodes * **Fresh tail**: The 32 most recent messages are always kept raw (configurable) ### Context Assembly Each turn, the agent sees compressed history summaries followed by the fresh tail of recent raw messages. The summaries provide continuity while the fresh tail preserves full detail for the active conversation. ### Three-Level Escalation Compaction always converges, guaranteed: | Level | Strategy | Temperature | When | | ----------------- | ----------------------------------- | ----------- | ------------------------------------- | | **Normal** | Narrative summary, preserve details | 0.2 | Default | | **Aggressive** | Bullet points only, half tokens | 0.1 | Normal summary too large | | **Deterministic** | Mechanical truncation, no LLM | N/A | LLM fails or returns oversized output | ## Agent Tools LCM registers three tools that give agents recall capabilities over compacted history: Full-text search across the **entire** conversation history, including messages compacted out of context. Retrieve the full content of a specific message or summary node by ID. Expand a summary back to its original source messages by walking the DAG. **Example workflow**: Agent needs to recall something from hours ago that was compacted out: 1. Agent calls `aos_lcm_grep` with a search query 2. Gets ranked results with snippets and message IDs 3. Calls `aos_lcm_describe` to read the full message 4. Or calls `aos_lcm_expand_query` to expand a summary back to its originals ## Configuration LCM is enabled by default. Configuration is in `argent.json`: ```json theme={null} { "plugins": { "entries": { "aos-lcm": { "enabled": true, "config": { "freshTailCount": 32, "contextThreshold": 0.75, "summaryModel": "auto" } } } } } ``` ### Options | Option | Default | Description | | ------------------------- | -------------------- | ------------------------------------------------------- | | `enabled` | `true` | Enable LCM context management | | `freshTailCount` | `32` | Recent messages kept raw (not summarized) | | `contextThreshold` | `0.75` | Trigger compaction at this fraction of context window | | `summaryModel` | `"auto"` | Model for summarization. `"auto"` uses the model router | | `leafChunkTokens` | `20000` | Token target per leaf compaction chunk | | `leafTargetTokens` | `1200` | Token target for leaf summary output | | `condensedTargetTokens` | `2000` | Token target for condensed summaries | | `incrementalMaxDepth` | `-1` | Maximum DAG depth (-1 = unlimited) | | `largeFileTokenThreshold` | `25000` | Files above this are stored externally | | `databasePath` | `~/.argentos/lcm.db` | Custom database path | ### Disabling LCM ```json theme={null} { "plugins": { "entries": { "aos-lcm": { "enabled": false } } } } ``` ## Large File Handling Files over 25,000 tokens (configurable) are automatically stored externally with compact exploration summaries injected into context. The full content remains accessible via `aos_lcm_describe`. ## Database LCM uses its own standalone SQLite database at `~/.argentos/lcm.db`, separate from MemU's PostgreSQL. The database uses WAL mode for concurrent reads and includes FTS5 full-text indexes for fast grep searches. | Table | Purpose | | ------------------ | ----------------------------------------- | | `messages` | Immutable message store | | `messages_fts` | FTS5 full-text search index | | `summaries` | DAG summary nodes | | `summary_messages` | Leaf summary to source message links | | `summary_sources` | Condensed summary to source summary links | | `context_items` | Active context window state | | `large_files` | Externally stored large file metadata | ## Attribution LCM is adapted from the Lossless Context Management architecture by Clint Ehrlich and Theodore Blackman at Voltropy PBC. The original lossless-claw OpenClaw plugin is MIT licensed. The ArgentOS adaptation adds integration with the gateway, model router, plugin hook system, and agent tool registration. # MemU Architecture Source: https://docs.argentos.ai/memory/memu Inside MemU — PostgreSQL + pgvector, hybrid search, auto-capture, significance scoring, and embeddings. ## Overview MemU (Memory Unit) is ArgentOS's built-in persistent memory system. It supports two backends: * **PostgreSQL 17 + pgvector** (recommended) — concurrent access, shared knowledge, HNSW vector indexes, tsvector full-text search with GIN indexes * **SQLite** (fallback) — single-process, local-only, FTS5 full-text search, stored at `~/.argentos/memory.db` The installer sets up PostgreSQL by default. SQLite is available as a zero-dependency fallback for simpler setups. ## Database Schema The core memory table contains: | Column | Type | Description | | ------------------- | ------- | ------------------------------------------------------ | | `id` | INTEGER | Primary key | | `content` | TEXT | The memory content | | `type` | TEXT | Category (fact, preference, event, relationship, etc.) | | `significance` | INTEGER | Importance score (1-10) | | `entities` | TEXT | JSON array of referenced entities | | `emotional_context` | TEXT | Emotional tone or context | | `source` | TEXT | Where this memory came from | | `created_at` | TEXT | Timestamp of creation | | `updated_at` | TEXT | Last update timestamp | | `embedding` | BLOB | Vector embedding for semantic search | ## Full-Text Search MemU uses different full-text search engines depending on the backend: **PostgreSQL** (default): `tsvector` with GIN indexes — supports ranked search, stemming, language-aware tokenization, and phrase matching. **SQLite** (fallback): FTS5 extension — boolean queries, phrase matching, prefix matching. Both backends support: * **Boolean queries**: `preference AND open-source` * **Phrase matching**: `"infrastructure specs"` * **Prefix matching**: `config*` * **OR queries**: `telegram OR discord` ### Search Tips * Single keywords work best for broad recall * Use OR for multi-word queries to improve recall * Strip common stop words for better results * PostgreSQL handles stemming and language-aware tokenization automatically ## Significance Scoring Every memory has a significance score from 1-10: | Score | Level | Example | | ----- | --------- | -------------------------------------------- | | 1-2 | Low | Passing observations | | 3-4 | Medium | Useful context | | 5-6 | High | Important facts and preferences | | 7-8 | Very High | Key personal information, critical decisions | | 9-10 | Critical | Core identity, security-sensitive data | Higher significance memories are prioritized in search results and bootstrap injection. ## Auto-Capture The agent is trained to automatically store important information without being explicitly asked. When it detects a new fact, preference, event, or relationship in conversation, it calls `memory_store` proactively. ## Embeddings MemU supports vector embeddings for semantic similarity search. Embeddings are generated when memories are stored and used alongside full-text search for hybrid ranking. **PostgreSQL**: pgvector with HNSW indexes for fast approximate nearest neighbor search. **SQLite**: sqlite-vec extension for local vector search. ``` Final Score = text_relevance * weight + embedding_similarity * weight + significance_boost ``` ## Storage **PostgreSQL** (default): ``` postgres://localhost:5433/argentos # Database with pgvector extension Redis on port 6380 # Agent state, presence, pub/sub ``` **SQLite** (fallback): ``` ~/.argentos/memory.db # Main database ~/.argentos/memory.db-wal # Write-ahead log ~/.argentos/memory.db-shm # Shared memory ``` The database is accessed via `getMemuStore()` in `src/memory/memu-store.ts`. # PG+Redis Architecture Source: https://docs.argentos.ai/memory/pg-redis PostgreSQL and Redis migration architecture — three-phase cutover, StorageAdapter interface, schema design, and configuration. ## Overview ArgentOS is migrating from SQLite to PostgreSQL 17 + Redis for its storage backend. The migration enables concurrent multi-agent access, shared knowledge across agents, and inter-agent communication via Redis Streams and pub/sub. The migration follows a three-phase zero-downtime strategy using a StorageAdapter abstraction that routes reads and writes to the correct backend based on configuration. ```mermaid theme={null} flowchart TD App["Application Code"] --> SA["StorageAdapter Interface"] SA --> SQLite["SQLiteAdapter"] SA --> Dual["DualAdapter"] SA --> PG["PgAdapter"] Dual --> SQLiteDB["SQLite"] Dual --> PGDB["PostgreSQL 17"] Redis["Redis"] --> State["Agent state, presence, Streams, pub/sub"] ``` ## Why PG+Redis | Problem | SQLite Limitation | PG+Redis Solution | | ------------------------- | ------------------------------ | ------------------------------------------ | | Multi-agent access | Single-writer lock | Connection pool with concurrent writes | | Shared knowledge | Per-agent databases | Shared tables with agent\_id scoping + RLS | | Inter-agent communication | No built-in mechanism | Redis Streams + pub/sub | | Vector search at scale | sqlite-vec extension (limited) | pgvector with HNSW indexes | | Full-text search | FTS5 (good but single-process) | tsvector with GIN indexes | | Hot state for dashboard | File polling | Redis key/value with pub/sub | ## Three-Phase Migration Both databases receive all writes. SQLite serves reads. This validates PG write path without risk. ```json theme={null} { "storage": { "backend": "dual", "readFrom": "sqlite", "writeTo": ["sqlite", "postgres"] } } ``` Flip `readFrom` to `"postgres"`. SQLite still receives writes as a safety net. Verify PG serves all reads correctly. ```json theme={null} { "storage": { "backend": "dual", "readFrom": "postgres", "writeTo": ["sqlite", "postgres"] } } ``` SQLite becomes historical backup. All reads and writes go through PostgreSQL. ```json theme={null} { "storage": { "backend": "postgres" } } ``` ## StorageAdapter Interface The `StorageAdapter` interface in `src/data/adapter.ts` defines the unified API that all backend implementations conform to: ```typescript theme={null} interface StorageAdapter { memory: MemoryAdapter; // Memory CRUD, search, embeddings tasks: TaskAdapter; // Task CRUD, FTS, dependencies teams: TeamAdapter; // Team management isReady(): boolean; // Health check close(): Promise; // Cleanup } ``` ### MemoryAdapter Covers all memory operations: * `createItem()` / `getItem()` / `deleteItem()` — CRUD * `searchItems()` — Hybrid keyword + vector search * `createEntity()` / `getEntity()` — Entity management * `createReflection()` / `createLesson()` — SIS substrates * `embedItem()` — Embedding storage * `getStats()` — Storage statistics ### TaskAdapter Full task lifecycle: * `createTask()` / `updateTask()` / `deleteTask()` — CRUD * `listTasks()` / `searchTasks()` — Listing and FTS * `getTasksByProject()` — Project grouping * Dependencies and priority ordering ### TeamAdapter Team and member management for multi-agent workflows. ## Adapter Implementations Wraps the existing `MemuStore` and `DataAPI` modules. This is the battle-tested default backend that has served ArgentOS since day one. **Source**: `src/data/sqlite-adapter.ts` PostgreSQL implementation using Drizzle ORM. 1,362 lines of code covering all adapter operations with: * Connection pooling via `postgres.js` * pgvector for embedding storage and HNSW search * tsvector for full-text search * JSONB for flexible metadata * Row-level security (RLS) for agent isolation **Source**: `src/data/pg-adapter.ts` Orchestrates dual-write mode (618 LOC): * Routes writes to both SQLite and PostgreSQL * Routes reads to the configured `readFrom` backend * Handles errors gracefully (PG write failures don't block SQLite) * Logs discrepancies for investigation **Source**: `src/data/dual-adapter.ts` ## Storage Factory `src/data/storage-factory.ts` creates the correct adapter based on configuration: ```typescript theme={null} const adapter = await getStorageAdapter(); // Returns SQLiteAdapter, DualAdapter, or PgAdapter // based on storage.backend in argent.json ``` The factory is a singleton — subsequent calls return the same adapter instance. ## PostgreSQL Schema The PostgreSQL schema is defined in `src/data/pg/schema.ts` using Drizzle ORM. It contains 20 tables: ### Core Tables | Table | Description | | ----------------- | ----------------------------------- | | `agents` | Agent registry (multi-agent family) | | `memory_items` | Durable memory facts | | `entities` | Named entities with profiles | | `reflections` | Periodic summaries | | `lessons` | SIS-derived actionable patterns | | `resources` | Resource metadata | | `categories` | Memory categories | | `item_categories` | Item-category junction | ### Knowledge Tables | Table | Description | | ----------------------------- | ---------------------- | | `knowledge_collections` | Named document buckets | | `knowledge_collection_grants` | Per-agent ACL grants | ### Task Tables | Table | Description | | -------------- | ---------------------------------- | | `tasks` | Task records with status, priority | | `teams` | Team definitions | | `team_members` | Team membership | ### Infrastructure Tables | Table | Description | | ----------------- | ------------------------------- | | `service_keys` | Encrypted credential storage | | `observations` | Session event capture (Memo) | | `model_feedback` | Model performance tracking | | `live_candidates` | Memory deduplication candidates | ### Indexes **pgvector HNSW** indexes for approximate nearest-neighbor embedding search: ```sql theme={null} CREATE INDEX idx_memory_items_embedding_hnsw ON memory_items USING hnsw (embedding vector_cosine_ops) WITH (m = 16, ef_construction = 200); ``` **tsvector GIN** indexes for full-text search: ```sql theme={null} CREATE INDEX idx_memory_items_fts ON memory_items USING gin (to_tsvector('english', summary)); ``` ### Row-Level Security (RLS) RLS policies isolate agent data in shared tables: ```sql theme={null} ALTER TABLE memory_items ENABLE ROW LEVEL SECURITY; CREATE POLICY agent_isolation ON memory_items USING (agent_id = current_setting('app.agent_id')); ``` The PG adapter sets the `app.agent_id` session variable on each connection from the pool, ensuring agents can only access their own data unless explicitly granted cross-agent access. ## Redis Usage Redis (port 6380) provides hot-path state and inter-agent communication: | Feature | Redis Structure | Purpose | | --------------- | --------------- | -------------------------------------- | | Agent state | Key/value | Dashboard displays current agent state | | Presence | Key with TTL | Track which agents are online | | Pub/sub | Channels | Real-time event broadcasting | | Streams | Consumer groups | Inter-agent message queues | | Heartbeat locks | Keys with TTL | Prevent duplicate heartbeat runs | ### Connection ```typescript theme={null} import { getRedisClient } from "./data/redis-client.ts"; const redis = getRedisClient(); await redis.set("agent:main:state", JSON.stringify(state)); ``` ## PG Write Mirror The `pg-write-mirror.ts` module intercepts writes to the existing `MemuStore` (SQLite) and mirrors them to PostgreSQL. This enables gradual migration without changing all callers at once: ```typescript theme={null} import { enablePgWriteMirror } from "./data/pg-write-mirror.ts"; // Call at gateway startup to begin mirroring await enablePgWriteMirror(); ``` ## Configuration Full storage configuration in `~/.argentos/argent.json`: ```json theme={null} { "storage": { "backend": "sqlite", "readFrom": "sqlite", "writeTo": ["sqlite"], "postgres": { "connectionString": "postgres://localhost:5433/argentos", "maxConnections": 10 }, "redis": { "host": "localhost", "port": 6380, "db": 0 } } } ``` ### Non-Default Ports ArgentOS uses non-standard ports to avoid conflicts with other services: | Service | ArgentOS Port | Default Port | | ---------- | ------------- | ------------ | | PostgreSQL | **5433** | 5432 | | Redis | **6380** | 6379 | ### Setup Scripts ```bash theme={null} # Install and configure PostgreSQL 17 with pgvector bash scripts/setup-postgres.sh # Install and configure Redis with LaunchAgent bash scripts/setup-redis.sh # Validate SQLite/PG row count parity before cutover node --import tsx scripts/storage-cutover-readiness.ts ``` ## PG-Only Features Some features have no SQLite equivalent and require PostgreSQL: * Knowledge collections and collection grants (ACL) * Shared knowledge library (cross-agent) * Agent registry (multi-agent family) * Service keys and auth credentials (encrypted) * Session tracking and observations ## What Is Already Routed Through StorageAdapter The following operations work with all three backends: * All memory operations (create, search, embed, delete) * Task CRUD and full-text search * Team management * Knowledge ingestion, search, and ACL * Family workflow and multi-agent task migration ## Key Files | File | LOC | Description | | ----------------------------- | ----- | --------------------------------------- | | `src/data/adapter.ts` | — | StorageAdapter interface definition | | `src/data/sqlite-adapter.ts` | — | SQLite implementation (wraps MemuStore) | | `src/data/pg-adapter.ts` | 1,362 | PostgreSQL implementation (Drizzle ORM) | | `src/data/dual-adapter.ts` | 618 | Dual-write orchestrator | | `src/data/storage-factory.ts` | — | Config-driven adapter creation | | `src/data/storage-config.ts` | — | Feature flags and port constants | | `src/data/pg-write-mirror.ts` | — | MemuStore write interception | | `src/data/pg-client.ts` | — | postgres.js connection pool | | `src/data/redis-client.ts` | — | ioredis connection | | `src/data/pg/schema.ts` | — | Drizzle ORM schema (20 tables) | | `src/data/pg/migrations/` | — | SQL migration files | | `scripts/setup-postgres.sh` | — | PG17 + pgvector install | | `scripts/setup-redis.sh` | — | Redis install + LaunchAgent | # Memory Profile Collapse Source: https://docs.argentos.ai/memory/profile-collapse Automated deduplication of operational profile snapshots in the MemU memory system. ## Overview Profile Collapse is a memory hygiene system that automatically detects and merges duplicate operational profile snapshots in MemU. As the agent operates, heartbeat cycles, status checks, and system monitoring generate many `profile`-type memory items that contain ephemeral operational data — metrics, counts, timestamps, uptime reports. These accumulate rapidly and pollute memory recall with near-identical entries. Profile Collapse identifies these duplicates through a three-phase grouping strategy (exact match, token match, fuzzy match) and merges them into canonical entries, transferring reinforcement counts to preserve signal strength. ```mermaid theme={null} flowchart LR A["All Profile Items"] --> B["Operational Filter"] B --> C["Signature Generation"] C --> D["Phase 1: Exact Match"] C --> E["Phase 2: Token Match"] C --> F["Phase 3: Fuzzy Match"] D --> G["Pick Canonical"] E --> G F --> G G --> H["Delete Duplicates + Transfer Reinforcement"] ``` ## What Gets Collapsed Not all profile items are candidates for collapse. The system targets **operational profile snapshots** — items whose summaries contain operational keywords combined with numeric or datetime tokens. ### Operational Detection A profile item is classified as operational if its summary matches both: 1. **Operational keywords**: status, snapshot, health, metric, count, queue, uptime, latency, ticket, alert, cron, heartbeat, service, gateway, dashboard, api, provider, model 2. **Ephemeral tokens**: numeric values (`42`, `99.5%`) or datetime stamps (`2026-03-15`) * "Gateway health: 3 agents connected, latency 45ms, uptime 99.2%" * "Heartbeat status 2026-03-15: 12 tasks verified, 2 failed, score 85" * "Discord channel metrics: 47 messages today, 3 alerts pending" * "User prefers dark mode for all dashboards" * "Project callscrub.io uses Next.js 14 with Prisma" ## Three-Phase Grouping ### Phase 1: Exact Signature Match The system normalizes operational summaries into signatures by replacing ephemeral tokens with placeholders: | Token Type | Replacement | Example | | --------------------- | ------------ | ------------------------------------------- | | Dates/timestamps | `` | `2026-03-15T14:30:00Z` becomes `` | | UUIDs and hex strings | `` | `a8f2b3c4-...` becomes `` | | Request/run IDs | `` | `run-abc123` becomes `` | | Numbers | `` | `42`, `99.5%` become `` | Two items with identical signatures after normalization are exact duplicates. Example: ``` Original: "Gateway health: 3 agents, latency 45ms, 2026-03-15" Signature: "gateway health agent latency ms " Original: "Gateway health: 5 agents, latency 30ms, 2026-03-16" Signature: "gateway health agent latency ms " → Same signature → exact duplicate group ``` ### Phase 2: Token Key Match Items not caught by exact matching are further grouped using semantic token keys. The system: 1. Generates the normalized signature 2. Strips stopwords (`the`, `is`, `are`, `was`, `this`, `that`, etc.) 3. Strips placeholder tokens (``, ``, ``) 4. Applies basic stemming (plural stripping: `services` becomes `service`) 5. Sorts remaining tokens alphabetically 6. Joins as a token key Items with identical token keys (and at least 3 semantic tokens) are token duplicates. ### Phase 3: Fuzzy Match (Optional) When enabled, items not caught by exact or token matching are clustered using Jaccard similarity on their semantic token sets: * **Similarity threshold**: 0.78 (78% token overlap) * **Minimum intersection**: 4 shared tokens * **Clustering**: Greedy nearest-cluster assignment, sorted by creation time Fuzzy matching catches paraphrased duplicates where the same operational data is described with slightly different wording. ## Canonical Selection When a group of duplicates is found, one item is selected as the canonical (keeper) entry. Selection priority: 1. **Highest significance** — `core` > `important` > `noteworthy` > `routine` 2. **Highest reinforcement count** — more reinforced = more important 3. **Oldest creation date** — preserve the first observation 4. **Lexicographic ID** — deterministic tiebreaker The canonical item survives; all other items in the group are deleted. ## Reinforcement Transfer When duplicates are removed, their reinforcement counts are transferred to the canonical item. Each deleted duplicate contributes at least 1 reinforcement (or its actual count if higher). This preserves the signal that the observation was seen multiple times. ``` Group: 5 items (1 canonical + 4 duplicates) - Canonical: reinforcement_count = 2 - Duplicate A: reinforcement_count = 3 - Duplicate B: reinforcement_count = 1 - Duplicate C: reinforcement_count = 1 - Duplicate D: reinforcement_count = 0 (counts as 1) After collapse: - Canonical: reinforcement_count = 2 + 3 + 1 + 1 + 1 = 8 - Duplicates A-D: deleted ``` ## Running Profile Collapse By default, collapse runs in dry-run mode — it reports what would happen without deleting anything: ```typescript theme={null} import { collapseOperationalProfileSnapshots } from "./memory/hygiene/profile-collapse.ts"; const report = collapseOperationalProfileSnapshots(store, { dryRun: true }); console.log(report); // { // dryRun: true, // scannedProfiles: 1200, // operationalProfiles: 340, // duplicateGroups: 45, // duplicatesFound: 180, // samples: [...] // } ``` ```typescript theme={null} const report = collapseOperationalProfileSnapshots(store, { dryRun: false }); // report.duplicatesRemoved = 180 // report.reinforcementsApplied = 220 ``` ### Options | Option | Type | Default | Description | | ----------------- | --------- | ------- | ----------------------------------- | | `dryRun` | `boolean` | `true` | Report only, no deletions | | `enableFuzzy` | `boolean` | `false` | Enable Phase 3 fuzzy matching | | `maxSampleGroups` | `number` | `20` | Max sample groups in report | | `batchSize` | `number` | `500` | Pagination size for profile listing | ## Collapse Report The function returns a detailed report: ```typescript theme={null} interface ProfileCollapseReport { dryRun: boolean; scannedProfiles: number; // Total profile items scanned operationalProfiles: number; // Items matching operational pattern uniqueSignatures: number; // Distinct signatures found duplicateGroups: number; // Groups with 2+ members duplicatesFound: number; // Total items to remove groupsCollapsed: number; // Groups actually collapsed (live run) duplicatesRemoved: number; // Items actually deleted (live run) reinforcementsApplied: number; // Total reinforcements transferred exactDuplicateGroups: number; // Phase 1 groups tokenDuplicateGroups: number; // Phase 2 groups fuzzyDuplicateGroups: number; // Phase 3 groups samples: ProfileCollapseGroupSample[]; // Example groups for review } ``` ## Foreign Key Safety When deleting duplicate items, the system handles foreign key constraints gracefully. If a delete fails due to FK constraints (junction tables like `item_categories`, `category_items`, `item_entities`), it cleans up the junction rows first and retries the deletion. ## Integration Points Profile collapse can be triggered: 1. **Manually** via the memory hygiene tool 2. **Periodically** as part of scheduled memory maintenance 3. **On demand** when memory item counts exceed thresholds ## Key Files | File | LOC | Description | | ---------------------------------------- | --- | ---------------------------------------------------------- | | `src/memory/hygiene/profile-collapse.ts` | 469 | Core collapse implementation | | `src/memory/memu-store.ts` | — | MemuStore (provides item listing, deletion, reinforcement) | | `src/memory/memu-types.ts` | — | MemoryItem and Significance types | # Semantic Search Source: https://docs.argentos.ai/memory/semantic-search How MemU searches memories using FTS5 queries, embedding similarity, and reranking. ## Overview When the agent calls `memory_recall`, MemU performs a multi-stage search that combines full-text matching with semantic similarity to find the most relevant memories. ## Search Pipeline ```mermaid theme={null} flowchart LR A["Query"] --> B["FTS5 Search"] B --> C["Embedding Similarity"] C --> D["Score Fusion"] D --> E["Rerank"] E --> F["Results"] ``` ### Stage 1: FTS5 Full-Text Search The query is run against the FTS5 index. This finds memories that contain matching terms: ```sql theme={null} SELECT * FROM memory_fts WHERE memory_fts MATCH 'infrastructure specs' ORDER BY rank LIMIT 50 ``` FTS5 provides a relevance rank based on term frequency, position, and document length. ### Stage 2: Embedding Similarity The query is embedded into a vector and compared against stored memory embeddings using cosine similarity: ``` similarity = dot(query_embedding, memory_embedding) / (|query_embedding| * |memory_embedding|) ``` This catches semantically related memories that may not share exact words with the query. For example, "computer setup" would match a memory about "infrastructure specs." ### Stage 3: Score Fusion FTS5 scores and embedding similarity scores are combined: ``` final_score = (fts5_score * fts5_weight) + (similarity² * embedding_weight) + significance_boost ``` Key details: * Similarity is squared (`sim²`) to amplify strong matches and suppress weak ones * Significance adds a boost based on the memory's importance score * Memory recall queries get a +0.25 score boost for model routing (ensures at least Haiku tier) ### Stage 4: Reranking Results are reranked with additional signals: * **Recency**: More recent memories get a slight boost * **Reinforcement**: Memories that have been recalled frequently (log2 reinforcement) rank higher * **Entity matching**: Memories mentioning entities in the query get a boost If the reranker encounters errors, it falls back safely to the fusion score ordering. ## Query Optimization ### Best Practices ``` Good: "Jason infrastructure" # Specific keywords Good: "telegram OR discord setup" # OR for alternatives Good: "meeting notes February" # Scoped by time context Bad: "what did we talk about" # Too vague Bad: "the thing from yesterday" # No searchable terms ``` ### FTS5 Syntax | Syntax | Example | Meaning | | ---------------- | --------------------- | ---------------------- | | `word` | `infrastructure` | Match this term | | `word1 word2` | `Jason preferences` | Match both terms (AND) | | `word1 OR word2` | `telegram OR discord` | Match either term | | `"phrase"` | `"model router"` | Match exact phrase | | `word*` | `config*` | Prefix match | ## Result Format Search results are returned to the agent as a structured list: ```json theme={null} [ { "id": 42, "content": "Jason runs 2x NVIDIA DGX Spark with 256GB unified memory", "significance": 8, "score": 0.92, "created_at": "2026-01-15T10:30:00Z" } ] ``` # SIS Reliability Source: https://docs.argentos.ai/memory/sis-reliability How SIS consolidation works, fails, and should be monitored. ## What SIS Does SIS consolidates contemplation/session episodes into lessons that influence future prompts. ```mermaid theme={null} flowchart LR A["Episodes"] --> B["SIS consolidation"] B --> C["Lessons"] C --> D["Prompt injection"] D --> E["Improved future responses"] ``` ## Failure Modes **Symptoms:** * `sis: no parseable JSON in response` * `consolidation returned no patterns` **Impact:** Lessons stop updating. **Operator response:** 1. Verify selected provider/model for SIS path. 2. Verify latest output is current issue (not stale historical log). 3. Validate JSON contract and fallback parser behavior. **Symptoms:** Many episodes but no new lessons. **Impact:** Weak adaptation over time. **Operator response:** 1. Check thresholds (`episodesPerConsolidation`, lesson confidence). 2. Verify contemplation episodes contain structured content. ## Reliability Targets | Metric | Target | | --------------------------- | ------------------- | | Parse success rate | >= 95% | | Consolidation cycle success | >= 99% | | Fresh lesson update | At expected cadence | ## Required Observability Expose these in health UI: 1. Last successful consolidation time 2. Parse failures in last 24h 3. Lessons created in last 24h 4. Last lesson injected time # Auth Profiles Source: https://docs.argentos.ai/models/auth-profiles Manage multiple API keys and subscriptions with automatic failover. ## Overview Auth profiles let you configure multiple API keys, subscriptions, and provider accounts. ArgentOS automatically rotates between profiles when one hits rate limits or quota caps, ensuring your agent stays online. ## How Auth Profiles Work Each profile is a named entry with a provider, authentication credentials, and optional metadata: ```json theme={null} { "anthropic:titanium": { "provider": "anthropic", "type": "setup-token", "token": "sk-ant-oat01-...", "label": "Titanium Computing Max Sub" }, "anthropic:webdevtoday": { "provider": "anthropic", "type": "setup-token", "token": "sk-ant-oat01-...", "label": "WebDevToday Max Sub" }, "minimax:coding-plan": { "provider": "minimax", "type": "api-key", "token": "sk-cp-...", "label": "MiniMax Coding Plan" } } ``` ## Profile Location ``` ~/.argentos/agents/main/agent/auth-profiles.json ``` ## Auth Types Generated from Anthropic Max subscriptions via `claude setup-token`. These bill against the subscription's weekly quota. ```bash theme={null} claude setup-token # Generates: sk-ant-oat01-... ``` Standard per-token API keys. These bill per token used and support prompt caching. ``` sk-ant-api03-... ``` Each provider has its own key format: * **MiniMax**: `sk-cp-...` (Coding Plan keys) * **Z.AI**: Provider-specific API key * **OpenRouter**: `sk-or-...` ## Auth Resolution Priority When the agent makes an API call: 1. **Auth profiles** are checked first (setup tokens from Max subscriptions) 2. **Environment variables** are the fallback (`ANTHROPIC_API_KEY`, etc.) Auth profiles take precedence over any API keys set in your environment. ## Adding Profiles ```bash theme={null} argent setup ``` The setup wizard walks through adding new profiles. Edit `auth-profiles.json` directly and add a new entry following the format above. ## Rotation and Cooldown When a profile hits a rate limit or quota cap: The profile enters a **cooldown period** (exponential backoff). The next profile for the same provider is tried. If all profiles for a provider are in cooldown, the model router tries alternative providers. See [Failover](/models/failover) for details on the rotation algorithm. ## Security * Auth profiles are stored locally and never transmitted * Tokens are written to a file readable only by the current user * Do not commit `auth-profiles.json` to version control # Model Failover Source: https://docs.argentos.ai/models/failover Automatic failover with exponential backoff, cooldowns, and profile rotation. ## Overview ArgentOS is designed to stay online even when individual API providers or accounts hit limits. The failover system automatically rotates between auth profiles and providers, using exponential backoff to avoid hammering rate-limited services. ## Failover Chain When an API call fails, ArgentOS follows this chain: ```mermaid theme={null} flowchart LR A["Primary Profile"] --> B["Next Profile\n(same provider)"] B --> C["Alternative Provider"] C --> D["Error"] ``` ### Example Call to `anthropic:titanium` fails (429 rate limit). `anthropic:titanium` enters cooldown. Retry with `anthropic:webdevtoday`. If that also fails, try `anthropic:semfreak`. If all Anthropic profiles are in cooldown, try MiniMax or Z.AI (if configured for the current tier). If no providers are available, return an error to the user. ## Exponential Backoff When a profile hits a rate limit, it enters an exponential backoff cooldown: | Failure Count | Cooldown Duration | | ------------- | ----------------- | | 1st | 30 seconds | | 2nd | 1 minute | | 3rd | 2 minutes | | 4th | 4 minutes | | 5th+ | 8 minutes (max) | The cooldown resets after a successful call from the profile. ## Cooldown Management ### Viewing Cooldown Status ```bash theme={null} argent status ``` The status command shows which profiles are active, which are in cooldown, and when they will be available again. ### Manual Reset ```bash theme={null} argent model reset-cooldowns ``` Clears all cooldown timers, making all profiles immediately available. ## Error Types Different errors trigger different behaviors: | Error | Action | | ---------------- | ------------------------------------------------- | | 429 Rate Limit | Cooldown + rotate to next profile | | 529 Overloaded | Cooldown + rotate to next profile | | 401 Unauthorized | Disable profile (requires manual fix) | | Network error | Short cooldown + retry | | Context overflow | Skip auth profile rotation (not a provider issue) | | 500 Server Error | Short cooldown + retry once | Context overflow errors specifically do **not** trigger profile rotation since the issue is with the request, not the provider. ## Provider-Specific Notes Max subscriptions have weekly quotas that reset on a rolling basis. When one account's quota is exhausted, failover to another subscription keeps the agent running. MiniMax cannot accept tool call history with Anthropic-format IDs. Failover to MiniMax only works for: * Fresh sessions with no tool history * Non-tool conversations The model router accounts for this and avoids routing mid-session tool conversations to MiniMax. Local models via Ollama have no rate limits or costs but are limited in capability. The LOCAL tier is always available as an ultimate fallback for simple queries. # Model System Overview Source: https://docs.argentos.ai/models/index How ArgentOS routes tasks to the right model tier for optimal cost and performance. ## Overview ArgentOS uses a **model router** to automatically select the best model for each task. Simple queries go to fast, cheap models. Complex reasoning goes to powerful, expensive ones. This saves money without sacrificing quality. ## The Tier System | Tier | Score Range | Default Model | Cost | Use Case | | ------------ | ----------- | ------------------------ | ------ | ---------------------------------------- | | **LOCAL** | \< 0.3 | Qwen3 30B-A3B via Ollama | Free | Simple lookups, quick replies | | **FAST** | 0.3 - 0.5 | Claude Haiku | Low | Straightforward questions, memory recall | | **BALANCED** | 0.5 - 0.8 | Claude Sonnet | Medium | Most conversations, tool use | | **POWERFUL** | > 0.8 | Claude Opus | High | Complex reasoning, multi-step planning | The model router scores each incoming message on a 0-1 complexity scale and routes it to the corresponding tier. ## Key Features No manual model selection needed. The router scores complexity and picks the right tier. Simple tasks use cheap models, saving budget for complex work. Mix local models, Anthropic, MiniMax, Z.AI, and OpenRouter. Automatic fallback when a provider is unavailable. ## Dashboard Integration The dashboard shows a **model badge** on each message indicating which tier was used: | Color | Tier | Cost | | ------ | -------- | ------ | | Green | LOCAL | Free | | Yellow | FAST | \$ | | Blue | BALANCED | \$\$ | | Purple | POWERFUL | \$\$\$ | ## Deep Dives How complexity scoring and tier routing work Supported model providers and configuration Dynamic catalog of 15+ providers and 60+ models Managing multiple API keys and subscriptions How automatic failover and cooldown work # Provider Registry Source: https://docs.argentos.ai/models/provider-registry Dynamic model provider catalog with 15+ providers, persistent customization, and automatic seed updates for ArgentOS's multi-provider LLM infrastructure. ## Overview The Provider Registry is ArgentOS's dynamic catalog of LLM providers and their available models. It tracks API endpoints, authentication methods, model capabilities, pricing, and context windows for every provider the system can route to. The registry ships with seed data covering 11+ providers and 60+ models. Operators can customize entries, add new providers, and adjust model configurations. User edits are preserved across seed updates through a merge strategy that adds new seed entries without overwriting existing customizations. ## How It Works ```mermaid theme={null} flowchart LR Seed["Seed Data\n(provider-registry-seed.ts)"] --> File["Registry File\n(~/.argentos/provider-registry.json)"] File --> Runtime["Runtime Registry\n(merged result)"] ``` 1. On first run, the seed data is written to `~/.argentos/provider-registry.json`. 2. On subsequent runs, the file is read and its version compared against the seed version. 3. If the file version is older, a merge is performed: new seed entries are added, existing user entries are preserved. 4. If the file version is equal or newer, it is returned as-is. ## Seed Providers The current seed (version 7) includes these providers: | Provider | API Format | Auth | Notable Models | | ------------------ | ------------------ | ------- | ------------------------------------------------ | | **MiniMax** | Anthropic Messages | API Key | M2.5, M2.1, VL-01, M2-her | | **MiniMax Portal** | Anthropic Messages | OAuth | M2.1 | | **Xiaomi** | Anthropic Messages | API Key | MiMo V2 Flash | | **Moonshot** | OpenAI Completions | API Key | Kimi K2.5 | | **Qwen Portal** | OpenAI Completions | OAuth | Qwen Coder, Qwen Vision | | **Inception** | OpenAI Completions | API Key | Mercury 2 | | **Ollama** | OpenAI Completions | API Key | Dynamic (local models) | | **LM Studio** | OpenAI Completions | None | Dynamic (local models) | | **Groq** | OpenAI Completions | API Key | Llama 3.3, Qwen3 32B, GPT OSS | | **Synthetic (HF)** | Anthropic Messages | API Key | DeepSeek, GLM-4.7, Kimi K2, Qwen3 | | **Venice** | OpenAI Completions | API Key | 20+ models including proxied Claude, GPT, Gemini | ### API Formats Providers use one of two API formats: Anthropic Messages API format. Used by MiniMax, Synthetic, Xiaomi. OpenAI Chat Completions API format. Used by Groq, Venice, Ollama, etc. ArgentOS normalizes between these formats internally, so the model router can seamlessly fall back across providers regardless of their native API format. ### Dynamic Providers Some providers support dynamic model discovery: ```typescript theme={null} const ollama: ProviderRegistryEntry = { name: "Ollama", baseUrl: "http://127.0.0.1:11434/v1", api: "openai-completions", dynamic: true, discoveryUrl: "http://127.0.0.1:11434/api/tags", models: [] // Populated at runtime from discovery }; ``` When `dynamic: true`, the system queries the `discoveryUrl` to populate the model list. This is how local providers like Ollama and LM Studio expose whatever models you have downloaded. ## Registry File Structure The registry file at `~/.argentos/provider-registry.json`: ```json theme={null} { "version": 7, "providers": { "minimax": { "name": "MiniMax", "baseUrl": "https://api.minimax.io/anthropic", "api": "anthropic-messages", "authType": "api_key", "envKeyVar": "MINIMAX_API_KEY", "models": [ { "id": "MiniMax-M2.5", "name": "MiniMax M2.5", "reasoning": false, "input": ["text"], "cost": { "input": 15, "output": 60, "cacheRead": 2, "cacheWrite": 10 }, "contextWindow": 200000, "maxTokens": 8192 } ] }, "ollama": { "name": "Ollama", "baseUrl": "http://127.0.0.1:11434/v1", "api": "openai-completions", "authType": "api_key", "envKeyVar": "OLLAMA_API_KEY", "dynamic": true, "discoveryUrl": "http://127.0.0.1:11434/api/tags", "models": [] } } } ``` ### Provider Entry Schema ```typescript theme={null} type ProviderRegistryEntry = { name: string; // Display name baseUrl: string; // API endpoint api: "openai-completions" | "anthropic-messages"; authType: "api_key" | "oauth" | "none"; envKeyVar?: string; // Environment variable for API key oauthPlaceholder?: string; // OAuth profile name dynamic?: boolean; // Enable runtime model discovery discoveryUrl?: string; // URL for model list endpoint models: ProviderModelEntry[]; }; ``` ### Model Entry Schema ```typescript theme={null} type ProviderModelEntry = { id: string; // Model identifier (sent to API) name: string; // Display name reasoning: boolean; // Supports extended thinking input: ("text" | "image")[]; // Input modalities cost: { input: number; // Cost per 1M input tokens (USD) output: number; // Cost per 1M output tokens (USD) cacheRead: number; // Cost per 1M cached read tokens cacheWrite: number; // Cost per 1M cache write tokens }; contextWindow: number; // Max context length in tokens maxTokens: number; // Max output tokens }; ``` ## Registry Operations ### Loading ```typescript theme={null} import { loadProviderRegistry } from "./provider-registry.js"; const registry = loadProviderRegistry(); // Returns merged seed + user customizations ``` ### Saving ```typescript theme={null} import { saveProviderRegistry } from "./provider-registry.js"; // File is written with mode 0o600 (owner read/write only) saveProviderRegistry(registry); ``` ### Getting a Single Provider ```typescript theme={null} import { getRegistryProvider } from "./provider-registry.js"; const ollama = getRegistryProvider("ollama"); ``` ### Resetting to Seed ```typescript theme={null} import { resetProviderToSeed, resetRegistryToSeed } from "./provider-registry.js"; // Reset one provider resetProviderToSeed("minimax"); // Reset entire registry resetRegistryToSeed(); ``` ## Merge Strategy When the seed version is bumped, the merge process: The full seed becomes the starting point. For each provider in the user's existing file: if the provider also exists in the seed, merge models (user models take priority, new seed models are appended). If the provider is user-added (not in seed), preserve it as-is. Write the merged result with the new seed version. This means: * **New providers** from seed updates are automatically added * **New models** for existing providers are added alongside user-customized models * **User-added providers** are never removed * **User model customizations** (cost overrides, context window adjustments) are preserved ## Adding Custom Providers Edit `~/.argentos/provider-registry.json` to add a new provider: ```json theme={null} { "my-local-llm": { "name": "My Local LLM", "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "authType": "none", "models": [ { "id": "my-model", "name": "My Custom Model", "reasoning": false, "input": ["text"], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 32768, "maxTokens": 4096 } ] } } ``` Custom providers survive seed updates because the merge strategy preserves user-added entries. ## Integration with Model Router The provider registry feeds the model router's provider resolution. When the router needs to route a request to a specific tier (LOCAL, FAST, BALANCED, POWERFUL), it consults the registry to find available providers and their models. The registry also provides cost data that the router uses for budget-aware routing decisions. ## Key Files | File | Description | | -------------------------------------- | -------------------------------------- | | `src/agents/provider-registry.ts` | Registry manager (149 LOC) | | `src/agents/provider-registry-seed.ts` | Seed data with 11+ providers (752 LOC) | | `src/config/types.models.ts` | Type definitions for registry entries | | `~/.argentos/provider-registry.json` | Persistent registry file | # Providers Source: https://docs.argentos.ai/models/providers Supported model providers — Anthropic, Ollama, MiniMax, Z.AI, and OpenRouter. ## Overview ArgentOS supports multiple model providers, allowing you to mix local and cloud models across different tiers. Each provider has its own authentication, endpoint configuration, and model catalog. Primary provider. Claude Haiku, Sonnet, and Opus. Local open-source models. Zero cost. Alternative cloud provider with competitive pricing. Meta-provider routing to hundreds of models. ## Anthropic The primary provider for ArgentOS. Supports Claude Haiku, Sonnet, and Opus. * **Endpoint**: `https://api.anthropic.com/v1` * **Auth**: API keys (`sk-ant-api...`) or setup tokens (`sk-ant-oat01-...`) * **Models**: `claude-haiku-4-20250514`, `claude-sonnet-4-20250514`, `claude-opus-4-20250514` * **Features**: Streaming, tool use, prompt caching (API keys only) Prompt caching only works with standard API keys, not with Max subscription setup tokens. ## Ollama (Local) Run open-source models locally with zero cost. * **Endpoint**: `http://localhost:11434` * **Auth**: None required * **Models**: Any model available in Ollama (Qwen3, Llama, Mistral, etc.) * **Default**: `qwen3:30b-a3b` for the LOCAL tier ```bash theme={null} # Install Ollama curl -fsSL https://ollama.com/install.sh | sh # Pull the default local model ollama pull qwen3:30b-a3b ``` ## MiniMax An alternative cloud provider with competitive pricing. * **Endpoint**: `https://api.minimax.io/v1` (portal API) * **Auth**: Coding Plan key (`sk-cp-...`) * **Models**: `MiniMax-M2.1` (general), `M2-her` (roleplay/character), `MiniMax-VL-01` (vision) MiniMax cannot handle mid-session fallback from Anthropic. Tool call history with Anthropic-format IDs (`toolu_01...`) causes HTTP 400 errors. MiniMax works best for fresh sessions or non-tool conversations. ## Z.AI GLM-series models from Zhipu AI. * **Endpoint**: Z.AI API * **Auth**: Z.AI API key * **Models**: `GLM-4.7`, `GLM-4.7-FlashX`, `GLM-4.7-Flash` ## OpenRouter A meta-provider that routes to many model providers. * **Endpoint**: `https://openrouter.ai/api/v1` * **Auth**: OpenRouter API key * **Models**: Access to hundreds of models from multiple providers ## Provider Configuration Providers are configured through [auth profiles](/models/auth-profiles) in: ``` ~/.argentos/agents/main/agent/auth-profiles.json ``` ## Adding a Provider ```bash theme={null} argent setup ``` The setup wizard guides you through adding API keys for each provider. You can also manually edit the auth profiles file. # Router Architecture Source: https://docs.argentos.ai/models/router-architecture Deep dive into the model router — complexity scoring, tier routing, background lanes, and cross-provider fallback. ## Overview The Model Router scores the complexity of every agent request and routes it to the cheapest capable model tier. This keeps costs low for simple interactions (greetings, status checks) while ensuring complex tasks (code architecture, multi-step reasoning) get powerful models. ```mermaid theme={null} flowchart LR R["Request\n(prompt, session, signals)"] --> CS["Complexity Scoring\n(7 factors)"] CS --> |"score ∈ [0,1]"| TS["Tier Selection"] TS --> LOCAL["LOCAL < 0.3"] TS --> FAST["FAST < 0.5"] TS --> BAL["BALANCED < 0.8"] TS --> POW["POWERFUL > 0.8"] LOCAL --> P["Provider + Fallback Chain"] FAST --> P BAL --> P POW --> P ``` ## Tier Definitions | Tier | Score Range | Default Model | Cost | Use Case | | ------------ | ----------- | ------------------------ | ------ | -------------------------------------------------------------------------------------------- | | **LOCAL** | \< 0.3 | Qwen3 30B-A3B via Ollama | Free | Simple queries, greetings, status. **Cannot use tools or leverage injected memory context.** | | **FAST** | 0.3 - 0.5 | Claude Sonnet | \$ | Tool calls, memory queries, standard interaction | | **BALANCED** | 0.5 - 0.8 | Claude Opus | \$\$ | Code generation, analysis, multi-step reasoning | | **POWERFUL** | > 0.8 | Claude Opus | \$\$\$ | Complex architecture, deep contemplation, critical decisions | Tier model assignments are configurable per profile and can be overridden in `~/.argentos/argent.json`: ```json theme={null} { "agents": { "defaults": { "modelRouter": { "tiers": { "local": { "provider": "ollama", "model": "qwen3:30b-a3b" }, "fast": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" }, "balanced": { "provider": "anthropic", "model": "claude-opus-4-20250514" }, "powerful": { "provider": "anthropic", "model": "claude-opus-4-20250514" } } } } } } ``` ## Complexity Scoring Algorithm The `scoreComplexity()` function evaluates 7 factors and produces a score between 0 and 1: ### Factor 1: Prompt Length | Length | Score Contribution | Reason | | -------------- | ------------------ | ---------------------------------------- | | \< 80 chars | +0.05 | Short prompt (greeting, yes/no) | | 80-300 chars | +0.15 | Medium prompt (simple question) | | 300-1000 chars | +0.30 | Long prompt (detailed request) | | > 1000 chars | +0.45 | Very long prompt (complex specification) | ### Factor 2: Thinking Level The user's thinking level preference adds a boost: | Level | Score Contribution | | ----------------- | ------------------ | | `xhigh` / `high` | +0.15 | | `medium` | +0.10 | | `low` / `minimal` | +0.05 | Thinking level is treated as a signal of desired reasoning depth, not as an automatic tier escalation. A user who always sets `xhigh` but sends "hey" still routes to the appropriate tier. ### Factor 3: Image Input If the request includes images (requires vision-capable models): | Condition | Score Contribution | | ----------------- | ------------------ | | `hasImages: true` | +0.30 | ### Factor 4: Session Type The session type applies floors, caps, and boosts: | Session Type | Behavior | | ---------------------- | ----------------------------------------------------------------------------------------------------------------- | | **Heartbeat** | Floor at 0.3 (FAST minimum). Heartbeats run nudges and tool calls that need reliable tool execution. | | **Contemplation** | Boosted to minimum 0.85 (POWERFUL). Self-directed thinking requires depth — cheap models take the easy rest exit. | | **Main** (user-facing) | Floor at 0.3 (FAST minimum). User sessions have tools and injected context that local models cannot handle. | | **Subagent** | +0.10 boost. Subagent tasks tend to be more focused. | ### Factor 5: Tool-Likely Prompt Detection For user-facing sessions, the router detects prompts likely to trigger tool use: ```typescript theme={null} const toolTriggerPatterns = [ /\b(save|store|record|log|write)\b.*\b(memory|that|this|it)\b/i, /\b(remember|don't forget|note that|keep in mind)\b/i, /\b(check|show|list|view)\b.*\b(task|tasks|todo|schedule)\b/i, /\b(send|message|dm|notify|ping)\b.*\b(discord|telegram|slack|email)\b/i, /\b(search|look up|find|fetch)\b.*\b(web|online|google|news)\b/i, /\b(add|create|start|complete|finish|block)\b.*\b(task|tasks)\b/i, /\b(generate|create|make)\b.*\b(image|audio|video|speech)\b/i, /\b(open|push|update)\b.*\b(doc|document|panel|canvas)\b/i, ]; ``` When a tool-likely pattern matches and the score is below 0.5 (BALANCED floor), the score is boosted. This prevents Haiku from simulating tool calls as text instead of making real `tool_use` blocks. ### Factor 6: Code/Technical Content | Pattern Matches | Score Contribution | Reason | | --------------- | ------------------ | ---------------------------- | | >= 3 patterns | +0.20 | Heavy code/technical content | | >= 1 pattern | +0.10 | Some code/technical content | Detection patterns include code blocks, programming keywords (`function`, `class`, `import`), SQL statements, and infrastructure terms (`docker`, `kubernetes`). ### Factor 7: Reasoning/Analysis Patterns | Pattern Matches | Score Contribution | Reason | | --------------- | ------------------ | --------------------------- | | >= 2 patterns | +0.15 | Reasoning/analysis required | | >= 1 pattern | +0.05 | Some reasoning needed | Detection patterns include analysis verbs (`analyze`, `compare`, `evaluate`), trade-off language, step-by-step requests, and system design requests. ### Score Reduction: Simple Queries Simple greetings and acknowledgments (`hi`, `hello`, `hey`, `thanks`, `ok`, `yes`, `no`) reduce the score, keeping trivial interactions on the cheapest tier. ## Background Model Lanes Five background subsystems have dedicated routing: | Lane | Target Tier | Rationale | | -------------------- | ------------------- | ------------------------------------------- | | **Contemplation** | POWERFUL (0.85+) | Self-directed thinking needs depth | | **SIS** | BALANCED | Lesson extraction needs adequate reasoning | | **Heartbeat** | FAST (0.3 floor) | Tool calls + nudges need reliable execution | | **Execution Worker** | Configurable | Worker has its own model override option | | **Embeddings** | LOCAL or configured | Embedding generation is a separate concern | ## Named Routing Profiles Profiles define complete tier mappings and fallback chains: ```typescript theme={null} interface ModelProfile { description?: string; tiers: Partial>; fallbackProfile?: string; // Chain to another profile } ``` ### Built-in Profiles ArgentOS ships with several built-in profiles including `default`, `budget`, `minimax-mix`, and others defined in `src/models/builtin-profiles.ts`. User-defined profiles in config take precedence. ### Profile Chaining Profiles can chain to fallback profiles: ```json theme={null} { "profiles": { "budget": { "tiers": { "fast": { "provider": "minimax", "model": "MiniMax-M2.1" } }, "fallbackProfile": "default" } } } ``` ## Cross-Provider Fallback When a provider fails (rate limit, error, unavailability), the router walks the fallback chain: 1. **Primary**: The tier's configured model/provider 2. **Profile fallback**: Next model in the profile's fallback chain 3. **Cross-provider**: Different provider for the same tier ### Cycle Detection The fallback walker tracks visited profiles to prevent infinite loops: ```typescript theme={null} const visited = new Set([startProfileName ?? ""]); let nextName: string | undefined = startProfile.fallbackProfile; while (nextName && !visited.has(nextName)) { visited.add(nextName); // ... resolve and add fallback } ``` ### Provider Normalization The router normalizes provider names to handle common variations: ```typescript theme={null} function normalizeProvider(provider: string): string { if (normalized === "z.ai" || normalized === "z-ai") return "zai"; if (normalized === "opencode-zen") return "opencode"; return normalized; } ``` It also infers providers from model names (`claude-*` -> `anthropic`, `gpt-*` -> `openai`, `glm-*` -> `zai`, etc.) to handle misconfigured profiles. ## Dashboard Model Badge The dashboard displays a color-coded badge on each message showing which tier was used: | Color | Tier | Meaning | | ------ | -------- | ---------------------- | | Green | LOCAL | Free local model | | Yellow | FAST | Fast/cheap cloud model | | Blue | BALANCED | Mid-tier cloud model | | Purple | POWERFUL | Premium cloud model | ## Session Model Override Individual sessions can override the router with a specific model: ```typescript theme={null} type SessionModelOverride = { provider: string; model: string; reason?: string; }; ``` This is used when the user explicitly selects a model in the dashboard, or when a subsystem (like the execution worker) has a configured model preference. ## Memory Query Boost Memory recall queries receive a +0.25 score boost to ensure they route to at least the FAST tier. Local models lack the context window and reasoning needed to effectively process retrieved memories and synthesize them into useful responses. ## Configuration Full router configuration in `~/.argentos/argent.json`: ```json theme={null} { "agents": { "defaults": { "modelRouter": { "enabled": true, "defaultProfile": "default", "thresholds": { "local": 0.3, "fast": 0.5, "balanced": 0.8 }, "tiers": { "local": { "provider": "ollama", "model": "qwen3:30b-a3b" }, "fast": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" }, "balanced": { "provider": "anthropic", "model": "claude-opus-4-20250514" }, "powerful": { "provider": "anthropic", "model": "claude-opus-4-20250514" } }, "profiles": {} } } } } ``` ## Disabling the Router Set `enabled: false` to bypass routing and always use the default model: ```json theme={null} { "agents": { "defaults": { "modelRouter": { "enabled": false } } } } ``` ## Key Files | File | LOC | Description | | -------------------------------------- | ----- | ---------------------------------------------- | | `src/models/router.ts` | \~586 | Complexity scoring and tier routing | | `src/models/types.ts` | \~104 | ModelTier, RoutingDecision, ModelProfile types | | `src/models/builtin-profiles.ts` | — | Built-in profile definitions | | `src/agents/provider-registry.ts` | \~126 | Dynamic provider registry | | `src/agents/provider-registry-seed.ts` | \~648 | 15+ provider definitions | # Authentication Source: https://docs.argentos.ai/security/auth API keys, setup tokens, auth profiles, and gateway authentication. ## Overview ArgentOS uses multiple layers of authentication to secure different parts of the system. Understanding how each layer works helps you configure a secure deployment. ## Authentication Layers ### 1. Gateway Auth Protects the WebSocket control plane from unauthorized access: ```json theme={null} { "gateway": { "auth": { "enabled": true, "token": "your-secret-gateway-token" } } } ``` Clients (dashboard, channels) must present this token when connecting. Without it, anyone with network access could control your agent. ### 2. API Provider Auth (Auth Profiles) Authenticates with model providers (Anthropic, MiniMax, etc.): ``` ~/.argentos/agents/main/agent/auth-profiles.json ``` See [Auth Profiles](/models/auth-profiles) for details on managing multiple provider keys. ### 3. Channel Auth Controls who can interact with the agent through each channel: ```json theme={null} { "channels": { "telegram": { "allowedUsers": [123456789] }, "discord": { "allowedGuilds": ["guild-id"] } } } ``` ## Auth Types Generated from Anthropic Max subscriptions: ```bash theme={null} claude setup-token # Output: sk-ant-oat01-... ``` * Bill against subscription weekly quota * Used for Max subscription accounts * No prompt caching support Standard per-token billing: ``` sk-ant-api03-... ``` * Bill per token used * Support prompt caching * Used for pay-as-you-go accounts ## Auth Resolution Priority When the agent makes an API call, credentials are resolved in this order: 1. **Auth profiles** (`auth-profiles.json`) -- checked first 2. **Environment variables** (`ANTHROPIC_API_KEY`, etc.) -- fallback This means auth profiles always take precedence. If you have both configured, the auth profile wins. ## Generating Auth Tokens ### Gateway Token Generate a random token: ```bash theme={null} openssl rand -hex 32 ``` Add it to your config: ```json theme={null} { "gateway": { "auth": { "token": "the-generated-token" } } } ``` ### Anthropic Setup Token ```bash theme={null} claude setup-token ``` Follow the prompts to authenticate with your Anthropic account. ## Security Recommendations * **Rotate tokens** periodically (monthly recommended) * **Never commit** `auth-profiles.json` to version control * **Use file permissions**: `chmod 600 auth-profiles.json` * **Monitor usage** through provider dashboards for unexpected activity * **Use separate profiles** for different environments (dev/prod) # Encrypted Secrets Source: https://docs.argentos.ai/security/encrypted-secrets AES-256-GCM encryption for API keys and credentials at rest, with OS keychain integration and PostgreSQL secret store. ## Overview ArgentOS stores API keys, service credentials, and authentication tokens using AES-256-GCM encryption. Secrets are encrypted before they hit disk or database -- the system never stores plaintext credentials in any persistent location. The encryption architecture has three layers: 1. **Master key** -- Stored in the OS keychain (macOS Keychain, Linux secret-service, Windows Credential Vault) 2. **Encryption engine** -- AES-256-GCM with random IVs and authentication tags 3. **Storage backends** -- JSON files (legacy) and PostgreSQL tables (current) ## Encryption Format All encrypted values use a self-describing format: ``` enc:v1::: ``` | Component | Description | | ---------------- | ------------------------------------------- | | `enc:v1` | Version prefix for format identification | | `iv-hex` | 12-byte initialization vector (hex-encoded) | | `authTag-hex` | GCM authentication tag (hex-encoded) | | `ciphertext-hex` | Encrypted payload (hex-encoded) | Example: ``` enc:v1:a1b2c3d4e5f6a7b8c9d0e1f2:1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d:8f7e6d5c4b3a... ``` The version prefix (`enc:v1`) enables future format upgrades without breaking existing encrypted values. ## AES-256-GCM The system uses AES-256-GCM (Galois/Counter Mode), which provides both confidentiality and authenticity: * **256-bit key** -- Derived from the master key stored in the OS keychain * **12-byte random IV** -- Generated fresh for every encryption operation using `crypto.randomBytes()` * **Authentication tag** -- GCM produces a tag that detects any tampering with the ciphertext * **No padding needed** -- GCM is a stream cipher mode, so no PKCS7 padding is required ```typescript theme={null} import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto"; const ALGORITHM = "aes-256-gcm"; const IV_BYTES = 12; function encryptSecret(plaintext: string): string { const key = getMasterKey(); const iv = randomBytes(IV_BYTES); const cipher = createCipheriv(ALGORITHM, key, iv); let encrypted = cipher.update(plaintext, "utf8", "hex"); encrypted += cipher.final("hex"); const authTag = cipher.getAuthTag().toString("hex"); return `enc:v1:${iv.toString("hex")}:${authTag}:${encrypted}`; } ``` ## OS Keychain Integration The 256-bit master key is stored in the operating system's native credential store: | Platform | Backend | | -------- | ---------------------------------------------- | | macOS | Keychain Services (`security` CLI) | | Linux | Secret Service API (GNOME Keyring, KDE Wallet) | | Windows | Credential Vault | The master key is generated once on first use and stored under the service name `argentos`. It never appears in configuration files, environment variables, or logs. ### Key Generation On first encryption operation, if no master key exists in the keychain: Generate 32 random bytes using `crypto.randomBytes(32)` Store in the OS keychain under the `argentos` service Cache in memory for the duration of the process ### Key Retrieval On subsequent operations: 1. Check in-memory cache 2. If not cached, read from OS keychain 3. Cache for process lifetime ## Backward Compatibility The decrypt function accepts both encrypted and plaintext values: ```typescript theme={null} function decryptSecret(value: string): string { if (!value.startsWith("enc:v1:")) { return value; // Plaintext — backward compatible } // ... decrypt ... } ``` This enables gradual migration. Existing plaintext values in config files and databases continue to work. They are re-encrypted with AES-256-GCM when next written. ## PostgreSQL Secret Store When running with PostgreSQL backend (dual-write or postgres mode), secrets are stored in two PG tables: ### Service Keys Table Stores API keys and service credentials: ```sql theme={null} CREATE TABLE service_keys ( id TEXT PRIMARY KEY, variable TEXT UNIQUE NOT NULL, name TEXT NOT NULL, encrypted_value TEXT NOT NULL, service TEXT, category TEXT, enabled BOOLEAN NOT NULL DEFAULT true, source TEXT, allowed_roles TEXT[] DEFAULT '{}', allowed_agents TEXT[] DEFAULT '{}', allowed_teams TEXT[] DEFAULT '{}', deny_all BOOLEAN NOT NULL DEFAULT false, created_at TIMESTAMPTZ NOT NULL, updated_at TIMESTAMPTZ NOT NULL ); ``` Key fields: | Field | Description | | ----------------- | -------------------------------------------------- | | `variable` | Environment variable name (e.g., `OPENAI_API_KEY`) | | `encrypted_value` | AES-256-GCM encrypted value | | `service` | Service identifier (e.g., `openai`, `anthropic`) | | `category` | Grouping category (e.g., `llm`, `channel`, `tool`) | | `allowed_roles` | Roles that can access this key | | `allowed_agents` | Agent IDs that can access this key | | `allowed_teams` | Team IDs that can access this key | | `deny_all` | If true, key is inaccessible to all agents | ### Auth Credentials Table Stores authentication profiles (OAuth tokens, API keys with metadata): ```sql theme={null} CREATE TABLE auth_credentials ( id TEXT PRIMARY KEY, profile_id TEXT UNIQUE NOT NULL, provider TEXT NOT NULL, credential_type TEXT NOT NULL, -- 'api_key', 'oauth', 'token' encrypted_payload TEXT NOT NULL, email TEXT, enabled BOOLEAN NOT NULL DEFAULT true, last_used_at TIMESTAMPTZ, cooldown_until TIMESTAMPTZ, error_count INTEGER DEFAULT 0, created_at TIMESTAMPTZ NOT NULL, updated_at TIMESTAMPTZ NOT NULL ); ``` The `encrypted_payload` field contains a JSON object encrypted with AES-256-GCM. This payload includes the actual credential data (API keys, OAuth tokens, refresh tokens) along with provider-specific metadata. ### Access Control Service keys support fine-grained access control: * **`allowed_roles`** -- Only agents with matching roles can use the key * **`allowed_agents`** -- Only specific agent IDs can use the key * **`allowed_teams`** -- Only agents in specific teams can use the key * **`deny_all`** -- Emergency kill switch to revoke all access When all access control arrays are empty, the key is accessible to all agents (open access). ## CRUD Operations ### Service Keys ```typescript theme={null} // List all keys (values decrypted in memory) const keys = await pgListServiceKeys(sql); // Resolve a key by variable name const value = await pgResolveServiceKey(sql, "OPENAI_API_KEY"); // Upsert a key (value encrypted before storage) await pgUpsertServiceKey(sql, { variable: "OPENAI_API_KEY", value: "sk-...", name: "OpenAI Production", service: "openai", category: "llm" }); // Delete a key await pgDeleteServiceKey(sql, "OPENAI_API_KEY"); ``` ### Auth Credentials ```typescript theme={null} // List all credentials (payloads decrypted in memory) const creds = await pgListAuthCredentials(sql); // Get a credential by profile ID const cred = await pgGetAuthCredential(sql, "anthropic:main"); // Upsert a credential await pgUpsertAuthCredential(sql, { profileId: "anthropic:main", provider: "anthropic", credentialType: "api_key", payload: { key: "sk-ant-..." }, email: "user@example.com" }); ``` ## Migration from JSON For installations migrating from JSON-file storage to PostgreSQL, Phoenix provides a one-shot migration function: ```typescript theme={null} const result = await migrateSecretsToPg(sql, { serviceKeysPath: "~/.argentos/service-keys.json", authProfilesPath: "~/.argentos/agents/main/agent/auth-profiles.json" }); // result: { // serviceKeys: { migrated: 15, skipped: 0 }, // authCredentials: { migrated: 3, skipped: 0 } // } ``` The migration: 1. Reads the JSON files 2. Decrypts any already-encrypted values (using the same master key) 3. Re-encrypts for PG storage 4. Upserts into the PostgreSQL tables 5. Reports migration counts Existing PG entries are updated (not duplicated) via `ON CONFLICT ... DO UPDATE`. ## Key Rotation To rotate the master key: They are decrypted in memory during export A new master key is auto-generated Currently, key rotation is a manual process. The system does not support automatic key rotation. ## Security Properties | Property | Status | | ---------------------- | -------------------------------------------------- | | Encryption at rest | AES-256-GCM for all persistent secrets | | Key management | OS keychain (not in files or env vars) | | Authentication | GCM auth tag prevents tampering | | IV reuse prevention | Random 12-byte IV per encryption | | Backward compatibility | Plaintext values accepted, encrypted on next write | | Access control | Per-key role/agent/team restrictions (PG only) | | Audit trail | `created_at` / `updated_at` timestamps | ## Key Files | File | Description | | ------------------------------ | ------------------------------------ | | `src/infra/secret-crypto.ts` | AES-256-GCM encrypt/decrypt (63 LOC) | | `src/infra/pg-secret-store.ts` | PostgreSQL secret store (365 LOC) | | `src/infra/keychain.ts` | OS keychain master key management | | `src/infra/service-keys.ts` | JSON-file service keys (legacy) | # Exec Approvals Source: https://docs.argentos.ai/security/exec-approvals Command-level gating that controls which shell commands agents can execute, with allowlists, IPC approval daemons, and per-agent policies. **ArgentOS Business** -- This feature is part of ArgentOS Business. The architecture is documented here for all users, but full functionality requires a Business license. [Learn more about Business](/business). ## Overview Exec Approvals is the command-gating layer that sits between every agent tool invocation and the host operating system. Before any shell command runs -- whether triggered by the `bash` tool, a skill, or the execution worker -- it passes through the exec approvals system for validation. The system answers one question: **Is this agent allowed to run this command on this machine?** This is critical because agents can execute arbitrary shell commands during task processing. Without gating, an agent could `rm -rf /`, install packages, or exfiltrate data. Exec approvals enforce a principle-of-least-privilege model where agents start with zero shell access and gain permissions through explicit operator configuration. ## Security Modes (ExecSecurity) | Mode | Behavior | Use Case | | ----------- | ---------------------------------------------------------------------------------- | ----------------------------------------------- | | `deny` | Block all commands. No shell access whatsoever. | Default. Maximum safety for untrusted agents. | | `allowlist` | Only commands matching an allowlist entry may execute. Everything else is blocked. | Production agents with known tool requirements. | | `full` | All commands are permitted without restriction. | Development only. Never use in production. | The default security mode is `deny`. Agents cannot run any commands until the operator explicitly configures their permissions. ## Ask Modes (ExecAsk) The `ask` field controls what happens when a command does not match the allowlist. This only applies when `security` is set to `allowlist`: | Mode | Behavior | Use Case | | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `off` | Never prompt. Unmatched commands are handled by `askFallback` (default: `deny`). | Fully automated environments. | | `on-miss` | Prompt the operator via the IPC socket when a command is not in the allowlist. If approved, the command's path is auto-added to the allowlist for future runs. | Default. Learn-as-you-go pattern. | | `always` | Prompt the operator for every command, even if it matches the allowlist. | High-security environments requiring explicit approval for each execution. | When `ask` is `on-miss` and the operator approves a command, the resolved executable path is automatically appended to the agent's allowlist. This creates a progressive learning model where the allowlist grows as the agent encounters new tools. ## Allowlist Pattern Matching Each agent can have an allowlist of executable patterns. Entries support: * **Absolute paths**: `/usr/bin/git`, `/opt/homebrew/bin/node` * **Home-relative paths**: `~/bin/my-tool` * **Glob patterns**: `/usr/bin/*`, `/opt/homebrew/bin/p*` * **Double-star globs**: `/usr/local/**/python3` ### How Matching Works The command string is parsed to extract the first token (the executable) The executable is resolved against `$PATH` to find its absolute filesystem path Each allowlist pattern is tested against the resolved path using case-insensitive glob matching On Windows, paths are normalized (backslashes to forward slashes) and real paths are resolved for symlink-safe matching ```typescript theme={null} type ExecAllowlistEntry = { id?: string; // Auto-generated UUID for tracking pattern: string; // Glob pattern or absolute path lastUsedAt?: number; // Timestamp of last match lastUsedCommand?: string; // The full command that matched lastResolvedPath?: string; // The resolved executable path }; ``` Each entry tracks usage metadata so operators can audit which patterns are actively used and prune stale entries. ### Default Safe Binaries The system recognizes a set of safe binaries that are commonly needed by agent tools: ```typescript theme={null} const DEFAULT_SAFE_BINS = [ "jq", "grep", "cut", "sort", "uniq", "head", "tail", "tr", "wc" ]; ``` These are not automatically allowed -- they must still be in the allowlist -- but they serve as a reference for operators building initial configurations. ## Per-Agent Configuration Exec approvals support per-agent policies. Each agent can have its own security mode, ask mode, and allowlist: ```json theme={null} { "version": 1, "socket": { "path": "~/.argentos/exec-approvals.sock", "token": "auto-generated-base64url-token" }, "defaults": { "security": "allowlist", "ask": "on-miss", "askFallback": "deny", "autoAllowSkills": false }, "agents": { "main": { "security": "allowlist", "allowlist": [ { "pattern": "/usr/bin/git" }, { "pattern": "/opt/homebrew/bin/node" }, { "pattern": "/usr/local/bin/pnpm" } ] }, "research-agent": { "security": "deny" }, "*": { "allowlist": [ { "pattern": "/usr/bin/cat" }, { "pattern": "/usr/bin/ls" } ] } } } ``` ### Resolution Order 1. Agent-specific settings override defaults. 2. Wildcard agent (`*`) entries provide a baseline for all agents. 3. Allowlists are merged: wildcard entries + agent-specific entries. 4. The `askFallback` determines what happens when the IPC daemon is unreachable or `ask` is `off`. ## IPC Socket Daemon When `ask` is `on-miss` or `always`, approval requests are sent to an IPC socket daemon. This enables real-time operator interaction: * **Socket path**: `~/.argentos/exec-approvals.sock` (configurable) * **Authentication**: A random base64url token is generated on first run and stored in the config * **Protocol**: JSON messages over Unix domain sockets The daemon is started by the gateway process. When a command needs approval, the agent runtime sends a request to the socket and blocks until the operator responds. If the socket is unavailable (daemon not running, network issue), the system falls back to the `askFallback` security mode (default: `deny`). ## Command Analysis Before approval checks, commands undergo structural analysis: ```typescript theme={null} type ExecCommandAnalysis = { ok: boolean; // Whether the command structure is valid reason?: string; // Why analysis failed segments: ExecCommandSegment[]; // Parsed pipeline segments chains?: ExecCommandSegment[][]; // Segments grouped by chain operators }; ``` The analyzer handles: * **Shell quoting**: Single quotes, double quotes, escape sequences * **Pipeline splitting**: Commands piped with `|` are split into segments, each validated independently * **Chain operators**: `&&`, `||`, `;` split commands into chains * **Blocked tokens**: Redirections (`>`, `<`), backtick substitution, `$()` subshells, and newlines are rejected * **Windows compatibility**: Platform-specific token validation Each segment in a pipeline is resolved independently. All segments must pass allowlist matching for the full command to be approved. ## Hash Validation The exec approvals config file includes a SHA-256 hash mechanism for integrity verification: ```typescript theme={null} type ExecApprovalsSnapshot = { path: string; exists: boolean; raw: string | null; file: ExecApprovalsFile; hash: string; // SHA-256 of the raw file content }; ``` This hash is used by the gateway to detect external modifications to the approvals file. When the hash changes between reads, the system reloads the configuration to pick up operator edits made outside the dashboard. ## Auto-Allow Skills When `autoAllowSkills` is `true`, commands executed by installed skills (from the ArgentOS skill marketplace) are automatically approved without allowlist matching. This provides a convenience layer for trusted skill packages while maintaining control over ad-hoc commands. Default: `false` -- skills must have their commands explicitly allowlisted. ## Configuration in argent.json Exec approvals can also be configured through the main config file at `~/.argentos/argent.json` under the `approvals` key. These settings serve as default overrides: ```json theme={null} { "approvals": { "security": "allowlist", "ask": "on-miss", "askFallback": "deny" } } ``` The dedicated `~/.argentos/exec-approvals.json` file takes precedence for per-agent allowlists and socket configuration. The `argent.json` approvals section provides default security/ask modes that apply when the dedicated file does not specify them. ## Dashboard Integration The dashboard exposes exec approvals through the gateway API: * `exec.approvals.get` -- Read current approvals configuration * `exec.approvals.set` -- Update approvals configuration * `exec.approvals.node.get` -- Read node-specific approvals * `exec.approvals.node.set` -- Update node-specific approvals * `exec.approval.request` -- Submit an approval request (from agent runtime) * `exec.approval.resolve` -- Resolve a pending approval (from operator) ## Key Files | File | Description | | ---------------------------------------------- | ----------------------------------------- | | `src/infra/exec-approvals.ts` | Core approval engine (1,509 LOC) | | `src/gateway/server-methods/exec-approvals.ts` | Gateway handlers for approval CRUD | | `src/gateway/server-methods/exec-approval.ts` | Gateway handlers for request/resolve flow | | `~/.argentos/exec-approvals.json` | Persistent approvals configuration | ## Best Practices 1. **Start with `deny`** and gradually build allowlists as you discover which commands your agent needs. 2. **Use `on-miss`** during initial setup to learn the required commands, then switch to `off` once the allowlist is stable. 3. **Never use `full` security** in production. It defeats the entire purpose of command gating. 4. **Use absolute paths** in allowlists rather than bare command names to prevent PATH manipulation attacks. 5. **Audit `lastUsedAt`** timestamps periodically and remove stale entries. 6. **Keep the wildcard agent (`*`) allowlist minimal** -- it applies to every agent including newly created ones. # Security Overview Source: https://docs.argentos.ai/security/index How ArgentOS protects your system — sandboxing, authentication, and secret management. ## Overview ArgentOS gives an AI agent significant power over your system -- command execution, file access, web browsing, and network communication. Security is built into every layer to ensure this power is used responsibly. ## Security Layers Control what tools the agent can use and what operations require approval Multiple authentication mechanisms protect different parts of the system Secure handling of API keys, tokens, and credentials ## Threat Model | Threat | Mitigation | | -------------------------------- | --------------------------------------------- | | Agent executing harmful commands | Sandboxing, tool policies, approval workflows | | Unauthorized gateway access | Gateway auth tokens, network restrictions | | API key exposure | Local-only storage, file permissions | | Memory data leakage | Local SQLite, no external transmission | | Channel impersonation | User allowlists, channel pairing | ## Default Security Posture Out of the box, ArgentOS ships with: * **Sandboxed mode** for tool execution * **Gateway auth** enabled * **Localhost-only** binding (no remote access by default) * **User allowlists** empty (allows all, but easy to restrict) * **API keys** stored with user-only file permissions ## Security Best Practices Follow these practices for a secure deployment: 1. **Enable gateway authentication** -- Always use an auth token 2. **Use sandboxed mode** -- Require approval for destructive operations 3. **Restrict channel access** -- Set `allowedUsers` on each channel 4. **Use Tailscale for remote access** -- Never expose the gateway directly to the internet 5. **Rotate API keys** periodically 6. **Monitor gateway logs** for unusual activity 7. **Keep ArgentOS updated** for security patches ## Principle of Least Privilege Configure each agent with the minimum tools and permissions it needs: | Agent Type | Recommended Mode | Details | | --------------- | ---------------- | ---------------------------- | | Customer-facing | Locked | No exec, no browser | | Personal | Sandboxed | Approval for destructive ops | | Development | Unrestricted | Controlled environment only | ## Reporting Security Issues Report security vulnerabilities to [security@argentos.ai](mailto:security@argentos.ai). Do not open public issues for security reports. # Sandboxing Source: https://docs.argentos.ai/security/sandboxing Control what your agent can do with sandboxing modes and tool policies. ## Overview Sandboxing controls the agent's ability to interact with your system. It determines which tools are available, which operations need approval, and what actions are blocked entirely. ## Sandbox Modes ```json theme={null} { "security": { "mode": "unrestricted" } } ``` * All tools available * No approval required * Suitable for: trusted personal environments, development ```json theme={null} { "security": { "mode": "sandboxed" } } ``` * All tools available * Dangerous operations require user approval * Commands matching blocked patterns are rejected * Suitable for: most personal and team deployments ```json theme={null} { "security": { "mode": "locked" } } ``` * Only safe tools (memory, tasks, doc\_panel) * No command execution * No browser automation * Suitable for: customer-facing agents, public deployments ## Tool Policies Fine-grained policies override the global sandbox mode for individual tools: ```json theme={null} { "toolPolicies": { "exec": { "mode": "approval-required", "blockedPatterns": [ "rm -rf", "sudo", "chmod 777", "mkfs", "> /dev/" ], "allowedPaths": [ "/Users/sem/projects/", "/tmp/" ] }, "browser": { "mode": "allowed", "blockedDomains": [ "banking.example.com", "*.internal.company.com" ] }, "memory_store": { "mode": "allowed" }, "memory_recall": { "mode": "allowed" } } } ``` ## Blocked Patterns The `blockedPatterns` array uses substring matching against the command string. If any pattern matches, the command is rejected without asking for approval. Common patterns to block: | Pattern | Reason | | | ------------ | ----------------------------------- | --------- | | `rm -rf /` | Prevents recursive deletion of root | | | `sudo` | Prevents privilege escalation | | | `chmod 777` | Prevents world-writable permissions | | | `mkfs` | Prevents filesystem formatting | | | `> /dev/` | Prevents writing to device files | | | \`\` :()\{ : | :& };: \`\` | Fork bomb | ## Approval Flow When an operation requires approval: A modal appears with the command or action details. The user clicks "Approve" or "Reject." The agent sends the command details and waits for a response like "yes" or "approved." If no approval is received within a configurable timeout (default: 5 minutes), the operation is rejected automatically. ## Path Restrictions The `allowedPaths` array restricts where the exec tool can operate: ```json theme={null} { "exec": { "allowedPaths": ["/Users/sem/projects/", "/tmp/"] } } ``` Commands that attempt to access paths outside the allowed list are blocked. ## Testing Your Sandbox ```bash theme={null} # Verify current security mode argent config get security.mode # Test a command against policies argent security test "rm -rf /tmp/old-files" ``` # Secret Management Source: https://docs.argentos.ai/security/secrets Secure storage and distribution of API keys, tokens, and credentials. ## Overview ArgentOS handles sensitive credentials -- API keys, auth tokens, and service passwords. Proper secret management ensures these never leak to logs, version control, or unauthorized parties. ## Where Secrets Live | Secret | Location | Permissions | | -------------- | -------------------------------------------------- | ---------------------- | | Auth profiles | `~/.argentos/agents/main/agent/auth-profiles.json` | `600` (user-only) | | Gateway token | `~/.argentos/argent.json` | `600` (user-only) | | Channel tokens | `~/.argentos/argent.json` | `600` (user-only) | | ElevenLabs key | Dashboard settings | Stored in dashboard.db | ## Local Storage All secrets are stored locally on disk. ArgentOS never transmits your credentials to any service other than the intended API provider. ### File Permissions Sensitive files should be readable only by the owning user: ```bash theme={null} chmod 600 ~/.argentos/argent.json chmod 600 ~/.argentos/agents/main/agent/auth-profiles.json ``` The installer sets these permissions by default, but verify them if you edit files manually. ## Environment Variables Secrets can also be provided via environment variables as a fallback: ```bash theme={null} export ANTHROPIC_API_KEY="sk-ant-api03-..." export ELEVENLABS_API_KEY="..." ``` Environment variables are checked after auth profiles. They are useful for CI/CD environments or Docker deployments. ## Enterprise Secret Sync Enterprise features require an ArgentOS Enterprise license. See [Enterprise](/licensing/enterprise). For organizations managing multiple ArgentOS instances, the secret sync system distributes API keys from a central authority: Organization admin configures keys in the licensing portal Each ArgentOS instance fetches its assigned keys on activation Key rotation is handled centrally ```mermaid theme={null} graph TD LS[Licensing Server] --> OK[Organization API Keys] LS --> IR[Instance requests keys
authenticated by license] IR --> LP[Keys written to local
auth-profiles.json] ``` ## Secrets in Logs ArgentOS redacts sensitive values from logs: * API keys are shown as `sk-ant-***...***` * Auth tokens are never logged * Gateway auth tokens are never included in error messages ## Secret Rotation ### Manual Rotation ```bash theme={null} argent gateway restart ``` ### Automated Rotation Enterprise customers can configure automatic key rotation through the licensing portal. ## Best Practices 1. **Never commit secrets** to Git (add config files to `.gitignore`) 2. **Use auth profiles** instead of environment variables when possible 3. **Set strict file permissions** (`chmod 600`) 4. **Rotate keys** on a regular schedule 5. **Use separate keys** for development and production 6. **Monitor provider dashboards** for unusual usage # Configuration Reference Source: https://docs.argentos.ai/start/config-reference Complete reference for argent.json — all configuration sections, fields, defaults, and environment variable overrides. ## Overview ArgentOS is configured through `~/.argentos/argent.json`. This file controls agent behavior, model routing, channel integrations, gateway settings, storage backends, and more. The configuration is validated against a Zod schema on load. Invalid fields produce clear error messages with paths to the problematic values. ## Configuration File Location Primary: `~/.argentos/argent.json` The state directory (`~/.argentos/`) can be overridden with the `ARGENT_STATE_DIR` environment variable. The config file is a symlink target — on systems migrating from OpenClaw, it may symlink to `~/.openclaw/openclaw.json`. ## Top-Level Sections ```json theme={null} { "meta": {}, "env": {}, "wizard": {}, "diagnostics": {}, "logging": {}, "update": {}, "browser": {}, "ui": {}, "distribution": {}, "auth": {}, "models": {}, "agents": {}, "tools": {}, "bindings": {}, "broadcast": {}, "audio": {}, "media": {}, "messages": {}, "commands": {}, "approvals": {}, "session": {}, "cron": {}, "hooks": {}, "intent": {}, "web": {}, "channels": {}, "discovery": {}, "canvasHost": {}, "talk": {}, "gateway": {}, "memory": {}, "nodeHost": {} } ``` ## agents Section The `agents` section contains agent-level defaults and per-agent overrides: ```json theme={null} { "agents": { "defaults": { "model": { "primary": "anthropic/claude-sonnet-4-20250514", "fallbacks": ["minimax/MiniMax-M2.5"] }, "workspace": "~/argent", "thinkingDefault": "low", "timeoutSeconds": 300, "maxConcurrent": 1, "heartbeat": { "every": "30m", "model": "anthropic/claude-haiku-3-5", "activeHours": { "start": "07:00", "end": "22:00", "timezone": "user" } }, "contemplation": { "enabled": true, "every": "30m", "maxCyclesPerHour": 12, "model": "ollama/qwen3:1.7b" }, "executionWorker": { "enabled": true, "every": "20m", "maxRunMinutes": 12, "maxTasksPerCycle": 24, "requireEvidence": true, "maxNoProgressAttempts": 2 }, "modelRouter": { "enabled": true, "tiers": { "local": { "model": "ollama/qwen3:1.7b" }, "fast": { "model": "anthropic/claude-haiku-3-5" }, "balanced": { "model": "anthropic/claude-sonnet-4-20250514" }, "powerful": { "model": "anthropic/claude-opus-4-20250514" } } }, "kernel": { "enabled": false, "mode": "off", "localModel": "qwen3:1.7b", "tickMs": 30000 } } } } ``` ### Key Agent Fields | Field | Type | Default | Description | | ----------------- | ---------- | --------------------- | -------------------------------------------------------------- | | `model.primary` | `string` | — | Primary model (provider/model format) | | `model.fallbacks` | `string[]` | `[]` | Fallback models tried in order | | `workspace` | `string` | `~/.argent/workspace` | Agent working directory | | `thinkingDefault` | `string` | `"off"` | Default thinking level: off, minimal, low, medium, high, xhigh | | `timeoutSeconds` | `number` | `300` | Max seconds per agent turn | | `maxConcurrent` | `number` | `1` | Max concurrent agent runs | | `mediaMaxMb` | `number` | — | Max inbound media size in MB | | `userTimezone` | `string` | host TZ | IANA timezone for the user | | `timeFormat` | `string` | `"auto"` | Time format: auto, 12, 24 | | `skipBootstrap` | `boolean` | `false` | Skip workspace bootstrap | ### Heartbeat Configuration | Field | Type | Default | Description | | ------------------- | -------- | ------- | ------------------------------------------ | | `every` | `string` | `"30m"` | Heartbeat interval (duration string) | | `model` | `string` | — | Model override for heartbeat runs | | `activeHours.start` | `string` | — | Start time (HH:MM, 24h) | | `activeHours.end` | `string` | — | End time (HH:MM, 24h) | | `target` | `string` | — | Delivery target: last, none, or channel ID | | `to` | `string` | — | Delivery address (phone, chat ID) | ### Contemplation Configuration | Field | Type | Default | Description | | ------------------ | --------- | ------- | -------------------------------- | | `enabled` | `boolean` | `true` | Enable contemplation cycles | | `every` | `string` | `"30m"` | Interval between cycles | | `familyEvery` | `string` | `"24h"` | Interval for family agents | | `maxCyclesPerHour` | `number` | `12` | Rate limit | | `model` | `string` | — | Model override (typically local) | ### Execution Worker Configuration | Field | Type | Default | Description | | ----------------------- | --------- | ------- | ----------------------------- | | `enabled` | `boolean` | `false` | Enable task execution loop | | `every` | `string` | `"20m"` | Cycle interval | | `maxRunMinutes` | `number` | `12` | Max minutes per cycle | | `maxTasksPerCycle` | `number` | `24` | Safety cap on tasks | | `requireEvidence` | `boolean` | `true` | Require concrete evidence | | `maxNoProgressAttempts` | `number` | `2` | Attempts before auto-blocking | ### Kernel Configuration | Field | Type | Default | Description | | ------------ | --------- | -------------- | -------------------------------- | | `enabled` | `boolean` | `false` | Enable consciousness kernel | | `mode` | `string` | `"off"` | Mode: off, shadow, soft, full | | `localModel` | `string` | `"qwen3:1.7b"` | Local model for kernel reasoning | | `tickMs` | `number` | `30000` | Minimum tick interval | ## models Section Provider and model configuration: ```json theme={null} { "models": { "providers": { "anthropic": { "apiKey": "env:ANTHROPIC_API_KEY" }, "openai": { "apiKey": "env:OPENAI_API_KEY" } } } } ``` ## auth Section Authentication profiles for multi-provider failover: ```json theme={null} { "auth": { "profiles": { "anthropic:main": { "provider": "anthropic", "mode": "api_key", "email": "user@example.com" } }, "order": { "anthropic": ["anthropic:main", "anthropic:backup"] }, "cooldowns": { "billingBackoffHours": 1, "failureWindowHours": 0.5 } } } ``` ## channels Section Channel integrations (Telegram, Discord, Slack, WhatsApp, etc.): ```json theme={null} { "channels": { "telegram": { "botToken": "123456:ABC...", "enabled": true }, "discord": { "botToken": "MTE...", "enabled": true }, "slack": { "accounts": { "default": { "botToken": "xoxb-...", "appToken": "xapp-..." } } }, "whatsapp": { "enabled": true } } } ``` Each channel has its own configuration schema. See the channel-specific documentation for details. ## gateway Section Gateway server configuration: ```json theme={null} { "gateway": { "port": 18789, "mode": "local", "bind": "127.0.0.1", "token": "auto-generated", "cors": { "origins": ["http://localhost:5173"] } } } ``` | Field | Type | Default | Description | | ------- | -------- | ------------- | --------------------- | | `port` | `number` | `18789` | WebSocket server port | | `mode` | `string` | `"local"` | `local` or `remote` | | `bind` | `string` | `"127.0.0.1"` | Bind address | | `token` | `string` | auto | Authentication token | ## session Section Session management configuration: ```json theme={null} { "session": { "dmScope": "main", "store": "~/.argentos/sessions" } } ``` ## cron Section Cron service configuration: ```json theme={null} { "cron": { "enabled": true, "store": "~/.argentos/cron-jobs.json", "maxConcurrentRuns": 2 } } ``` ## memory Section Memory backend configuration: ```json theme={null} { "memory": { "backend": "builtin", "citations": "auto", "memu": { "llm": { "provider": "ollama", "model": "qwen3:1.7b" } } } } ``` | Field | Type | Default | Description | | ----------- | -------- | ----------- | ------------------------------ | | `backend` | `string` | `"builtin"` | Memory backend: builtin or qmd | | `citations` | `string` | `"auto"` | Citation mode: auto, on, off | ## logging Section ```json theme={null} { "logging": { "level": "info", "file": "~/.argentos/logs/argent.log", "consoleLevel": "warn", "consoleStyle": "pretty", "redactSensitive": "tools" } } ``` | Field | Type | Default | Description | | ----------------- | -------- | ---------- | ------------------------------------- | | `level` | `string` | `"info"` | File log level | | `consoleLevel` | `string` | — | Console log level | | `consoleStyle` | `string` | `"pretty"` | Console format: pretty, compact, json | | `redactSensitive` | `string` | — | Redaction mode: off, tools | ## approvals Section Default exec approval settings: ```json theme={null} { "approvals": { "security": "allowlist", "ask": "on-miss", "askFallback": "deny" } } ``` ## intent Section Intent governance hierarchy: ```json theme={null} { "intent": { "validationMode": "enforce", "runtimeMode": "enforce", "global": { "objective": "Serve the operator's interests safely", "neverDo": ["Access unauthorized systems"], "requiresHumanApproval": ["financial_transactions"] } } } ``` ## hooks Section Webhook and event hook configuration: ```json theme={null} { "hooks": { "enabled": true, "path": "/hooks", "token": "webhook-secret", "presets": ["gmail"] } } ``` ## web Section WebSocket client configuration (for dashboard connections): ```json theme={null} { "web": { "enabled": true, "heartbeatSeconds": 30, "reconnect": { "initialMs": 1000, "maxMs": 30000, "factor": 2, "jitter": 0.1, "maxAttempts": 0 } } } ``` ## Environment Variable Overrides Several settings can be overridden via environment variables: | Variable | Override | | ---------------------- | -------------------------------------- | | `ARGENT_STATE_DIR` | State directory path | | `ARGENT_PROFILE` | Active profile name | | `ARGENT_GATEWAY_PORT` | Gateway port | | `ARGENT_GATEWAY_TOKEN` | Gateway auth token | | `ARGENT_RUNTIME` | Enable argent runtime (`true`/`false`) | | `ANTHROPIC_API_KEY` | Anthropic API key | | `OPENAI_API_KEY` | OpenAI API key | | `OLLAMA_API_KEY` | Ollama API key (usually not needed) | ## Validation The configuration is validated on load using Zod schemas. Invalid fields produce errors like: ``` Config validation error at agents.defaults.heartbeat.every: Expected string, received number ``` Use `config.schema` gateway method to retrieve the full schema for programmatic validation. ## Key Files | File | Description | | ----------------------------------------- | --------------------------------- | | `src/config/zod-schema.ts` | Main Zod schema (ArgentSchema) | | `src/config/zod-schema.agents.ts` | Agent configuration schemas | | `src/config/zod-schema.agent-defaults.ts` | Agent defaults schema | | `src/config/types.agent-defaults.ts` | TypeScript types for agent config | | `src/config/types.argent.ts` | Root config type definitions | | `src/config/config.ts` | Config loading and validation | # Configuration Source: https://docs.argentos.ai/start/configuration Configure ArgentOS via argent.json and environment variables. ## Configuration File ArgentOS is configured via `~/.argentos/argent.json`. This file controls the gateway, agent, channels, and all subsystems. ```json theme={null} { "gateway": { "port": 18789, "host": "0.0.0.0" }, "agents": { "defaults": { "model": "claude-sonnet-4-5-20250929", "modelRouter": { "enabled": true, "tiers": { "local": { "model": "qwen3-30b-a3b:latest", "provider": "ollama" }, "fast": { "model": "claude-haiku-4-5-20251001" }, "balanced": { "model": "claude-sonnet-4-5-20250929" }, "powerful": { "model": "claude-opus-4-6" } } } } }, "workspace": "~/argent" } ``` ## State Directory The canonical state directory is `~/.argentos/`. Key contents: | Path | Description | | -------------------- | --------------------------------- | | `argent.json` | Main configuration | | `memory.db` | MemU memory database | | `data/dashboard.db` | Task and dashboard state | | `agents/main/agent/` | Agent templates and auth profiles | | `extensions/` | Installed plugins | ## Environment Variables | Variable | Description | | ------------------- | --------------------------------------------------- | | `ANTHROPIC_API_KEY` | Fallback API key if auth profiles aren't configured | | `ARGENT_STATE_DIR` | Override state directory location | | `ARGENT_WORKSPACE` | Override agent workspace path | For the complete reference of all configuration sections and fields, see the [Configuration Reference](/start/config-reference). # Getting Started Source: https://docs.argentos.ai/start/getting-started Install ArgentOS and talk to your personal AI in under 5 minutes. ## Your AI, running on your machine ArgentOS is a personal AI operating system. It runs locally, remembers everything, and connects to the channels you already use. No cloud accounts to manage. No vendor lock-in. Just your agent, working for you. ## Install **Prerequisite (macOS):** Install [Homebrew](https://brew.sh) first if you don't have it: ```bash theme={null} /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` Then install ArgentOS: ```bash theme={null} curl -fsSL https://argentos.ai/install.sh | bash ``` The installer handles everything after Homebrew: * **Homebrew** — required, must be pre-installed * **PostgreSQL 17** on port 5433 (non-default to avoid conflicts) * **Redis** on port 6380 (non-default to avoid conflicts) * **Node.js 22** via nvm (if not already present) * **ArgentOS source** cloned, built, and CLI linked * **Gateway** installed as a LaunchAgent (stays on across reboots) * **Argent.app** downloaded and launched (macOS) **Requirements:** macOS (Apple Silicon or Intel). Linux support is available — see [Installation](/install) for details. ## First Run The Argent.app opens automatically after install. The onboarding wizard walks you through: Connect your Anthropic API key or Max subscription setup token. Name your agent, set personality and voice. Connect Telegram, Discord, Slack, or WhatsApp. Configure where your agent stores files. If you prefer the CLI: ```bash theme={null} argent setup ``` ## Connect a Channel Give your agent a way to reach you: ```bash theme={null} argent channels add telegram ``` Telegram, Discord, Slack, and WhatsApp are fully supported. Follow the prompts — you'll be connected in under a minute. See the [Channels guide](/channels) for platform-specific setup. ## Talk to Your Agent Open the dashboard: ```bash theme={null} argent dashboard ``` This launches the web UI at `http://localhost:8080`. Say hello. Ask it to remember something. Give it a task. Your agent has memory, personality, and tools — it's not a stateless chatbot. Or just message it on the channel you connected. It's the same agent everywhere. ## What to Try Next You're up and running. Here's where it gets interesting: Your agent remembers conversations, facts, and preferences automatically. Try asking it what it knows about you after a few chats. Assign work. Your agent tracks priorities, dependencies, and progress. Shape your agent's personality, values, and communication style through editable identity documents. Feed it PDFs, docs, and spreadsheets. It chunks, embeds, and searches them for you. ArgentOS picks the right model for each task — from free local models to Opus — so you don't burn tokens on simple questions. Your agent thinks on its own when idle. It journals, reflects, and develops over time. Welcome to ArgentOS. It only gets better from here. # Learning Path Source: https://docs.argentos.ai/start/learning-path Find the right docs for your experience level. From first install to enterprise governance. ## Find your path You don't need to read everything. ArgentOS is deep, but most people only need a handful of pages to get productive. Pick the tier that matches where you are, or jump straight to the use case that fits. *** ## By experience level ### Getting Started — \~30 minutes Just landed? Start here. One command, full stack. See [Installation](/install). Set your name, personality, and first model. See [Onboarding](/start/onboarding). Open the dashboard and say hello. Wire up Telegram, Discord, or Slack. See [Channels](/channels). That's enough to have a personal AI that remembers you and lives in your chat apps. ### Power User — \~2 hours You've talked to your agent. Now make it useful. How your agent remembers (and forgets). Automatic tier selection so you don't overpay. Teach your agent new capabilities with markdown files. Install community skills and connectors. Give your agent a voice in the dashboard. Tasks, projects, canvas, config panel. ### Builder / Operator — \~4 hours Running agents for a team or building on the platform. Three-tier policy engine (Global > Department > Agent). Autonomous background task processing. RAG with collection-level ACL. Shared memory, inter-agent streams. Integrate external services. The always-on thinking loop. Gated review and sign-off workflows. *** ## By use case ### Personal AI Assistant You want an agent that knows you, talks to you, and gets smarter over time. **Key docs:** [Memory](/memory) > [Voice](/dashboard/tts) > [Channels](/channels) > [Contemplation](/agents/contemplation) ### Business Communications Bot Route conversations across Telegram, Discord, Slack, or WhatsApp with outbound messaging. **Key docs:** [Channels](/channels) > [Outbound messaging](/agents/outbound-messaging) > [Skills](/tools/skills) ### Task Automation Let the agent execute work autonomously — scheduling, background processing, project intake. **Key docs:** [Execution worker](/agents/execution-worker) > [SpecForge](/agents/specforge) > [Tasks](/tasks) ### MSP / IT Operations Monitor infrastructure, run operational playbooks, and enforce governance for client environments. **Key docs:** [Skills](/tools/skills) > [Plugins](/tools/plugins) > [Intent governance](/agents/intent-governance) > [Exec approvals](/security/exec-approvals) ### Developer Platform Build and publish skills, connectors, and integrations on the AOS Marketplace. **Key docs:** [Marketplace](https://marketplace.argentos.ai) > [Skills](/tools/skills) > [Plugins](/tools/plugins) ### Enterprise Governance Lock down agent behavior with hierarchical policies, approval gates, and accountability scoring. **Key docs:** [Intent governance](/agents/intent-governance) > [Exec approvals](/security/exec-approvals) > [Heartbeat](/agents/heartbeat-contracts) > [Knowledge ACL](/agents/knowledge-library) *** ## Quick reference | Topic | What it does | Docs | | ----------- | ------------------------------------------------ | ---------------------------------------------- | | **Install** | One-command install and first run | [Start here](/install) | | **Brain** | Auto-capture, entity tracking, hybrid search | [Memory](/memory) | | **Talk** | Telegram, Discord, Slack, WhatsApp | [Channels](/channels) | | **Think** | Always-on background thinking loop | [Contemplation](/agents/contemplation) | | **Work** | Autonomous task processing | [Execution worker](/agents/execution-worker) | | **Route** | Complexity scoring, tier selection, cost control | [Model router](/models) | | **Guard** | Hierarchical policy engine | [Intent governance](/agents/intent-governance) | | **Know** | RAG with agent-scoped collections | [Knowledge](/agents/knowledge-library) | | **Build** | Community skills, connectors, packages | [Marketplace](https://marketplace.argentos.ai) | | **Ship** | Project intake, team lanes, task generation | [SpecForge](/agents/specforge) | *** Still not sure where to start? [Install ArgentOS](/install) and just start talking. Your agent will figure out the rest. # Legacy Migration Reference Source: https://docs.argentos.ai/start/migration Historical reference for transitioning from a legacy OpenClaw installation to ArgentOS. ## Overview This page is a historical reference for users transitioning from legacy OpenClaw installations. ArgentOS was inspired by OpenClaw's original vision but is an independently developed AI operating system with 90,000+ lines of original code. The two projects have diverged significantly and are no longer compatible. The migration tool preserves data from legacy installations: * Agent identity files (SOUL.md, AGENTS.md) * User profile (USER.md) * Tool configurations (TOOLS.md) * Memory and daily logs (MEMORY.md, memory/\*.md) * Channel configurations * Cron jobs and schedules ``` +-----------------------------------------------------------------------------+ | LEGACY DATA -> ARGENTOS MIGRATION | | | | Legacy Installation ArgentOS Workspace | | ~/.openclaw/ ~/.argentos/ | | | | +-- workspace/ ---> +-- workspace/ | | | +-- SOUL.md ---> | +-- SOUL.md (preserved) | | | +-- AGENTS.md ---> | +-- AGENTS.md (upgraded) | | | +-- USER.md ---> | +-- USER.md (preserved) | | | +-- TOOLS.md ---> | +-- TOOLS.md (preserved) | | | +-- MEMORY.md ---> | +-- MEMORY.md (preserved) | | | +-- HEARTBEAT.md ---> | +-- HEARTBEAT.md (upgraded) | | | +-- memory/ ---> | +-- memory/ (preserved) | | | | | +-- config.json ---> +-- config.json (converted) | | +-- sessions/ ---> +-- sessions/ (preserved) | | +-- credentials/ ---> +-- credentials/ (preserved) | | | | Legacy memory database ---> Built-in MemU system | | ~/.openclaw-mem/ ---> ~/.argentos/data/memory.db | | | +-----------------------------------------------------------------------------+ ``` ## Migration Commands These commands are for users transitioning from legacy installations only. New users should follow the [Getting Started](/start/getting-started) guide instead. ```bash One-command migration theme={null} argent migrate from-openclaw ``` ```bash With explicit path theme={null} argent migrate from-openclaw --workspace ~/.openclaw/workspace ``` ```bash Dry run (preview) theme={null} argent migrate from-openclaw --dry-run ``` ```bash Specific components only theme={null} argent migrate from-openclaw --only identity,memory ``` ## What Gets Migrated ### 1. Identity Files | File | Description | Migration | | ------------- | ----------------------------- | ------------------------------- | | `SOUL.md` | Personality, values, behavior | Copied as-is | | `AGENTS.md` | Workspace conventions | Upgraded with ArgentOS features | | `USER.md` | Owner profile | Copied as-is | | `TOOLS.md` | Tool notes, API keys | Copied as-is | | `IDENTITY.md` | Additional identity | Copied if exists | ### 2. Memory | Source | Destination | Notes | | --------------------------- | ---------------------------- | ------------------------------ | | `MEMORY.md` | `MEMORY.md` | Preserved exactly | | `memory/*.md` | `memory/*.md` | All daily logs preserved | | `~/.openclaw-mem/memory.db` | `~/.argentos/data/memory.db` | Legacy SQLite migrated to MemU | | `~/.openclaw-mem/chroma/` | `~/.argentos/data/vectors/` | Vectors migrated if exists | ### 3. Configuration ```yaml theme={null} # Legacy config.json -> ArgentOS config.json # Channel credentials preserved: telegram: token: "..." -> telegram.token discord: token: "..." -> discord.token # Model settings converted: model: "anthropic/claude-sonnet-4" -> models.default: "balanced" # ArgentOS systems enabled: + sis.enabled: true + tasks.enabled: true + models.routing.enabled: true + models.local.endpoint: "http://localhost:11434" ``` ### 4. Channel Credentials All channel credentials are migrated: * Telegram bot tokens * Discord bot tokens * Slack app credentials * Signal sessions * WhatsApp sessions (Baileys auth) ### 5. Sessions & History * Active sessions preserved * Conversation history maintained * Session keys unchanged (no disruption) ## Migration Process ```bash theme={null} # Install ArgentOS globally npm install -g argentos # Or with Bun bun install -g argentos ``` ```bash theme={null} # Interactive migration wizard argent migrate from-openclaw # Wizard prompts: # Found legacy workspace at ~/.openclaw/workspace # Found identity files: SOUL.md, AGENTS.md, USER.md, TOOLS.md # Found memory: MEMORY.md + 47 daily logs # Found legacy memory database: 1,234 observations # Found channels: telegram, discord, whatsapp # # Ready to migrate. This will: # - Create ArgentOS workspace at ~/.argentos/ # - Copy all identity and memory files # - Convert configuration # - Migrate memory database to MemU # # Continue? [Y/n] ``` ```bash theme={null} # Check migration status argent doctor # Output: # Identity files: OK # Memory system: OK (1,234 observations imported) # Channels: telegram (OK), discord (OK), whatsapp (OK) # Configuration: OK # # ArgentOS is ready! ``` ```bash theme={null} # Start all services argent start # Or start gateway only argent gateway start ``` ## Manual Migration If you prefer manual migration: ```bash theme={null} # 1. Create ArgentOS workspace mkdir -p ~/.argentos/workspace # 2. Copy identity files cp ~/.openclaw/workspace/SOUL.md ~/.argentos/workspace/ cp ~/.openclaw/workspace/AGENTS.md ~/.argentos/workspace/ cp ~/.openclaw/workspace/USER.md ~/.argentos/workspace/ cp ~/.openclaw/workspace/TOOLS.md ~/.argentos/workspace/ cp ~/.openclaw/workspace/MEMORY.md ~/.argentos/workspace/ cp -r ~/.openclaw/workspace/memory ~/.argentos/workspace/ # 3. Copy credentials cp -r ~/.openclaw/credentials ~/.argentos/ # 4. Migrate memory database mkdir -p ~/.argentos/data cp ~/.openclaw-mem/memory.db ~/.argentos/data/ # 5. Convert config (use migration tool) argent migrate convert-config ~/.openclaw/config.json ``` ## FAQ No. Your `SOUL.md` and identity files are copied exactly as-is. No. All memory files and the legacy database are migrated to MemU. All credentials are migrated. Your Telegram, Discord, Slack, Signal, and WhatsApp connections will work immediately. ## Support Need help with migration? * Documentation: [argentos.ai/docs](https://argentos.ai/docs) * Discord: [discord.gg/argentos](https://discord.gg/argentos) * GitHub Issues: [github.com/ArgentAIOS/core/issues](https://github.com/ArgentAIOS/core/issues) # Onboarding Source: https://docs.argentos.ai/start/onboarding Step-by-step guide to setting up your ArgentOS agent. ## The Setup Wizard After installation, the setup wizard walks you through: Connect your Anthropic account. Configure your agent's name and personality. Connect messaging platforms. Set the agent's working directory. Initialize the MemU memory database. ```bash theme={null} argent onboard ``` ## Restart Onboarding If you need to re-run onboarding (broken install, changed config, fresh start), you can force it to show again. ### Quick Reset (Terminal) ```bash theme={null} defaults delete ai.argent.mac onboardingSeen 2>/dev/null defaults write ai.argent.mac onboardingVersion -int 0 open -a /Applications/Argent.app ``` This resets the two UserDefaults keys that Argent.app uses to decide whether to show onboarding, then relaunches the app. The onboarding wizard will appear on next launch. ### How It Works Argent.app determines onboarding state from UserDefaults — **not** by checking whether Postgres, Redis, or the gateway are installed. Two keys control it: | Key | Type | Description | | -------------------------- | ---- | ---------------------------------------- | | `argent.onboardingVersion` | Int | Version of onboarding the user completed | | `argent.onboardingSeen` | Bool | Whether onboarding was completed at all | Onboarding shows if the stored version is lower than the current required version, or if `onboardingSeen` is false. ### When to Restart Restarting onboarding does **not** delete your data, memory, tasks, or configuration. It only resets the onboarding completion flag so the wizard shows again. * After a fresh install that failed partway through * After changing your Anthropic auth or switching accounts * After a major version upgrade that changes onboarding steps * If the gateway was reconfigured and the app needs to reconnect ## Agent Identity Your agent's identity is defined in the `IDENTITY` template at `~/.argentos/agents/main/agent/IDENTITY.md`. This shapes how the agent communicates across all channels. ## Workspace The agent workspace (default: `~/argent/`) is where your agent stores files, runs code, and manages its working state. This includes: * `DASHBOARD.md` — Instructions for the dashboard protocol * Downloaded files and generated content * Task artifacts and reports # Uninstall ArgentOS Source: https://docs.argentos.ai/start/uninstall How to remove ArgentOS from your machine. Covers macOS, with Linux and Windows guides coming soon. ## macOS Run the uninstall script: ```bash theme={null} curl -fsSL https://argentos.ai/uninstall.sh | bash -s -- ``` This removes: * `/Applications/Argent.app` * Gateway, Redis, and monitoring LaunchAgents * CLI wrappers (`argent`, `argentos`) * Private Node.js runtime * App UserDefaults **Your data is preserved by default** — memory, configuration, and workspace files stay in `~/.argentos/`. ### Full Removal (including data) To also delete your memory database, config, logs, and workspace: ```bash theme={null} curl -fsSL https://argentos.ai/uninstall.sh | bash -s -- --remove-data ``` This will ask you to type `DELETE` to confirm. To skip confirmation: ```bash theme={null} curl -fsSL https://argentos.ai/uninstall.sh | bash -s -- --remove-data --force ``` ### What Gets Removed | Item | Path | Removed | | -------------------- | ---------------------------------------------------------- | ------------------------- | | Argent.app | `/Applications/Argent.app` | Yes | | Gateway service | `~/Library/LaunchAgents/ai.argent.gateway.plist` | Yes | | Redis service | `~/Library/LaunchAgents/ai.argent.redis.plist` | Yes | | Curiosity monitor | `~/Library/LaunchAgents/ai.argent.curiosity-monitor.plist` | Yes | | CLI wrappers | `~/bin/argent`, `~/bin/argentos` | Yes | | Source checkout | `~/argentos/` | Yes | | Private Node runtime | `~/.argentos/runtime/` | Yes | | App preferences | UserDefaults `ai.argent.mac` | Yes | | Config & memory | `~/.argentos/` | Only with `--remove-data` | | Workspace | `~/argent/` | Only with `--remove-data` | ### What Is NOT Removed PostgreSQL, Redis, and Homebrew are not removed because they may be used by other applications. To remove them manually: ```bash theme={null} brew uninstall postgresql@17 pgvector redis ``` ### Manual Removal If you prefer to remove everything manually: ```bash theme={null} # Stop services osascript -e 'tell application "Argent" to quit' launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.argent.redis.plist # Remove app and services rm -rf /Applications/Argent.app rm -f ~/Library/LaunchAgents/ai.argent.*.plist # Remove CLI rm -f ~/bin/argent ~/bin/argentos # Remove source and runtime rm -rf ~/argentos ~/.argentos/runtime # Clear preferences defaults delete ai.argent.mac # Optional: remove all data rm -rf ~/.argentos ~/.argent ~/argent ``` ## Linux *Coming soon.* The Linux uninstall will remove systemd user services, CLI wrappers, and optionally data. PostgreSQL and Redis system packages will not be removed. ## Windows *Coming soon.* The Windows uninstall will remove the Scheduled Task, CLI wrappers, and optionally data. PostgreSQL and Memurai system services will not be removed. # Creating Tasks Source: https://docs.argentos.ai/tasks/creating-tasks How to create and manage tasks via chat, dashboard, CLI, and agent tools. ## Overview Tasks can be created through multiple interfaces. Regardless of how they are created, they end up in the same SQLite database and are visible everywhere. ## Creating Tasks Tell your agent to create a task in natural language: ``` Create a task to update the server firewall rules ``` The agent calls `tasks_add` and confirms the task was created: ```json theme={null} { "tool": "tasks_add", "input": { "title": "Update server firewall rules", "priority": "high", "description": "Review and update iptables rules on the Dell R750" } } ``` ``` /task Update the server firewall rules ``` This creates a task with default priority (normal) and the provided title. ```bash theme={null} argent tasks add "Update the server firewall rules" --priority high ``` ## Agent-Created Tasks The agent can proactively create tasks when it identifies work to be done: ``` Agent: I noticed the SSL certificate for argentos.ai expires in 14 days. I've created a task to renew it. [tasks_add: "Renew SSL certificate for argentos.ai" (priority: high)] ``` ## Task Fields | Field | Required | Default | Description | | ------------- | -------- | -------- | ------------------------------------------ | | `title` | Yes | -- | Short description of the task | | `description` | No | -- | Detailed description | | `priority` | No | `normal` | urgent, high, normal, low, background | | `source` | Auto | -- | Set automatically based on creation method | ## Listing Tasks ``` What tasks do I have? Show me urgent tasks ``` ``` /tasks ``` ```bash theme={null} argent tasks list argent tasks list --status pending --priority high ``` ## Updating Tasks ### Completing ``` Mark the firewall task as done ``` Or via the dashboard's complete button. ### Blocking ``` Block the SSL renewal task — waiting on domain registrar response ``` The agent calls `tasks_block` with the reason. ### Deleting Tasks can be deleted from the dashboard or CLI. Completed tasks are retained for history. # Task System Overview Source: https://docs.argentos.ai/tasks/index ArgentOS task system — a priority queue with accountability for your AI agent. ## Overview The task system gives your ArgentOS agent a structured way to track work. Instead of ad-hoc requests that get lost in conversation history, tasks are persistent records with status, priority, and accountability tracking. Tasks are stored in a SQLite database shared between the agent and the dashboard, so both sides have the same view of what needs to be done. ## Core Concepts ### Task Structure ```typescript theme={null} interface Task { id: string; title: string; description?: string; status: "pending" | "in_progress" | "blocked" | "completed" | "failed"; priority: "urgent" | "high" | "normal" | "low" | "background"; source: "user" | "agent" | "heartbeat" | "schedule"; createdAt: string; updatedAt: string; completedAt?: string; } ``` ### Priority Queue Tasks are ordered by priority: | Priority | When to Use | | ------------ | --------------------------- | | `urgent` | Needs immediate attention | | `high` | Important, do soon | | `normal` | Standard priority (default) | | `low` | Do when there is free time | | `background` | Long-running, no deadline | The agent processes tasks in priority order when triggered by the heartbeat or user. ### Sources Tasks can be created by: * **User**: Explicitly requested via chat, dashboard, or CLI * **Agent**: The agent creates tasks for itself based on conversations * **Heartbeat**: Recurring tasks generated by the heartbeat system * **Schedule**: Cron-like scheduled tasks ## Agent Tools The agent interacts with tasks through these tools: | Tool | Description | | ---------------- | --------------------------------------------------------- | | `tasks_list` | List all tasks, optionally filtered by status or priority | | `tasks_add` | Create a new task | | `tasks_start` | Mark a task as in\_progress | | `tasks_complete` | Mark a task as completed | | `tasks_block` | Mark a task as blocked with a reason | ## Storage Tasks are stored in: ``` ~/.argentos/data/dashboard.db ``` This database is shared between the dashboard API server and the agent runtime. ## Related Pages * [Creating Tasks](/tasks/creating-tasks) -- How to create and manage tasks * [Task Flow](/tasks/task-flow) -- The full task lifecycle * [Tasks UI](/dashboard/tasks-ui) -- Dashboard task management interface # Projects Source: https://docs.argentos.ai/tasks/projects Multi-step task grouping — project lifecycle, agent tools, and dashboard integration. ## Overview The Task System gives the agent accountability. Tasks flow through a lifecycle (pending -> in\_progress -> completed/failed/blocked), the agent manages them via tools, and the dashboard shows real-time progress. **Projects** group related tasks under a parent. The agent decomposes work into projects when it detects multi-step intent. ## Architecture ### Data Layer Tasks live in `~/.argentos/data/dashboard.db` (SQLite), shared by the agent runtime and dashboard API. ``` tasks table id (UUID) title, description status: pending | in_progress | blocked | completed | failed | cancelled priority: urgent | high | normal | low | background source: user | agent | heartbeat | schedule parent_task_id -> tasks(id) # FK for project children metadata (JSON) # { type: "project" } for project parents tags (JSON array) due_at, started_at, completed_at agent_id, session_id, channel_id ``` A **project** is a task with `metadata.type = "project"`. Child tasks reference it via `parent_task_id`. No schema migration needed. ### Agent Tool The `tasks` tool exposes these actions: | Action | Description | | ---------------- | ------------------------------------------------------------- | | `add` | Create a task (optionally under a project via `parentTaskId`) | | `list` | List tasks with optional status/priority filters | | `start` | Move task to `in_progress` | | `complete` | Mark task as `completed` | | `block` | Mark task as `blocked` with reason | | `fail` | Mark task as `failed` with reason | | `delete` | Remove a task | | `search` | Full-text search across tasks | | `project_create` | Create a project with child tasks | | `project_list` | List all projects with progress | | `project_detail` | Get project with all child tasks | ### Dashboard * **Tasks tab** -- Active tasks, pending tasks, recently completed * **Projects tab** -- Project cards with progress bars, click to expand child tasks * **Schedule tab** -- Cron jobs and scheduled tasks ### Markers The agent emits markers in its response stream for instant UI updates: * `[TASK_DONE:title]` -- Dashboard immediately marks matching task as done * `[TTS:text]` -- Dashboard speaks the text via ElevenLabs These provide instant feedback before the next 5-second poll cycle. ## Task Lifecycle ```mermaid theme={null} graph TD P[PENDING] -->|tasks.start| IP[IN_PROGRESS] IP -->|tasks.complete| C[COMPLETED] IP -->|tasks.block| B[BLOCKED] IP -->|tasks.fail| F[FAILED] B -->|unblock/restart| IP ``` ## Project Flow ### Example User: "Set up monitoring for the production servers" Agent creates: ``` Project: Production Server Monitoring Install Prometheus and Grafana Configure alert rules Set up dashboards Test alert pipeline Document runbook ``` ## API Routes | Method | Path | Description | | ------ | ------------------------- | ---------------------------- | | GET | `/api/tasks` | List all tasks | | POST | `/api/tasks` | Create a task | | PATCH | `/api/tasks/:id` | Update a task | | DELETE | `/api/tasks/:id` | Delete a task | | POST | `/api/tasks/:id/start` | Start a task | | POST | `/api/tasks/:id/complete` | Complete a task | | GET | `/api/projects` | List projects with counts | | GET | `/api/projects/:id` | Project detail with children | | POST | `/api/projects` | Create a project | ## Key Files | File | Purpose | | --------------------------------------- | ------------------------------------------ | | `src/data/tasks.ts` | Core TasksModule -- CRUD, projects, search | | `src/data/types.ts` | Task, Project, Filter type definitions | | `src/data/connection.ts` | SQLite connection manager | | `src/data/index.ts` | DataAPI facade | | `src/agents/tools/tasks-tools.ts` | Agent tool definition | | `dashboard/src/db/tasksDb.cjs` | Dashboard-side DB access | | `dashboard/api-server.cjs` | REST API routes | | `dashboard/src/hooks/useTasks.ts` | React hook for task/project state | | `dashboard/src/components/TaskList.tsx` | Task & project UI components | # Task Lifecycle Source: https://docs.argentos.ai/tasks/task-flow The full task flow — pending to in_progress to completed, with dashboard integration. ## Overview Every task follows a lifecycle from creation through completion (or failure). The lifecycle is designed for accountability -- you can see what the agent is working on, what is blocked, and what has been accomplished. ## Status Flow ```mermaid theme={null} graph TD P[pending] -->|start| IP[in_progress] IP -->|complete| C[completed] IP -->|fail| F[failed] IP -->|block| B[blocked] B -->|unblock| IP2[in_progress] IP2 -->|complete| C2[completed] ``` ## Status Definitions | Status | Description | Who Sets It | | ------------- | ----------------------------------- | --------------------------- | | `pending` | Task created, waiting to be started | System (on creation) | | `in_progress` | Agent is actively working | User (play button) or agent | | `completed` | Task finished successfully | Agent (`tasks_complete`) | | `failed` | Task could not be completed | Agent (with error reason) | | `blocked` | Waiting on external dependency | Agent (`tasks_block`) | ## The Dashboard Play Flow This is the primary task execution workflow: The user clicks the play button on a pending task in the dashboard. This triggers: 1. `POST /api/tasks/:id/start` -- Updates status to `in_progress` 2. A chat message is sent to the gateway: "Work on task: \[title]" The agent receives the message and begins working. It can: * Use any available tools (exec, browser, memory, etc.) * Stream progress updates in the chat * Create sub-tasks if needed When finished, the agent: 1. Calls the `tasks` tool with `action: complete` 2. Emits `[TASK_DONE:title]` in the response stream The dashboard updates through two mechanisms: * **Instant**: Parses `[TASK_DONE:title]` from the stream for immediate UI update * **Polling**: Checks the database every 5 seconds as a backup ## Heartbeat-Triggered Tasks The [heartbeat system](/gateway/heartbeat) can trigger task work autonomously: This enables the agent to work on tasks even when no user is actively chatting. ## Task Accountability Tasks track: * **Who created it**: User, agent, heartbeat, or schedule * **When each status change happened**: Full audit trail * **Time spent**: Duration in each status * **Completion notes**: What the agent did to complete the task ## Bulk Operations ```bash theme={null} # Complete all tasks matching a filter argent tasks complete --status in_progress --older-than 7d # List overdue tasks argent tasks list --overdue ``` # Browser Automation Source: https://docs.argentos.ai/tools/browser The browser tool — navigate, interact with, and extract content from web pages. ## Overview The `browser` tool provides web browsing capabilities to your agent. It can navigate to URLs, interact with page elements, extract content, and take screenshots. This is powered by a headless browser (Playwright) running on the host system. ## Capabilities | Action | Description | | ------------ | ---------------------------------- | | `navigate` | Open a URL in the browser | | `click` | Click on an element | | `type` | Type text into an input field | | `extract` | Extract text content from the page | | `screenshot` | Take a screenshot of the page | | `scroll` | Scroll the page | | `wait` | Wait for an element or condition | ## Usage Examples ### Navigating and Extracting The agent can browse a website and extract relevant information: ```json theme={null} { "tool": "browser", "input": { "action": "navigate", "url": "https://news.ycombinator.com" } } ``` Followed by: ```json theme={null} { "tool": "browser", "input": { "action": "extract", "selector": ".titleline" } } ``` ### Form Interaction ```json theme={null} { "tool": "browser", "input": { "action": "type", "selector": "#search-input", "text": "ArgentOS documentation" } } ``` ## Configuration ```json theme={null} { "agents": { "defaults": { "browser": { "headless": true, "timeout": 30000, "viewport": { "width": 1280, "height": 720 } } } } } ``` ## Prerequisites The browser tool requires Playwright to be installed: ```bash theme={null} npx playwright install chromium ``` ## Security Considerations The browser runs with the same permissions as the ArgentOS process. Be cautious with agents that have both browser and exec tools -- they can be powerful in combination. * Consider restricting allowed domains in production environments * Cookie and session data persists between browser actions within a session ## Limitations * Browser state does not persist across gateway restarts * JavaScript-heavy SPAs may require explicit wait conditions * File downloads through the browser require separate handling * The browser runs headless by default; there is no visual UI to observe # Building Plugins Source: https://docs.argentos.ai/tools/building-plugins End-to-end guide to building ArgentOS plugins — tools, hooks, service keys, and config persistence. ## Overview This guide walks through building a complete ArgentOS plugin. Plugins can register tools, read service keys, persist configuration, and hook into the agent lifecycle — all without modifying core files. ## Plugin Structure ``` ~/.argentos/extensions/my-plugin/ ├── argent.plugin.json # Manifest (required) └── index.ts # Plugin entry point ``` Plugins are discovered from two locations: * **Global**: `~/.argentos/extensions//` * **Workspace**: `.argent/extensions//` (project-local) The entry point is loaded by Jiti (TypeScript JIT), so `.ts` files work without a build step. ## Manifest Every plugin needs an `argent.plugin.json` for discovery and config validation: ```json theme={null} { "id": "my-plugin", "name": "My Plugin", "description": "What this plugin does", "version": "1.0.0", "configSchema": { "type": "object", "additionalProperties": false, "properties": { "apiKey": { "type": "string", "description": "API key (prefer service-keys.json)" }, "userId": { "type": "number", "description": "Linked user ID" } } }, "uiHints": { "apiKey": { "sensitive": true, "label": "API Key" } } } ``` | Field | Required | Description | | -------------- | -------- | ---------------------------------------------------------- | | `id` | Yes | Unique plugin identifier | | `configSchema` | Yes | JSON Schema for plugin config (even if empty) | | `name` | No | Display name | | `description` | No | Short summary | | `version` | No | Semver version | | `uiHints` | No | UI rendering hints (sensitive flags, labels, placeholders) | | `kind` | No | Plugin kind (e.g., `"memory"`) | | `channels` | No | Channel IDs this plugin registers | | `providers` | No | Provider IDs this plugin registers | | `skills` | No | Skill directories to load | ## Entry Point Export a default function that receives the registration API: ```ts theme={null} export default function register(api: any) { api.registerTool({ /* ... */ }); api.on("before_agent_start", async (ctx: any) => { /* ... */ }); } ``` ### No Core Imports Plugins in `~/.argentos/extensions/` don't have access to core `node_modules`. Use plain JSON Schema objects instead of `@sinclair/typebox`. ```ts theme={null} // Don't: import { Type } from "@sinclair/typebox" // Do: plain JSON Schema const schema = { type: "object" as const, properties: { query: { type: "string" as const, description: "Search query" }, limit: { type: "number" as const, description: "Max results" }, }, required: ["query"] as const, }; ``` ## Registering Tools ```ts theme={null} api.registerTool({ name: "my_tickets", description: "List support tickets", parameters: { type: "object", properties: { status: { type: "string", enum: ["open", "pending", "resolved"], description: "Filter by status", }, }, }, async execute(_id: string, params: any) { const data = await fetchTickets(params); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; }, }); ``` For tools that require credentials or have side effects, mark them as optional: ```ts theme={null} api.registerTool( { name: "dangerous_tool", /* ... */ }, { optional: true }, ); ``` ## Service Keys ArgentOS has a centralized key store at `~/.argentos/service-keys.json`, managed through the dashboard (Settings > API Keys). Plugins should read from this store rather than requiring separate config. ### Reading Service Keys ```ts theme={null} function resolveApiKey(variableName: string): string | undefined { try { const fs = require("node:fs"); const path = require("node:path"); const keysPath = path.join( process.env.HOME ?? "/tmp", ".argentos", "service-keys.json", ); const raw = fs.readFileSync(keysPath, "utf-8"); const store = JSON.parse(raw); const entry = (store.keys ?? []).find( (k: any) => k.variable === variableName && k.enabled !== false, ); if (entry?.value) return entry.value; } catch {} return process.env[variableName]; // Fallback for CI/servers } ``` ### How It Works Through **Dashboard > Settings > API Keys**. Dashboard writes to `~/.argentos/service-keys.json`. Plugin reads the key at runtime via the pattern above. Falls back to `process.env` for CI/server deployments. ### Service Keys Format ```json theme={null} { "keys": [ { "variable": "MY_API_KEY", "value": "sk-...", "enabled": true, "label": "My Service", "category": "other" } ] } ``` ## Config Persistence Plugins can persist configuration to `~/.argentos/argent.json` under `plugins.entries..config`: ```ts theme={null} function updatePluginConfig( pluginId: string, key: string, value: any, ): boolean { try { const fs = require("node:fs"); const path = require("node:path"); const configPath = path.join( process.env.HOME ?? "/tmp", ".argentos", "argent.json", ); const raw = fs.readFileSync(configPath, "utf-8"); const config = JSON.parse(raw); if (!config.plugins) config.plugins = {}; if (!config.plugins.entries) config.plugins.entries = {}; if (!config.plugins.entries[pluginId]) config.plugins.entries[pluginId] = { enabled: true }; if (!config.plugins.entries[pluginId].config) config.plugins.entries[pluginId].config = {}; config.plugins.entries[pluginId].config[key] = value; fs.writeFileSync( configPath, JSON.stringify(config, null, 2) + "\n", "utf-8", ); return true; } catch { return false; } } ``` This enables self-service setup flows where the agent discovers and saves config automatically. ### Config in argent.json ```json theme={null} { "plugins": { "allow": ["my-plugin"], "entries": { "my-plugin": { "enabled": true, "config": { "userId": 12345 } } } } } ``` ## Plugin Allowlist If `plugins.allow[]` has any entries, **only** plugins in that list are enabled. Non-bundled plugins default to enabled when the allowlist is empty. If your plugin isn't loading, check whether an allowlist exists and add your plugin ID. ## Lifecycle Hooks ### `before_agent_start` Fires before each agent run. Inject context or nudge the agent: ```ts theme={null} api.on("before_agent_start", async (ctx: any) => { const apiKey = resolveApiKey("MY_API_KEY"); if (!apiKey) return; const summary = await fetchSummary(apiKey); ctx.systemPromptSuffix = ` ## My Integration ${summary} `.trim(); }); ``` Use `systemPromptSuffix` for: * Open ticket counts or active alerts * Nudging the agent when setup is incomplete * Injecting operator-specific context ## Tips Jiti loads TypeScript directly. Don't create mega-tools — split tickets, devices, and alerts into separate tools. Return a helpful message if the API key is missing, don't throw. Prevent hung API calls from blocking the agent. Users manage keys through the dashboard UI. Let the agent discover configuration instead of requiring manual entry. ## Related * [Plugin System](/tools/plugins) — Plugin discovery, manifests, and management * [Marketplace](/marketplace) — Browse and publish packages # Command Execution Source: https://docs.argentos.ai/tools/exec The exec tool — run bash commands, scripts, and system operations from your agent. ## Overview The `exec` tool gives your agent the ability to run bash commands on the host system. This is one of the most powerful tools available, enabling the agent to install software, manage files, run scripts, query APIs, and automate system tasks. ## Usage The agent calls the `exec` tool with a command string: ```json theme={null} { "tool": "exec", "input": { "command": "ls -la /Users/sem/projects/", "timeout": 30000 } } ``` The command runs in a bash shell and returns stdout, stderr, and the exit code. ## Parameters | Parameter | Type | Default | Description | | --------- | ------ | --------- | --------------------------- | | `command` | string | required | The bash command to execute | | `timeout` | number | 120000 | Timeout in milliseconds | | `cwd` | string | workspace | Working directory | ## Security Command execution is the highest-risk tool. ArgentOS provides several layers of protection. ### Sandbox Modes | Mode | Behavior | | ---------------- | ----------------------------------------------------------------- | | **Unrestricted** | Commands run with no restrictions | | **Sandboxed** | Dangerous commands (`rm -rf`, `sudo`, etc.) require user approval | | **Locked** | Command execution is disabled entirely | ### Tool Policies You can configure per-command policies in `argent.json`: ```json theme={null} { "agents": { "defaults": { "toolPolicies": { "exec": { "mode": "sandboxed", "blockedCommands": ["rm -rf /", "sudo"], "allowedPaths": ["/Users/sem/projects/"] } } } } } ``` ### Approval Flow In sandboxed mode, when the agent attempts a command that requires approval: The command is shown to the user in the dashboard or channel. The user approves or rejects the command. If approved, the command executes. If rejected, the agent is informed and can try an alternative. ## Working Directory By default, commands run in the agent's workspace directory (configured in `argent.json`). The agent can specify a different `cwd` per command. ## Timeouts Commands that exceed the timeout are killed. The default timeout is 120 seconds (2 minutes). Long-running tasks should be broken into smaller steps or run in the background. ## Output Handling * **stdout** is returned as the tool result * **stderr** is included in the result with an error flag if the exit code is non-zero * Large outputs may be truncated to fit within token limits # Tools Overview Source: https://docs.argentos.ai/tools/index The 50+ tools available to ArgentOS agents — file operations, web research, memory, tasks, knowledge, communication, and more. ## What Are Tools? Tools are how an ArgentOS agent takes action. When the agent needs to run a command, search the web, recall a memory, or manage a task, it invokes a tool. Each tool is defined as a JSON schema, validated at runtime, and governed by the agent's intent policies and sandbox mode. The agent selects tools automatically based on conversational context. You do not need to tell it which tool to use — ask for what you need and the agent routes to the right capability. ## Tool Catalog `read`, `write`, `edit`, `bash`, `glob`, `grep` — full filesystem and shell access `browser`, `web_search`, `web_fetch`, `firecrawl` — browse, search, scrape `memory_store`, `memory_recall`, `memory_timeline` — persistent agent memory `tasks` — 15+ actions for full task lifecycle management `knowledge_search`, `knowledge_ingest`, `knowledge_collections` — RAG library with ACL `outbound_message`, `channel_send` — multi-channel delivery `sag`, `image_gen`, `doc_panel`, `canvas` — speech, images, document panels `os_docs`, `health`, `config`, `gateway`, `backup` — system operations `marketplace_search`, `marketplace_install`, `marketplace_publish` — package management ### File & Code | Tool | Description | | ------- | ---------------------------------------- | | `read` | Read file contents from disk | | `write` | Create or overwrite a file | | `edit` | Apply targeted edits to an existing file | | `bash` | Execute shell commands and scripts | | `glob` | Find files by pattern matching | | `grep` | Search file contents with regex | ### Web & Research | Tool | Description | | ------------ | ------------------------------------------------------------ | | `browser` | Automate web browsing — navigate, click, extract content | | `web_search` | Search the web via configured search provider | | `web_fetch` | Fetch a URL and return its content (with Firecrawl fallback) | | `firecrawl` | Deep web scraping and crawling via Firecrawl API | ### Memory | Tool | Description | | ----------------- | ---------------------------------------------------------------- | | `memory_store` | Save observations, facts, or context to persistent memory (MemU) | | `memory_recall` | Search and retrieve from memory using hybrid FTS + vector search | | `memory_timeline` | Browse memory chronologically with filtering | ### Tasks | Tool | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | `tasks` | Full task management — create, list, start, complete, block, prioritize, assign dependencies, organize into projects. 15+ actions in a single tool. | ### Knowledge & Library | Tool | Description | | ----------------------- | ------------------------------------------------------------------- | | `knowledge_search` | Search the RAG knowledge library (hybrid vector + BM25, ACL-scoped) | | `knowledge_ingest` | Ingest documents into knowledge collections (PDF, DOCX, XLSX, text) | | `knowledge_collections` | Manage collections, grants, and access control | ### Communication & Channels | Tool | Description | | ------------------ | -------------------------------------------------------------------- | | `outbound_message` | Send messages through the outbound pipeline (multi-channel delivery) | | `channel_send` | Send to a specific channel (Telegram, Discord, Slack, WhatsApp) | ### Media & Display | Tool | Description | | ----------- | ---------------------------------------------------------------- | | `sag` | Speech audio generation (text-to-speech via ElevenLabs or local) | | `image_gen` | Generate images via configured provider | | `doc_panel` | Open documents in the dashboard slide-out panel | | `canvas` | Send content to external node device screens | ### System & Configuration | Tool | Description | | --------- | ------------------------------------------------------------- | | `os_docs` | Read ArgentOS documentation and guides | | `health` | Check system health, gateway status, and service connectivity | | `config` | Read or update agent configuration | | `gateway` | Interact with the gateway control plane | | `backup` | Trigger or manage Phoenix backups (local/S3/R2) | ### Marketplace | Tool | Description | | --------------------- | --------------------------------------- | | `marketplace_search` | Search the AOS Marketplace for packages | | `marketplace_install` | Install a package from the marketplace | | `marketplace_publish` | Publish a package to the marketplace | ### Automation & Scheduling | Tool | Description | | ---------- | ----------------------------------------------------- | | `cron` | Manage scheduled jobs (create, list, enable, disable) | | `webhooks` | Register and manage inbound webhook triggers | ### Project Management | Tool | Description | | ----------- | --------------------------------------------------------------------------------------------------------- | | `specforge` | Kick off the SpecForge project intake workflow — type gating, interviews, drafts, approval, and execution | ## How Tools Activate Tools are selected by the LLM based on context. The flow: The LLM returns a `tool_use` block with the tool name and input parameters. The agent runtime validates input against the tool's JSON schema. Intent policies and sandbox mode are checked. The tool handler executes and returns a result. The result feeds back to the LLM as a `tool_result` block. You can guide tool selection by being specific ("search my memory for..." or "create a task to..."), but explicit tool names are never required. ## Tool Governance The [Intent System](/intents) controls which tools an agent can use. Intent policies define `allowedActions` and `requiresHumanApproval` lists that restrict tool access at three levels: * **Global** — baseline restrictions for all agents * **Department** — narrowed per department (e.g., Support agents cannot use `bash`) * **Agent** — per-agent overrides (most restrictive wins) Policies are monotonic: child levels can only tighten constraints, never loosen them. If Global allows a tool but the Department policy removes it, no agent in that department can use it. ## Sandbox Modes Tool execution is gated by the agent's security mode: | Mode | Behavior | | ---------------- | ------------------------------------------------------------------------------ | | **Unrestricted** | All tools available, no approval needed | | **Sandboxed** | Destructive tools (file writes, bash, outbound messages) require user approval | | **Locked** | Only safe, read-only tools (memory recall, task listing, search) are available | See [Sandboxing](/security/sandboxing) for configuration details. ## Extending Tools **Plugins** can register new tools at startup. See [Plugins](/tools/plugins). **Skills** bundle tools with prompts into loadable capability packages. See [Skills](/tools/skills). # MCP Integration Source: https://docs.argentos.ai/tools/mcp Connect to MCP servers to extend ArgentOS with external tools and data sources. Configure stdio and HTTP servers with filtering and security controls. ## What is MCP? The **Model Context Protocol** (MCP) is an open standard that lets AI agents communicate with external tool servers over a lightweight JSON-RPC transport. Each MCP server exposes a set of tools (and optionally resources) that the agent can call during a session. ArgentOS supports MCP natively — you define servers in your config and they become available as agent tools automatically. ## Configuration MCP servers are configured in `~/.argentos/argent.json` under the CLI backend that will use them. There are two approaches: Define servers directly in the backend config: ```json5 theme={null} { agents: { defaults: { cliBackends: { "claude-cli": { command: "claude", mcpServers: { "claude-mem": { command: "npx", args: ["-y", "claude-mem-mcp-server"], env: { CLAUDE_MEM_DB: "~/.claude-mem/claude-mem.db" } }, "linear": { command: "npx", args: ["-y", "@anthropic/linear-mcp-server"], env: { LINEAR_API_KEY: "lin_api_..." } } }, mcpConfigArg: "--mcp-config", strictMcpConfigArg: "--strict-mcp-config", strictMcpConfig: true } } } } } ``` ArgentOS writes the inline definitions to a temporary file at runtime and passes it to the CLI backend via the `mcpConfigArg` flag. Point to an existing MCP config JSON instead: ```json5 theme={null} { agents: { defaults: { cliBackends: { "claude-cli": { command: "claude", mcpConfigPath: "~/.argentos/mcp-servers.json", mcpConfigArg: "--mcp-config" } } } } } ``` The external file uses the standard MCP config format: ```json theme={null} { "mcpServers": { "linear": { "command": "npx", "args": ["-y", "@anthropic/linear-mcp-server"], "env": { "LINEAR_API_KEY": "lin_api_..." } } } } ``` When both `mcpConfigPath` and inline `mcpServers` are set, the external file takes precedence. ## Server Types The most common type. ArgentOS spawns the server as a child process and communicates over stdin/stdout. | Field | Description | | --------- | -------------------------------------------------- | | `command` | Executable to run (`npx`, `node`, `python`, etc.) | | `args` | Array of command-line arguments | | `env` | Environment variables injected into the subprocess | For servers running as standalone HTTP services: ```json5 theme={null} { "my-remote-server": { type: "http", url: "http://localhost:8080/mcp", headers: { "Authorization": "Bearer tok_..." } } } ``` ## Environment Variables Environment variables defined in `env` are merged into the subprocess environment. The parent process environment is inherited, so API keys already in your shell (like `ANTHROPIC_API_KEY`) are available without re-declaring them. For sensitive values, consider using ArgentOS encrypted secrets (`argent secrets set LINEAR_API_KEY`) and referencing them in your shell profile rather than storing plaintext keys in the config file. ## Strict Mode When `strictMcpConfig` is `true` (the default), ArgentOS appends the `strictMcpConfigArg` flag. This tells the CLI backend to reject unknown or malformed server entries rather than silently ignoring them. Disable it only if you need lenient parsing: ```json5 theme={null} { strictMcpConfig: false } ``` ## Security Considerations * **Subprocess isolation**: stdio servers run as child processes with your user permissions. Only run servers you trust. * **Environment leakage**: the child process inherits your full shell environment. Use `clearEnv` on the CLI backend to strip sensitive variables that the MCP server should not see. * **Network servers**: HTTP MCP servers are reachable by anything on the network. Use localhost bindings and auth headers for any server exposing sensitive data. **Config file permissions**: inline configs are written to temp files with mode `0600` (owner-read-write only) and cleaned up after the session. ## Reloading Servers MCP servers are spawned per CLI backend session. To pick up config changes: * **Gateway restart**: `argent gateway restart` — reloads the full config including MCP definitions. * **Config apply**: use `argent config apply` or the dashboard Config Panel to write and restart in one step. * **New sessions only**: existing agent sessions keep their original MCP servers. New sessions launched after a config change will use the updated definitions. There is no hot-reload for MCP servers within an active session. Restart the gateway or start a new session to apply changes. # MCP Platform Server Source: https://docs.argentos.ai/tools/mcp-server Expose ArgentOS as an MCP server so Claude Desktop, Cursor, Claude Code, and any MCP client can operate your agent system remotely — memory, tasks, projects, and direct agent conversation. ## Overview ArgentOS isn't just an MCP **client** (consuming external tool servers). It's also an MCP **Platform Server** — exposing the entire agent operating system over the Model Context Protocol. This means any MCP-compatible tool can: * Search and write to agent memory (MemU) * Query and create tasks and projects * Search the knowledge base (RAG library) * List family agents, schedules, and workforce jobs * **Talk directly to individual agents** — with full personality, tools, and memory * **Convene the Think Tank** for multi-perspective debate The MCP server runs on the gateway's existing HTTP port (`18789` by default). No additional services needed. ## Quick Start ```bash theme={null} argent gateway status ``` The MCP endpoint is enabled by default on `/mcp`. ```bash theme={null} cat ~/.argentos/argent.json | grep -A2 '"auth"' ``` See the [client configuration](#client-configuration) section below. ## Client Configuration Claude Desktop requires the `mcp-remote` stdio bridge. Edit `~/Library/Application Support/Claude/claude_desktop_config.json`: ```json theme={null} { "mcpServers": { "argentos": { "command": "npx", "args": [ "mcp-remote", "http://localhost:18789/mcp", "--header", "Authorization: Bearer " ] } } } ``` Restart Claude Desktop after saving. The `npx` call auto-installs `mcp-remote` on first run. Add to `~/.claude.json` or your project's `.mcp.json`: ```json theme={null} { "mcpServers": { "argentos": { "type": "streamable-http", "url": "http://localhost:18789/mcp", "headers": { "Authorization": "Bearer " } } } } ``` In your IDE's MCP settings: ```json theme={null} { "argentos": { "type": "streamable-http", "url": "http://localhost:18789/mcp", "headers": { "Authorization": "Bearer " } } } ``` ## Available Tools ArgentOS exposes **16 tools** across 7 categories: ### Memory | Tool | Description | | --------------- | ----------------------------------------------------------------------------- | | `memory_recall` | Search the agent's persistent memory (MemU) by keyword | | `memory_store` | Store a new memory with type classification, significance, and entity tagging | ### Knowledge | Tool | Description | | ------------------ | ------------------------------------------------------------------- | | `knowledge_search` | Search the RAG knowledge library with optional collection filtering | ### Tasks | Tool | Description | | -------------- | -------------------------------------------------------------------------------------------- | | `tasks_list` | List tasks filtered by status (pending, in\_progress, blocked, completed, failed, cancelled) | | `tasks_create` | Create a task with title, description, and priority | ### Projects | Tool | Description | | ---------------- | -------------------------------------------------------- | | `projects_list` | List projects with task counts and completion percentage | | `project_detail` | Get a project with all child tasks and their status | | `project_create` | Create a project with child tasks in one call | ### Operations | Tool | Description | | ---------------- | ---------------------------------------------------------------------- | | `family_list` | List all family agents with name, role, team, and live presence status | | `schedules_list` | List cron schedules and recurring jobs | | `jobs_list` | List workforce job assignments with recent run history | ### System | Tool | Description | | -------------- | ------------------------------------------------------------------------------------------------------------ | | `agent_status` | Agent name, model, gateway port, active MCP sessions, and local model health (LM Studio / Ollama up or down) | ### Conversation | Tool | Description | | ------------ | ------------------------------------------------------------------------------------ | | `agent_chat` | Talk directly to any family agent (Argent, Forge, Quill, etc.) | | `group_chat` | Message multiple agents by ID or team name, collect all responses | | `think_tank` | Convene Think Tank panelists (Dario, Sam, Elon, Jensen) for multi-perspective debate | `agent_chat` runs through the full `agentCommand` pipeline — SOUL.md, memory, tools, model routing, personality. The agent's response is stored in their session transcript and processed by the memory extraction pipeline. It's not a stripped-down version. ## Tool Reference | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------------------------------------------- | | `query` | string | yes | Search query — natural language or keywords | | `limit` | number | no | Maximum results (default 10) | | `type` | string | no | Filter by memory type: profile, event, knowledge, behavior, skill, etc. | | Parameter | Type | Required | Description | | -------------- | --------- | -------- | --------------------------------------------------------------- | | `content` | string | yes | The memory content to store | | `type` | enum | no | profile, event, knowledge, behavior, skill, tool, self, episode | | `significance` | number | no | Importance 1-10 (default 5) | | `entities` | string\[] | no | People, places, or things referenced | | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------- | | `query` | string | yes | Search query — natural language or keywords | | `limit` | number | no | Maximum results (default 10) | | `collection` | string | no | Filter by knowledge collection name | | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------------------------------ | | `status` | enum | no | pending, in\_progress, blocked, completed, failed, cancelled | | `limit` | number | no | Maximum results (default 20) | | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------------------------- | | `title` | string | yes | Task title | | `description` | string | no | Task description | | `priority` | enum | no | urgent, high, normal, low, background (default: normal) | | Parameter | Type | Required | Description | | --------- | ------ | -------- | ---------------------------- | | `status` | enum | no | Filter by project status | | `limit` | number | no | Maximum results (default 20) | | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `id` | string | yes | Project ID | | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ---------------------------------------------------------------- | | `title` | string | yes | Project title | | `description` | string | no | Project description | | `priority` | enum | no | urgent, high, normal, low, background (default: normal) | | `tasks` | array | yes | Child tasks — each with title, optional description and priority | No parameters. Returns all registered family agents with id, name, role, team, status, and live `alive` presence check (via Redis heartbeat). | Parameter | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------------------------- | | `includeDisabled` | boolean | no | Include disabled schedules (default: false) | | Parameter | Type | Required | Description | | --------- | ------ | -------- | ---------------------------- | | `agentId` | string | no | Filter by agent ID | | `limit` | number | no | Maximum results (default 20) | No parameters. Returns agent name, primary model, gateway port, active MCP session count, and health status for local model backends: * **LM Studio** — probes `127.0.0.1:1234` * **Ollama** — probes `127.0.0.1:11434` | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ------------------------------------------ | | `message` | string | yes | The message to send | | `agentId` | string | yes | Agent ID (e.g. 'argent', 'forge', 'quill') | | `thinking` | enum | no | off, low, medium, high (default: off) | Runs through the full agent pipeline. The agent gets their SOUL.md, memory context, tools, model routing — everything. | Parameter | Type | Required | Description | | ---------- | --------- | -------- | ----------------------------------------- | | `message` | string | yes | The message to send to all agents | | `agentIds` | string\[] | no | Specific agent IDs to include | | `team` | string | no | Team name (e.g. 'dev-team', 'think-tank') | | `thinking` | enum | no | off, low, medium, high (default: off) | Messages are sent sequentially. Each agent runs their full pipeline independently. Provide `agentIds`, `team`, or both. | Parameter | Type | Required | Description | | ----------- | --------- | -------- | -------------------------------------- | | `topic` | string | yes | The debate topic or question | | `panelists` | string\[] | no | Specific panelists (default: all four) | | `thinking` | enum | no | off, low, medium, high (default: low) | Panelists: **Dario** (risk/safety via Claude), **Sam** (product/scaling via GPT), **Elon** (first principles via Grok), **Jensen** (infrastructure). ## Configuration ```json theme={null} { "gateway": { "mcp": { "enabled": true, "allowedTools": ["memory_recall", "tasks_list", "agent_status"] } } } ``` | Field | Type | Default | Description | | -------------- | --------- | ------- | -------------------------------------------------------- | | `enabled` | boolean | `true` | Enable or disable the `/mcp` endpoint | | `allowedTools` | string\[] | all | Restrict which tools are exposed. Omit to expose all 16. | ## Authentication All MCP requests require the gateway Bearer token: ``` Authorization: Bearer ``` This is the same token used by the dashboard and WebSocket clients. Find it in `~/.argentos/argent.json` under `gateway.auth.token`. Unauthenticated requests receive HTTP 401. ## Transport The MCP server uses **Streamable HTTP** transport (MCP SDK v1.28+): | Method | Path | Purpose | | -------- | ------ | ------------------------------------------------------ | | `POST` | `/mcp` | JSON-RPC messages (initialize, tools/list, tools/call) | | `GET` | `/mcp` | SSE stream for server-to-client notifications | | `DELETE` | `/mcp` | Close a session | Sessions are created on the first `initialize` request. The server returns an `Mcp-Session-Id` header for subsequent requests. ## Security * **No filesystem access** — MCP tools cannot read, write, or execute files * **No shell commands** — `bash`, `exec`, `terminal` are never exposed * **No channel tools** — agents cannot send messages to external channels via MCP * **Auth mandatory** — same security boundary as the gateway * **ACL respected** — knowledge search honors collection-level access controls * **Think Tank is advisory** — panelists have read-only tool access * **Intent system active** — `agent_chat` respects intent hierarchy boundaries Use `allowedTools` to further restrict the attack surface for specific deployments. # Plugins Source: https://docs.argentos.ai/tools/plugins The ArgentOS plugin system — extend agent behavior with argent.plugin.json manifests. ## Overview Plugins are extensions that modify agent behavior at the runtime level. They can register new tools, inject system prompt context, intercept messages, and hook into the agent lifecycle. Plugins are the lowest-level extension mechanism in ArgentOS. For a hands-on guide to building your own plugin, see [Building Plugins](/tools/building-plugins). ## Plugin Location Plugins are discovered from two directories: ``` ~/.argentos/extensions/ # Global (user-level) .argent/extensions/ # Workspace (project-level) ``` Each plugin is a directory containing at minimum an `argent.plugin.json` manifest and an entry point (`index.ts` or `index.js`): ``` ~/.argentos/extensions/ ├── response-validator/ │ ├── argent.plugin.json │ └── index.ts ├── atera/ │ ├── argent.plugin.json │ └── index.ts └── canvas-docs-enforcer/ ├── argent.plugin.json └── index.ts ``` ## Plugin Manifest Every plugin has an `argent.plugin.json` manifest used for discovery and config validation: ```json theme={null} { "id": "my-plugin", "name": "My Plugin", "description": "What this plugin does", "version": "1.0.0", "configSchema": { "type": "object", "additionalProperties": false, "properties": { "apiKey": { "type": "string", "description": "API key (prefer service-keys.json)" } } }, "uiHints": { "apiKey": { "sensitive": true, "label": "API Key" } } } ``` ### Manifest Fields | Field | Required | Description | | -------------- | -------- | ------------------------------------------------------------ | | `id` | Yes | Unique plugin identifier | | `configSchema` | Yes | JSON Schema for plugin config (even if empty) | | `name` | No | Display name | | `description` | No | Short summary | | `version` | No | Semver version | | `uiHints` | No | UI hints for config fields (sensitive, labels, placeholders) | | `kind` | No | Plugin kind (e.g., `"memory"`) | | `channels` | No | Channel IDs registered by this plugin | | `providers` | No | Provider IDs registered by this plugin | | `skills` | No | Skill directories to load (relative to plugin root) | ## Plugin Capabilities ### Tool Registration Plugins register tools programmatically in their entry point via `api.registerTool()`: ```ts theme={null} export default function register(api: any) { api.registerTool({ name: "weather_lookup", description: "Look up current weather for a location", parameters: { type: "object", properties: { city: { type: "string", description: "City name" }, }, required: ["city"], }, async execute(_id: string, params: any) { const data = await fetchWeather(params.city); return { content: [{ type: "text", text: data }] }; }, }); } ``` Tools can be marked as **optional** (opt-in via allowlists): ```ts theme={null} api.registerTool({ /* ... */ }, { optional: true }); ``` ### System Prompt Injection Plugins can inject text into the agent's system prompt via the `before_agent_start` hook: ```ts theme={null} api.on("before_agent_start", async (ctx: any) => { ctx.systemPromptSuffix = "When creating documents, always use doc_panel."; }); ``` ### Lifecycle Hooks | Hook | When | Use Case | | -------------------- | --------------------- | ------------------------------------- | | `before_agent_start` | Before each agent run | Inject context, nudge agent for setup | ### Service Keys Plugins can read API keys from `~/.argentos/service-keys.json` (managed via the dashboard) rather than requiring separate configuration. See [Building Plugins](/tools/building-plugins#service-keys) for the full pattern. ## Plugin Allowlist If `plugins.allow[]` in `argent.json` has entries, only listed plugins are enabled: ```json theme={null} { "plugins": { "allow": ["atera", "canvas-docs-enforcer"], "entries": { "atera": { "enabled": true, "config": { } } } } } ``` Non-bundled plugins default to enabled when the allowlist is empty. ## Tool Name Conflicts When multiple plugins register tools with the same name, the **built-in tool wins**. Plugin tools with conflicting names are skipped silently. ## Managing Plugins ```bash theme={null} # List installed plugins argent plugins list # Enable/disable a plugin argent plugins enable argent plugins disable ``` ## Related * [Building Plugins](/tools/building-plugins) — End-to-end guide with service keys, config persistence, and hooks * [Marketplace](/marketplace) — Browse and install community packages # Skills, Plugins & Connectors Source: https://docs.argentos.ai/tools/skills Extend your agent with marketplace packages. Skills teach, plugins add runtime capabilities, connectors wire to external systems. Install with one command. ## Three Ways to Extend Your Agent ArgentOS has three extension types, each serving a different purpose: **Teaches** the agent how to do something. Injected as prompt instructions. No code runs. **Adds new tools** to the gateway runtime. Runs inside the gateway process. **Wires to external APIs** with auth and health checks. Runs as an isolated subprocess. | Type | What It Does | Runs Where | Example | | -------------- | -------------------------------------------------- | ------------------------------- | --------------------------------- | | **Skills** | Teaches the agent how to do something | Injected as prompt instructions | Deep Research Pro, SEO Audit | | **Plugins** | Adds new tools to the gateway runtime | Inside the gateway process | Think Tank, VIP Email Alert | | **Connectors** | Wires to external APIs with auth and health checks | Isolated subprocess | HubSpot, Google Workspace, Linear | ## Installing Packages ```bash theme={null} # Browse the marketplace argent marketplace search hubspot # Install a skill argent marketplace install deep-research-pro # Install a connector argent connectors install aos-hubspot ``` Or browse visually at [marketplace.argentos.ai](https://marketplace.argentos.ai). ## Skills A skill is a `SKILL.md` file — markdown instructions that tell your agent how to use an API, follow a workflow, or handle a specific task. No code runs. The agent reads the instructions and uses its existing tools to accomplish the task. ### SKILL.md Format ```yaml theme={null} --- name: my-skill description: What this skill does and when to use it. --- # My Skill Instructions for the agent go here. ## When to Use - User asks about X - User wants to do Y ## How It Works Step-by-step instructions, API endpoints, examples. ``` **Required fields:** `name` and `description` in the YAML frontmatter. The description is what triggers the skill — make it specific. ### Creating a Skill ```bash theme={null} mkdir my-skill && cd my-skill ``` Add the frontmatter and instructions as shown above. ```bash theme={null} tar czf my-skill-1.0.0.tar.gz my-skill/ # Upload at marketplace.argentos.ai/submit ``` ## Plugins A plugin is TypeScript code that runs inside the gateway. It registers new tools via `api.registerTool()`, hooks into agent events, and has full access to the runtime API. Plugins live at `~/.argentos/extensions/` and use an `argent.plugin.json` manifest: ```json theme={null} { "id": "my-plugin", "name": "My Plugin", "description": "What it does", "version": "1.0.0" } ``` Plugins are more powerful but carry more risk — they execute code inside your gateway process. See [Plugin Development](/tools/plugins) for the full guide. ## Connectors (AOS) Connectors are production-grade integrations with external APIs. They run as isolated subprocesses with their own: * **Authentication** — service keys resolved through the secret store * **Health checks** — `doctor` command validates connectivity * **Risk tiers** — `readonly-external`, `readwrite-external` * **Capability discovery** — commands and resources declared in `connector.json` Once installed, a connector's actions become agent tools automatically. ### Available Connectors Gmail, Drive, Calendar — 15 commands Contacts, deals, companies, tickets Invoices, payments, financial reports Issues, projects, workflow management Web scraping and content extraction Email campaigns and audience management Content publishing and page management Local business search and discovery ## Marketplace Security Every package in the marketplace goes through three-layer security: Scanned by 70+ antivirus engines. 25 prompt injection patterns, secret detection, dangerous code checks. The ArgentOS team reviews before publishing. Packages with a "VT Scanned" badge link directly to the VirusTotal scan report. ## Submitting to the Marketplace Sign in with GitHub at [marketplace.argentos.ai/submit](https://marketplace.argentos.ai/submit). Upload your `.tar.gz` package. Fill in display name, description, category, version, tags. Submit — security scanning runs automatically. If scans pass, the team reviews and approves. See the [Marketplace](https://marketplace.argentos.ai) for the full catalog. # Slash Commands Source: https://docs.argentos.ai/tools/slash-commands Quick actions you can trigger from any channel with slash command syntax. ## Overview Slash commands are shorthand actions you can invoke from any channel by prefixing a message with `/`. They provide quick access to common agent functions without needing to phrase a natural language request. ## Available Commands | Command | Description | | ----------------- | ----------------------------------- | | `/status` | Show agent status and system health | | `/tasks` | List current tasks | | `/task ` | Create a new task | | `/memory <query>` | Search agent memory | | `/forget <id>` | Delete a memory entry | | `/model` | Show current model and tier | | `/model <name>` | Switch to a specific model | | `/clear` | Clear the current session context | | `/help` | Show available commands | ## Using Slash Commands Send a slash command from any connected channel: ``` /tasks ``` The agent recognizes the slash prefix and executes the command directly instead of treating it as a conversational message. ### With Arguments Some commands accept arguments: ``` /task Review the Q4 security audit report /memory Jason's infrastructure specs /model claude-sonnet-4-20250514 ``` ## Dashboard Integration <Info> Slash commands also work in the dashboard chat input. The dashboard may render command results with special formatting (tables, status indicators) that channels display as plain text. </Info> ## Custom Slash Commands Plugins and skills can register custom slash commands: ```json theme={null} { "commands": [ { "name": "deploy", "description": "Deploy the latest build", "handler": "handlers/deploy.js" } ] } ``` ## Command vs Conversation The agent distinguishes between slash commands and natural language: | Input | Behavior | | ----------------------------------- | --------------------------------------------------------------------- | | `/tasks` | Executes the tasks command directly | | `Show me my tasks` | The agent interprets this conversationally and may use the tasks tool | | `What's on my task list for today?` | Natural language, agent decides how to respond | <Tip> Both approaches reach the same underlying tools, but slash commands skip the LLM reasoning step for faster execution. </Tip> ## Permissions Slash commands respect the same tool policies as regular tool use. If `exec` is restricted, the `/exec` command (if it existed) would also be restricted. # TOON Encoding Source: https://docs.argentos.ai/tools/toon-encoding How ArgentOS uses Token-Oriented Object Notation to save 40-50% on LLM prompt tokens. ## What is TOON? [TOON](https://github.com/toon-format/toon) (Token-Oriented Object Notation) is a compact data serialization format designed specifically for LLM prompts. It encodes structured data using 40-50% fewer tokens than JSON while remaining human-readable and LLM-parseable. ArgentOS uses TOON throughout the system wherever structured data needs to be injected into agent prompts. ## Why Not Just Use JSON? Every token in an LLM prompt costs money and takes up context window space. When you inject a 50-item task list or a 20-step workflow history into an agent's prompt, JSON's verbosity adds up fast: | Format | Tokens (typical) | Savings | | -------------- | ---------------- | -------- | | JSON (pretty) | 1,000 | baseline | | JSON (compact) | 750 | 25% | | TOON | 450-550 | 40-50% | TOON achieves this by using a tabular format for uniform arrays, eliminating repeated keys, and using minimal delimiters. ## Where ArgentOS Uses TOON TOON is integrated into 9 core systems via `src/utils/toon-encoding.ts`: ### Workflow Pipeline Context When an agent step runs inside a workflow, it receives the full pipeline history encoded as TOON: ``` [PIPELINE_CONTEXT] workflow.id: wf-123 workflow.runId: run-456 workflow.currentStep: 3 workflow.totalSteps: 5 steps: step | agent | status | duration | output 1 | research | completed | 12s | Found 5 relevant sources 2 | analyze | completed | 8s | Key findings extracted [/PIPELINE_CONTEXT] ``` This gives each agent full awareness of what happened before it, using a fraction of the tokens that JSON would require. ### Agent Handoffs When one agent passes work to another in a multi-agent workflow: ``` [AGENT_HANDOFF] from: research-agent to: writer-agent summary: Research complete — 5 sources analyzed, 3 key findings artifact: /tmp/research-output.md [/AGENT_HANDOFF] ``` ### Memory Recall Results When the agent recalls memories, results are TOON-encoded before injection: ``` [MEMORY_CONTEXT] results: id | type | significance | text | created m-1 | observation | high | User prefers concise answers | 2026-03-15 m-2 | interaction | medium | Discussed project timeline | 2026-03-20 [/MEMORY_CONTEXT] ``` ### SpecForge Task Breakdowns When SpecForge creates atomic tasks for a project: ``` [TASK_BREAKDOWN] project: Website Redesign tasks: id | agent | title | deps | status | acceptance 1 | frontend | Homepage layout | none | pending | Visual match mockup 2 | backend | API endpoints | none | pending | All tests pass 3 | frontend | Connect to API | 1,2 | blocked | Data loads correctly [/TASK_BREAKDOWN] ``` ### Other Integration Points * **Knowledge Library results** — RAG search results encoded for prompt injection * **Team status** — multi-agent family status updates * **Tool results** — uniform tool output arrays (search results, file listings) * **SIS active lessons** — self-improving system lesson injection * **Cron definitions** — scheduled task summaries ## How It Works in Code The encoding layer at `src/utils/toon-encoding.ts` provides typed functions: ```typescript theme={null} import { encodeForPrompt, encodePipelineContext, encodeHandoff, encodeMemoryResults, encodeTaskBreakdown, encodeTeamStatus } from "./utils/toon-encoding.js"; // Generic encoding with optional label const encoded = encodeForPrompt(data, "MY_CONTEXT"); // Typed encoders for specific use cases const pipelineCtx = encodePipelineContext({ workflow, steps, task }); const handoff = encodeHandoff({ from, to, summary, artifact }); const memory = encodeMemoryResults(results); const tasks = encodeTaskBreakdown(atomicTasks, projectName); const team = encodeTeamStatus(members); ``` All functions fall back to compact JSON if TOON encoding fails for a particular data structure. ## Decoding TOON content can be decoded back to structured data: ```typescript theme={null} import { decodeFromPrompt } from "./utils/toon-encoding.js"; const data = decodeFromPrompt(text, "PIPELINE_CONTEXT"); ``` Falls back to `JSON.parse` if TOON decoding fails. ## Learn More * [TOON Format Specification](https://github.com/toon-format/toon) * [npm: @toon-format/toon](https://www.npmjs.com/package/@toon-format/toon) # Web Search & Fetch Source: https://docs.argentos.ai/tools/web Give your agent the ability to search the web and fetch content from URLs. ## Overview ArgentOS includes two web tools: `web_search` for searching the internet and `web_fetch` for retrieving content from specific URLs. Both are available to your agent automatically once configured. ## Setup Web search requires an API key from one of two supported providers. ### Brave Search (Recommended) 1. Get a free API key at [brave.com/search/api](https://brave.com/search/api/) 2. Configure it in one of three ways: **Option A: Config file** (recommended) Add to `~/.argentos/argent.json`: ```json theme={null} { "tools": { "web": { "search": { "apiKey": "YOUR_BRAVE_API_KEY", "provider": "brave" } } } } ``` **Option B: Environment variable** Set `BRAVE_API_KEY` in the Gateway environment. **Option C: Interactive setup** ```bash theme={null} argent configure --section web ``` ### Perplexity Sonar (AI-Synthesized Answers) Perplexity returns AI-generated answers with citations instead of a list of links. ```json theme={null} { "tools": { "web": { "search": { "apiKey": "pplx-YOUR_KEY", "provider": "perplexity" } } } } ``` Perplexity keys starting with `pplx-` connect directly. Keys starting with `sk-or-` route through OpenRouter. ## web\_search The agent uses this tool to search the internet for current information. ### Parameters | Parameter | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------------------------------------- | | `query` | string | Yes | Search query | | `count` | number | No | Number of results (1-20, default 5) | | `country` | string | No | 2-letter country code (e.g., "US", "DE") | | `search_lang` | string | No | Language code (e.g., "en", "fr") | | `freshness` | string | No | Time filter: "pd" (day), "pw" (week), "pm" (month), "py" (year) | ### Output (Brave) ```json theme={null} { "query": "argentos personal ai", "provider": "brave", "count": 3, "tookMs": 234, "results": [ { "title": "ArgentOS - The Operating System for Personal AI", "url": "https://argentos.ai", "description": "Run your own AI agent on your hardware...", "published": "2 days ago", "siteName": "argentos.ai" } ] } ``` ### Output (Perplexity) ```json theme={null} { "query": "argentos personal ai", "provider": "perplexity", "content": "ArgentOS is a personal AI operating system that runs on your hardware...", "citations": ["https://argentos.ai", "https://github.com/ArgentAIOS"] } ``` ## web\_fetch Retrieves and extracts readable content from a URL. Useful when the agent needs to read a specific page. ### Parameters | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------ | | `url` | string | Yes | URL to fetch | | `extractMode` | string | No | "markdown" (default) or "text" | | `maxChars` | number | No | Maximum content length | ### Security * Private IPs, localhost, and cloud metadata endpoints are blocked (SSRF protection) * Readability mode extracts article content, stripping navigation and ads * Optional Firecrawl integration for JavaScript-heavy pages ## Configuration Options All options in `~/.argentos/argent.json` under `tools.web.search`: | Option | Default | Description | | ----------------- | ------- | ---------------------------------------- | | `provider` | "brave" | Search provider: "brave" or "perplexity" | | `apiKey` | - | Provider API key | | `maxResults` | 5 | Default number of results | | `timeoutSeconds` | 30 | Request timeout | | `cacheTtlMinutes` | 15 | How long to cache results | ## Rate Limits * Brave free tier: 1 request per 1.1 seconds (enforced automatically) * Perplexity: No client-side rate limit * Results are cached for 15 minutes by default to reduce API calls ## Without an API Key If no API key is configured, `web_search` returns a helpful error with setup instructions. The agent will tell you it can't search the web and suggest how to enable it. # Control UI (Dashboard) Source: https://docs.argentos.ai/web/control-ui The web-based dashboard for managing your ArgentOS agent — chat, tasks, configuration, and more. ## Overview The ArgentOS Control UI is a web dashboard for interacting with and managing your agent. It connects to the gateway via WebSocket and provides a full admin interface. **Dashboard URL:** `http://127.0.0.1:8080/` **Gateway WebSocket:** `ws://127.0.0.1:18789` ## Accessing the Dashboard ### With Token (Recommended) The dashboard requires your gateway token to connect. Get the tokenized URL: ```bash theme={null} argent dashboard ``` This copies the URL to your clipboard and opens it in your browser. The URL includes your token: ``` http://127.0.0.1:8080/?token=YOUR_GATEWAY_TOKEN ``` ### Via Argent.app On macOS, Argent.app embeds the dashboard and handles authentication automatically. ### Finding Your Token Your gateway token is stored in `~/.argentos/argent.json`: ```json theme={null} { "gateway": { "auth": { "mode": "token", "token": "your-token-here" } } } ``` After the first successful connection, the token is stored in your browser's localStorage so you don't need to include it in the URL every time. ## Features ### Chat Talk to your agent directly from the dashboard. Features include: * Real-time streaming responses * Tool execution cards (see what tools the agent uses) * Abort running requests * Session history ### Tasks & Projects Visual task management: * Create, assign, and track tasks * Project-based organization * Kanban board view * Priority and status tracking ### Configuration Edit your agent's settings without touching config files: * Model selection and provider configuration * Channel setup (Telegram, Discord, Slack, etc.) * Auth profile management (API keys, OAuth) * Intent policies and safety rules ### Alignment Docs Editor Edit your agent's personality and behavior documents: * SOUL.md, IDENTITY.md, USER.md, TOOLS.md * Git-backed version history * Auto-save with unsaved changes indicator ### Workflows Visual multi-agent pipeline builder: * Drag-and-drop workflow canvas * 5 node types: Trigger, Agent, Action, Gate, Output * 62 connector integrations * Run history and live execution highlighting ### Operations (Business Tier) * Workflow Map — orbital visualization of agents and providers * Workloads — cron job monitoring by agent * Task Manager — Kanban with blocked column * Org Chart — agent family hierarchy * Schedule — cron job definitions ## Architecture The dashboard runs as two services: | Service | Port | What It Does | | ----------------- | ----- | ----------------------------------------------------- | | **Dashboard UI** | 8080 | React web app (serves HTML/JS/CSS) | | **Dashboard API** | 9242 | Express server (tasks, settings, media, proxies) | | **Gateway** | 18789 | WebSocket RPC (agent runtime, chat, real-time events) | The UI on port 8080 connects to: * The **Gateway WebSocket** on 18789 for real-time chat, events, and RPC calls * The **Dashboard API** on 9242 for tasks, settings, media, and proxy requests ## Security <Warning> The Control UI is an admin surface with full access to your agent's configuration, chat, and tools. Do not expose it on a public network without proper security. </Warning> ### Recommended Access Methods 1. **Localhost only** (default) — Dashboard only accessible from the local machine 2. **Tailscale Serve** — HTTPS access via your Tailscale network 3. **SSH tunnel** — `ssh -L 8080:127.0.0.1:8080 your-server` ### Token Security * Tokens are compared using timing-safe comparison to prevent timing attacks * After first use, tokens are stored in `localStorage` and removed from the URL * Rotate your token: edit `gateway.auth.token` in `~/.argentos/argent.json` and restart ### CORS The Dashboard API allows requests from: * `http://localhost:8080` and `http://127.0.0.1:8080` * `http://localhost:5173` (Vite dev server) * `http://localhost:18789` and `http://127.0.0.1:18789` (Gateway) ## Troubleshooting ### Dashboard shows white page The dashboard build may be missing. Rebuild: ```bash theme={null} cd ~/argentos/dashboard npx vite build ``` ### "Token mismatch" error Open the dashboard with your token: ```bash theme={null} argent dashboard ``` Or manually: `http://127.0.0.1:8080/?token=YOUR_TOKEN` ### API returns 401 Unauthorized The dashboard API server enforces token auth. Make sure you're accessing the dashboard with the `?token=` parameter in the URL. ### Port 8080 not responding Check if the dashboard UI service is running: ```bash theme={null} lsof -i :8080 ``` If not, start it: ```bash theme={null} cd ~/argentos/dashboard npx vite preview --port 8080 --host 127.0.0.1 & ``` ### Port 9242 not responding The API server is spawned automatically by the gateway. Restart the gateway: ```bash theme={null} argent gateway restart ```