AI and Agents•4 min read

Valstorm Agent for Developers & Engineers

A technical guide covering the ReAct loop, developer toolbelt, LSP diagnostic feedback, multi-provider routing, and CLI workflows.

vsagent is a standalone, local-first AI engineering runtime and CLI companion designed for monorepo development, automated testing, and enterprise operations.

It executes an autonomous ReAct (Reason + Act) loop that bridges large language models directly with your local shell, file tree, compiler diagnostics, and backend APIs.


šŸ— The Core ReAct Architecture

Traditional LLM integrations are stateless: you send a prompt, you get a string back.

vsagent uses an event-driven ReAct execution engine (core/react.py):

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ User Prompt │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ LLM Step Generation │ │ • Emits Thought & ToolCall │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ Tool Execution Engine │ │ • Sandbox Dispatch & LSP Check │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā–¼ ā–¼ [More actions needed] [Task Complete] Observation fed back to LLM Final Answer Rendered

Turn Lifecycle & Telemetry

Every turn tracks:

  • Token telemetry: Input, output, and cumulative tokens per message and session.
  • Duration & Execution Latency: Per-tool execution timing in milliseconds.
  • Payload Size & Truncation: Automatic protection buffers ensuring oversized outputs don't blow out the context window.

🧰 The Developer Toolbelt

vsagent exposes high-performance software engineering tools:

Tool NameWhat It DoesKey Capabilities
patch_fileAtomic targeted find-and-replaceGenerates unified diffs, enforces unique string matching, runs live LSP checks.
write_fileFile creation & overwriteCreates parent directories automatically, atomic write via temp files, runs live LSP checks.
read_fileBudgeted line reading1-indexed line numbers with pagination offset and limit guards.
search_filesRipgrep / Regex grep & file searchHigh-speed native rg search ignoring .git, node_modules, and build artifacts.
terminal_execAsync shell executionNon-blocking subprocess execution with timeout and output windowing.
execute_codeIn-process Python runtimeRuns multi-step scripts with pre-bound tool helpers in a single turn.

⚔ Live LSP Compiler Diagnostic Loop

One of the biggest problems with coding agents is that they frequently introduce subtle syntax errors, missing imports, or broken types.

vsagent solves this with an in-memory Language Server Protocol (LSP) and compiler feedback loop (core/lsp/):

1. Agent invokes `patch_file("apps/api/main.py", ...)` 2. Tool writes changes to disk atomically. 3. LSP engine runs immediate background diagnostics (<100ms for AST/JSON/YAML, <1.5s for TypeScript/Go/Rust). 4. If errors are found, they are appended directly to the tool output: Successfully patched apps/api/main.py. [LSP Compiler Diagnostics]: - Line 42: Type error: Argument 'tenant_id' cannot be None (expected str). - Line 48: NameError: 'datetime' is not imported. 5. The agent immediately self-corrects on Turn 2 before running any tests!

🌐 Universal Model Freedom & BYOK

vsagent is not locked to a single model provider. It supports native adapters (Gemini, Claude, OpenAI) and any OpenAI-compatible API endpoint (DeepSeek, Groq, Moonshot/Kimi, Mistral/Codestral, and local Ollama):

1. Cloud Providers:

BASH
# Set your API keys vsagent keys set deepseek sk-your-key vsagent keys set groq gsk-your-key vsagent keys set anthropic sk-ant-your-key # Chat with specific models vsagent chat --provider deepseek --model deepseek-chat vsagent chat --provider groq --model llama-3.3-70b-versatile vsagent chat --provider anthropic --model claude-3-7-sonnet-20250219

2. Local & Zero-Telemetry Mode (Ollama / vLLM):

Run completely private models offline on Apple Silicon or Linux GPUs with $0 API cost and zero telemetry transmission:

BASH
# Start Ollama with Qwen 2.5 Coder ollama run qwen2.5-coder:32b # Connect vsagent directly to localhost:11434 vsagent chat --provider ollama --model qwen2.5-coder:32b

āŖ Transactional Git Snapshots & /undo

Before executing any file mutation, vsagent creates an internal Git working-tree snapshot. If an agent refactor goes off track, you can revert it immediately:

TEXT
[developer] > /undo āœ” Successfully rolled back working tree to turn #3 checkpoint.

This restores all modified files to their exact pre-turn state and trims the conversational turn from memory.


šŸ“‹ Standard CLI Commands

BASH
# Interactive Chat REPL with a specialized role vsagent chat --profile developer vsagent chat --profile researcher vsagent chat --profile architect # Single-Shot Task Execution vsagent run "Inspect apps/api and run the pytest suite" vsagent run --provider deepseek "Refactor database query logic in apps/api" # Status & Keys Management vsagent status vsagent keys list vsagent keys set gemini <KEY> # Memory & Skills vsagent memory list vsagent memory add "Prefers uv for Python dependencies" --target memory vsagent skills list vsagent skills show systematic-debugging