ghostwright/phantom
A self-hosted Bun AI coworker with persistent memory and extensible MCP tools
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Phantom is a persistent TypeScript service on Bun, not a library embedded in a client. Slack, web chat, Telegram, email, webhooks, and the CLI feed a shared runtime built around @anthropic-ai/claude-agent-sdk query() and hooks. The prompt assembler combines base instructions, a YAML-defined role, evolved configuration, and retrieved memory. Qdrant holds three collections for tiered vector memory, Ollama provides embeddings, and SQLite is a separate component of the stack.
The runtime also acts as an MCP server. External clients connect over Streamable HTTP to invoke eight universal tools plus role-specific and dynamically registered tools. Dynamic tools persist across restarts, so a newly generated capability can become a lasting integration surface. The package exposes a phantom CLI and a build:chat-ui script; chat-ui/ and the dependencies @modelcontextprotocol/sdk, @slack/bolt, and telegraf reflect the separation between the browser interface, protocol layer, and messaging adapters.
Key Capabilities & Differentiators
Phantom can run recurring work in a dedicated environment, publish authenticated pages, and send reports under its own email identity. Its six-step evolution pipeline proposes changes to agent configuration between sessions, applies five validation gates, can use LLM judges, and records versions for rollback. This changes configuration rather than training model weights. Runtime tool registration is a separate mechanism: it lets Phantom expose a new capability through MCP without waiting for a release.
Model routing is configured in YAML. Anthropic is the default; Z.AI, OpenRouter, Ollama, vLLM, LiteLLM, and custom Anthropic Messages API-compatible endpoints are also supported. The configured provider serves the main agent and any evolution judges. Keeping the tool interface and memory stack in place makes switching backends easier, but it does not establish equivalent tool-use or judging quality. For team workflows, /chat supports SSE streaming, file attachments, and Web Push, while magic-link forms use AES-256-GCM for credential collection.
Trade-offs & Limitations
Compared with a session-based chat assistant, Phantom can keep a workspace, memory, and scheduled jobs alive independently of the user's laptop. Compared with a fixed workflow runner, it can create tools and adjust its configuration as the work changes, but that widens the audit surface. Versioned configuration helps undo behavioral drift; it will not undo an email, a database write, or a service already created. Review generated tools before sharing them and scope outbound integrations to the work they actually need to perform.
The key isolation caveat is the full Compose stack's /var/run/docker.sock mount. It lets Phantom launch sibling containers and gives the process root-equivalent authority over the Docker daemon, so the container is not a strong security boundary for the host. Run that stack on a dedicated VM or host and restrict access to web and MCP endpoints. Self-hosting controls where Phantom runs, not necessarily where inference requests go: hosted models reduce local compute needs, while local models shift capacity and maintenance to the operator.
Hardware & Deployment Guide
Docker is the recommended route. The end-user path uses docker-compose.user.yaml as the Compose file and .env.example as the basis for .env. Configure the selected provider and only the channels you plan to use, launch with docker compose up -d, and check http://localhost:3100/health on the default mapping. The full docker-compose.yaml builds Phantom from the root Dockerfile, maps ${PORT:-3100}:3100, and points memory at http://qdrant:6333 and http://ollama:11434 inside the Compose network.
For a Bun-based setup, bun run phantom init --yes initializes configuration; the memory setup starts Qdrant and Ollama and pulls nomic-embed-text. Hosted generation avoids running a local generation model but does not eliminate the full stack's local embedding workload. For a local-only deployment, account separately for generation, embeddings, and any network-dependent channels or tools. Size for the model, concurrency, and services the agent may start. No latest release is listed; pin a tested revision rather than treating a moving branch as an upgrade baseline.
/chat streams over SSE and supports attachments and Web Push; Slack, Telegram, email, webhooks, and CLI provide additional entrypoints.RESEND_API_KEY.Teams that want an always-on coworker for recurring reports, internal dashboards, or reusable MCP tools, and can operate a dedicated VM and review agent-generated changes.
A chat interface or fixed workflow already meets the need, workloads must share a host without Docker-daemon access, or every external action requires centrally enforced approval that you have not verified in deployment.
Quick Start & Installation
curl -fsSL https://raw.githubusercontent.com/ghostwright/phantom/main/docker-compose.user.yaml -o docker-compose.yaml curl -fsSL https://raw.githubusercontent.com/ghostwright/phantom/main/.env.example -o .env # Edit .env - add your ANTHROPIC_API_KEY, Slack tokens, and OWNER_SLACK_USER_ID docker compose up -d
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| phantom ★ | 1.5k | +3 | TypeScript | Apache-2.0 | A self-hosted Bun AI coworker with persistent memory and extensible MCP tools |
| TrendRadar | 64.1k | +181 | TypeScript | GPL-3.0 | Self-hosted trend monitor for ranked news, RSS, and web search, with MCP and ale |
| pentagi | 35.7k | +489 | Go | MIT | Self-hosted multi-agent penetration testing with logs and reports for human revi |
| n8n | 213.1k | +787 | TypeScript | — | Visual Node.js platform for self-hosted workflows and multi-step AI agents |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/ghostwright/phantom.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about phantom
How do users and external agents connect to Phantom?
/chat for human interaction. Programmatic clients such as Claude Code can connect to Phantom's MCP server over Streamable HTTP. The server exposes universal, role-specific, and dynamically registered tools; dynamic registrations persist across restarts. Treat MCP access as permission to invoke tools, not merely permission to view chat.Do I need a GPU, and what should I size for?
Can we self-host Phantom for commercial use?
When is Phantom a better fit than a chat assistant or a scheduled workflow?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy