Documentation Index
Fetch the complete documentation index at: https://docs.argentos.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
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:- Lesson injection via SIS — injects relevant lessons into the system prompt
- Provider calls — streaming or non-streaming LLM invocations
- Tool execution — processes tool calls from the LLM response
- Episode recording — captures structured episodes for contemplation
- History updates — appends turn results to session history
Session Manager
Append-only JSONL conversation storage with tree structure:- Tree-structured entries — each entry has
idandparentIdfor 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 contentswrite_file— Write file contentsedit_file— Edit with diffbash— Execute shell commands
Skills
Skills loaded from.md files with YAML frontmatter:
argent-ai: LLM Layer
Provider Registry
Central registry for LLM providers. Each provider implements theProvider interface:
Provider Implementations
Seven providers insrc/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 |
| 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: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 theARGENT_RUNTIME=true environment variable:
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
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.
