Older documentation. Start with the current guides.

Interactive agent development

micro chat exposes the framework’s agent, model, memory, tools, and RPC interfaces. Developers can replace or extend those components in Go. Mu can host them with its own product services.

Start working

go install go-micro.dev/v6/cmd/micro@master
export PATH="$(go env GOPATH)/bin:$PATH"
micro chat

This page describes the development version on master; the latest tagged release does not yet include this experience. First launch offers a provider choice and a hidden API key prompt. A single configured provider environment key skips setup. Settings are saved per project. /login replaces an entered key; flags and environment credentials take precedence on restart.

Plain micro chat starts the built-in development agent. micro chat NAME connects to a registered agent without a local model key. Inside chat, /agents lists available agents, /agent NAME connects to one, and /agent micro returns to the built-in agent. The prompt identifies the selected agent, and each keeps its own conversation.

Use /model and /provider to change the local configuration without clearing history. /models queries the live provider catalog; /model ID works without catalog support. Settings and entered credentials are scoped to the project and provider endpoint. Environment keys are not copied into settings. Remote agents advertise their model but retain control of their configuration.

The optional model.ModelLister interface lets providers implement discovery. Catalogs currently cover OpenAI, Anthropic, Gemini, Groq, Mistral, and Together. Catalog IDs do not guarantee account access or suitability for tool use.

Interaction and conversations

The prompt shows micro (working) > during a request and returns to micro > when it finishes. /help groups the available controls.

Local chat uses agent.CompactMemory(50, 20) and explicit compaction keeps 12 recent messages. The default summary is deterministic and lossy; original archived messages remain searchable. Search is case-insensitive substring matching, not semantic retrieval. Custom memory backends can implement agent.MemoryRecall and agent.MemoryCompactor.

Local agents also have a memory_search tool, so you can ask about an earlier decision in normal conversation. It retrieves matching user and assistant messages, including archived originals, and identifies their source sessions. This is keyword retrieval, not semantic search or automatic fact extraction. The tool returns up to 20 excerpts, each limited to 2,000 characters.

Go callers can use agent.SearchSessions(ctx, store, name, allowedIDs, query, limit) to retrieve from an explicit set of conversations. Results are ranked by matching query words; ties follow the supplied session order, then newest message first. The caller chooses and authorizes the IDs. The function never lists other sessions or searches other agents. Custom memory backends can implement their own recall.

The local CLI scopes recall to its project. Hosted agents do not inherit that local catalog or gain cross-user recall automatically. Hosts can expose an ordinary tool backed by SearchSessions, supplying only sessions their caller may access.

Go callers use agent.Session(id), agent.LoadHistory, agent.SearchHistory, agent.ListSessions, and agent.CompactHistory. RPC clients use agent.WithSession(ctx, id) and the generated AgentSessions client. Custom memory needs agent.SessionMemory for isolated RPC conversations. The CLI checks capabilities across every registered node during rolling upgrades.

A session ID selects state; it does not authorize access. Hosts apply the same access policy to conversation, task, and schedule endpoints as to chat.

Streaming and tools

model.WithTokenHandler receives incremental text during Generate, preserving the provider’s tool loop. OpenAI, Anthropic, Gemini, Groq, Mistral, Together, and MiniMax support this path. Atlas Cloud, Ollama, and custom providers without this option return their completed reply through the same agent stream. Responses retain their newlines and indentation.

agent.StreamAsk emits text and local tool events. The CLI also displays incremental foreground command output. Connected hosts send the same tool activity and approval prompts through AgentInteraction.Chat. Use /approve or /deny for the displayed action, just as in local chat. Disconnecting or stopping chat cancels pending approvals; completed actions are not rolled back. Older hosts continue to use the reply-only StreamChat endpoint. Visible partial model output is not automatically retried.

agent/workspace supplies reads, search, exact edits, writes, command execution, skills, and managed background commands as ordinary agent.WithTool handlers. Root instructions load at startup; reading a file includes its parent-directory AGENTS.md instructions. Agents are instructed to read before editing.

Skills load on demand from .agents/skills/NAME/SKILL.md. The CLI also reads ~/.agents/skills; project skills take precedence. workspace_save_skill creates a reusable procedure after approval and refuses to overwrite an existing skill. Hosts can add read-only libraries with workspace.WithSkills.

work, err := workspace.New(".")
if err != nil { return err }
defer work.Close()
options := append(work.Tools(), agent.WithApproval(approve))
assistant := agent.New(options...)

Foreground commands have a two-minute limit and bounded output. A command with background: true belongs to the workspace until it exits or is stopped with workspace_process. Go callers use Workspace.Start, Processes, Stop, and Close. Hosts must close the workspace on shutdown. These processes survive a request’s cancellation, not a host crash.

File tools are restricted to the workspace. Commands use host permissions by default. workspace.WithContainer(image) or micro chat --sandbox IMAGE runs commands through Docker with a writable workspace mount, a read-only root, networking disabled, dropped capabilities, and resource limits. The image needs sh; Docker must be installed. Service and web tools retain their host policies.

Work independent of chat

# Keep this host running in one terminal.
micro chat --host project
# Connect from another terminal:
micro chat project

The CLI host listens on loopback. It permits read-only workspace tools and asks the connected chat to approve other actions. Unattended tasks have no approval connection and are refused when they need a decision. Use --yes on the host only when you want to allow unattended tool actions.

Custom hosts opt in with agent.WithApproval(agent.RequestApproval), or call RequestApproval from their own policy after checking the proposed tool. Client decisions cannot override that policy. agent.ToolOutput(ctx, text) sends tool output through the current stream; workspace hosts can use workspace.WithOutput(agent.ToolOutput). Hosts must authenticate and authorize clients before exposing the interactive endpoint.

Use /background MESSAGE, /tasks, /task ID, and /cancel ID. Exiting chat leaves submitted work on its host. The recorded owner address is used when reconnecting; failed submissions are not automatically retried. Stopping the host cancels active tasks. A crash does not automatically replay unfinished work or its external actions.

Applications use agent.StartTask, GetTask, and StopTask, or the generated AgentTasks RPC client. Task IDs are the corresponding agent run IDs. Results are stored in the selected conversation and remain inspectable after completion.

/schedule 1h MESSAGE saves a recurring request; /schedules lists definitions and /unschedule ID removes future dispatches. Go callers use agent.ScheduleTask, ListSchedules, and RemoveSchedule. Each dispatch creates an inspectable background agent task.

Schedule definitions and next dispatch times survive restarts. Intervals are at least one minute. Missed intervals coalesce into one dispatch; the next time is saved before dispatch so an interrupted task is not automatically replayed. One host owns scheduling for an agent/store namespace. This is an interval scheduler, not a distributed cron service. Removing a schedule does not cancel an already-running task.

Web and extension points

agent/web provides bounded HTTP(S) fetching and an optional SearchFunc. The CLI enables Brave search with BRAVE_SEARCH_API_KEY. Hosts can supply their own search service. Fetched pages are untrusted data and tool approvals still apply. These are web research tools, not JavaScript browser automation.

Services remain tools discoverable through the registry. Developers can provide models, memory, approval policies, tool wrappers, web adapters, and workspace options without using the CLI. No product-specific assistant runtime is required.

Feature coverage

AreaCurrent scope
Model/provider selectionIn-chat selectors, live catalogs, endpoint-scoped settings
Instructions and skillsNested instructions, project/personal loading, approved skill creation
Terminal interactionMarkdown replies, editing, completion, multiline composition, queues, cancellation and correction
Live outputProvider text, local/remote tool activity and command output; some providers retain buffered fallback
ConversationsSaved context, remote catalog/history, reconnect to a conversation
MemoryCompaction, archive search, and scoped cross-conversation keyword recall
Background commandsHost-owned processes with list/stop/cleanup
Work after UI exitSubmitted tasks on a running agent host
Scheduled workPersisted intervals dispatched by the agent host
Isolated commandsOptional Docker execution; host tools have separate policies
Programmatic extensionExisting interfaces plus optional capabilities and ordinary tools
DelegationExisting agent delegation with visible local target/task and agent listing
Web researchFetch and configurable search; full browser automation remains external

The terminal prints completed Markdown paragraphs and fenced code blocks as they arrive, and prints the unfinished block when the reply ends. Each block appears once. Content containing brackets is held until completion to preserve Markdown reference links. Command output stays plain text; incomplete lines wait for a newline or completion. It uses the terminal’s foreground and background and respects NO_COLOR; piped output retains Markdown source. No separate graphical UI is included. Live streaming for all providers, distributed scheduling, and full browser automation remain limits.