Documentation / start
Build a coding assistant
Build a useful coding assistant from one model call to a durable, tool-using Harness session with a workspace, sandboxed processes, and your choice of interface.
This tutorial builds a coding assistant that can answer a question, inspect files through declared tools, keep a resumable session, work inside a session-owned directory, and confine process tools. The final runtime is independent of its presentation, so you can keep the CLI or attach the TUI, Web UI, ACP, or MCP later.
What you will build
%%{init: {"theme":"dark"}}%%
flowchart LR
U[CLI input] --> S[Harness Session]
S --> L[Loop]
L --> I[Inference Client]
L --> T[Read-only Tools]
S --> J[Session Store]
S --> W[Workspace]
T --> X[Sandboxed Process]
S --> E[Events]
E --> U
The tutorial uses one project named looprig-coding-assistant. Each page adds one boundary without changing the responsibilities added earlier.
How the pieces fit
| Module | Responsibility in the assistant | Added when |
|---|---|---|
| Core and Inference | Messages, model identity, requests, responses, and streaming | First model call |
| LLM | OpenAI, Anthropic, Ollama, and other provider clients | Model configuration |
| Harness | Loop, Rig, Session, commands, events, tools, and shutdown | Agent runtime |
| Tools | Read, search, edit, process, interaction, and delegation definitions | Tool registration |
| Fsstore and Storage | Durable session history and workspace snapshots | Persistence |
| Sandbox | Native confinement for child processes | Process execution |
| TUI or Client | Terminal and framework-neutral browser presentation | Interface selection |
You do not need to adopt the full stack at once. Inference is useful by itself. Harness becomes useful when you need a live agent runtime. Storage, Sandbox, protocols, workflows, and interfaces remain optional composition boundaries.
Tutorial path
- Create the Go project.
- Connect a model with Inference.
- Run the agent with Harness.
- Add read-only tools and gates.
- Persist and restore sessions.
- Add a session workspace.
- Sandbox process tools.
- Run the coding assistant CLI.
- Choose an interface and extend the agent.
Start with the project directory. You will have a working model call before introducing Harness.