Constellation is an orchestration library for multiplexing AI agent CLIs. It publishes under the module path github.com/apsis-ai/constellation and currently keeps the CLI binary name agents-mux.
- Multi-agent support — Claude, Codex, OpenCode, and Cursor via subprocess spawning
- Session management — Create, list, delete sessions with SQLite persistence
- Real-time streaming — SSE broadcasting with ring buffer for reconnection support
- Queue system — Position-based follow-up queue with pause/resume and atomic processing
- Conversation persistence — Dual storage via SQLite messages table and JSONL files
- Lifecycle management — Idle timeouts, handoff on token exhaustion, process group cleanup
- Attachment handling — File upload, validation, and resolution for agent prompts
- Agent registry — Static + dynamic agent registration with binary discovery
- Speech-to-text — Whisper integration for audio transcription
- Environment isolation — Isolated config directories prevent agent CLI leakage
The public module path is github.com/apsis-ai/constellation.
go get github.com/apsis-ai/constellationRequires Go 1.24+.
package main
import (
"fmt"
"log"
mux "github.com/apsis-ai/constellation"
)
func main() {
mgr, err := mux.NewManager(mux.Config{
DBPath: "./data/agents.db",
})
if err != nil {
log.Fatal(err)
}
defer mgr.Close()
// Send a prompt to Claude
result, err := mgr.Send(mux.SendRequest{
Prompt: "Hello, what can you help me with?",
Agent: "claude",
})
if err != nil {
log.Fatal(err)
}
// Stream events
for event := range result.Events {
switch event.Type {
case mux.ChanText:
fmt.Print(event.Text)
case mux.ChanAction:
fmt.Printf("\n[Action] %s\n", event.Text)
case mux.ChanAskUser:
fmt.Printf("\n[Question] %s\n", event.Text)
}
}
}- Architecture — System design, data flow, and component overview
- Configuration — Manager config, interfaces, and environment setup
- API Reference — Public API methods and types
- Queue System — Follow-up queue management
- Broadcasting — SSE event streaming and reconnection
- Agents — Supported agents, parsers, and registry
| Agent | CLI Binary | Default Model | Output Format |
|---|---|---|---|
| Claude | claude |
sonnet | NDJSON (assistant/result) |
| Codex | codex |
o4-mini | NDJSON (item.completed/turn.completed) |
| OpenCode | opencode |
— | NDJSON (text/tool_use/step_finish) |
| Cursor | agent |
— | NDJSON (assistant/tool_call/result) |
- Perigee — Apsis remote desktop workspace. This library was extracted from its session management. Both projects are co-developed and may be modified together.
- Go 1.24+
- At least one agent CLI installed on PATH (
claude,codex,opencode, oragent) - Optional:
whisper.cppbinary for speech-to-text
MIT