DocsGetting started

Getting started

From your first prompt to a harness of your own. Install PyLattice, explore Code Mode, and make the agent work your way.

PYTHON 3.11+TERMINAL FIRSTOPEN SOURCE
TUTORIAL / HARNESS MODS

Build an agent that fits.

Write a Python factory, add a tool, and run your own harness. Start with a working offline example.

Build your first mod →

Install PyLattice

You need Python 3.11 or newer, Git, and uv. Run these commands in a terminal:

Terminal · install
git clone https://github.com/Protocol-Lattice/PyLattice.git
cd PyLattice
uv sync

The commands in these docs assume you are in the repository root. PyLattice uses the current directory as its workspace unless you pass --workspace PATH.

Run your first task

Try the offline demo

After installing dependencies, the demo runs without credentials or model requests.

Terminal · offline demo
uv run agent-tui --demo

Try “Help me understand this project.” The demo uses scripted responses to show the interface and tool flow.

Connect the live agent

Copy the environment template, then add your OPENROUTER_API_KEY to the workspace’s .env file.

Terminal · environment
cp .env.example .env
.env · add this setting
OPENROUTER_API_KEY=your_key_here
Terminal · launch
uv run agent-tui --prompt "Help me understand this project."

The executor defaults to openrouter/free; the decision model defaults to typesafe/jev-1.13. Use --model and --router-model to select other models.

Follow the work. Expand tool traces to inspect actions, respond to approval prompts, and press Esc to cancel a running program.

Choose a run mode

Common launch commands
CommandBehavior
uv run agent-tuiCode Mode by default: the decision model selects a Python tool program or a final answer.
uv run agent-tui --no-code-modeUse the planner and Harness Router MCTS to select individual tools.
uv run agent-tui --fastUse Jev routing without the planner; selects the per-tool loop.
uv run agent-tui --read-onlyDisable mutating tools, including file writes and commands.
uv run agent-tui --demo --no-code-modeTry the routed loop offline.

--routing, --route-mcts, --no-planner, and --fast select the per-tool loop. Use --fast for routing without planning; MCTS requires the planner.

Configure your workspace

Terminal · workspace and limits
uv run agent-tui --workspace /path/to/project --context-chars 64000 --max-steps 24
uv run agent-tui --help
Frequently used settings
FlagWhat it controls
--context-chars NRequest context budget; also configurable with AGENT_TUI_CONTEXT_CHARS.
--max-steps NModel turns per task. A Code Mode turn can contain multiple tool actions.
--command-timeout SECONDSTime limit for a workspace command.
--no-memoryDisable persistent workspace memory.
--skills-dir PATHAdd a skill collection. Repeat for multiple directories.
--extensions PATHLoad MCP servers and command hooks from TOML.
--mods PATHSelect trusted Python component factories using a TOML manifest.

Explicit CLI values take precedence over supported environment settings. The CLI loads .env from the selected workspace without overwriting variables already set in your environment.

Find your way around

Commands inside the terminal app
CommandUse it to
/helpList interactive commands.
/context · /compactInspect context usage or shorten conversation history.
/skills · /skill NAMEList workflows or pin one across tasks.
/pluginsInspect the plugin marketplace and installed plugins.
/mcp · /hooksInspect server status and middleware hooks.
/memoryInspect saved workspace notes and outcomes.

Keep building