Skip to content
gravelandPublic

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

rafiki

An LLM proxy and conversation-capture store, an agent library built on it, and a daemon (rafikid) that hosts coding-agent children — driven from a CLI/TUI client (rafiki).

Quick start

brew install graveland/tap/rafiki   # macOS; Debian/Ubuntu: see docs/guide/install.md
rafiki setup                        # database, providers, daemon, your user, a local executor
rafiki doctor                       # daemon + executor + one agent, end to end
rafiki create                       # start an agent
rafiki                              # the cockpit

rafiki setup runs its own PostgreSQL 18 by default (RAFIKI_DB=embedded) — downloaded and verified on first use, no Docker needed. --db-mode managed uses a Docker (or OrbStack) container instead, and --dsn points at a database you provide. Setup also needs a Claude login and ripgrep; API keys are optional. Installing rafiki has the details, including upgrades. Running a shared daemon on a server instead of a laptop is Deploying rafiki for real.

What it is

  • Native agent runtime (fundi) alongside Claude Code (--kind claude) and script children (--kind script). All three get the same agent-control surface, so kinds and models mix freely in one budgeted tree: plan with an expensive model, fan out to a fleet of cheap ones, review with a third.
  • Capture everything. Every request, reply and tool call lands in Postgres, searchable through recall, replayable from any ordinal, and watchable or drivable from the cockpit, the web UI, the CLI, another agent or the Python SDK at once.
  • An executor plane. An agent's file, shell and LSP tools run on the executor it is bound to (your laptop, a VM, a container, or another machine you rafiki executor install over ssh), never on the daemon. Isolation is whatever you compose around the executor.
  • A routing proxy (Anthropic and OpenAI faces) with breaker-gated failover, declarative OpenRouter routing, a provider cache guard, model declarations and per-user model aliases, and per-model cost accounting.
  • Bring your own subscription. A provider of kind openai-responses-chatgpt bills each user's own ChatGPT plan, not an API key: rafiki providers login chatgpt runs the OAuth flow for that user and the daemon seals the tokens at rest. rafiki claude can bill a Claude subscription the same way.
  • Multi-user and multi-daemon. Per-user tokens or OIDC single sign-on; one client reaches many daemons through named profiles.

The long version is Features.

Remote MCP servers

A remote MCP server that requires OAuth is a direct url entry — the config names the server and nothing about its authentication:

{ "mcpServers": { "linear": { "url": "https://mcp.linear.app/mcp" } } }

Log the daemon in once, as yourself:

rafiki mcp login linear

The daemon runs the whole flow and seals the grant against your user id, so no token is written into the file and no child process ever holds one. There is no "oauth": true switch. Your fundi children then spend the grant passively: a server they cannot authenticate is skipped with a hint naming that login, never a prompt mid-spawn. rafiki mcp logout linear forgets it — and logging in re-routes nothing else: a server you have not logged into keeps its own transport and reach.

Only direct-url entries of a daemon-side mcp.json are in scope; executor entries keep their own static headers, and Claude Code logs in for itself on its own host. The user-facing picture is Agents and subagents; the runtime seam and its scope are MCP OAuth.

Naming

Three Swahili words, three roles:

  • rafiki ("friend") — the project as a whole: the client/TUI binary (rafiki), the daemon (rafikid), and the library underneath both.
  • fundi ("craftsman") — the native agent runtime, one of three child kinds (--kind fundi, the default). It does the work in-process, through this repo's own pkg/llm/pkg/agentloop rather than shelling out to another agent binary.
  • daraja ("bridge") — the mechanism that lets a claude-kind child run on a remote executor while still looking, to the daemon, like a normal managed child. See Executors.

Binaries

Binary Role
rafikid the daemon. Runs fundi children as goroutines inside itself; claude children route through daraja on an executor when one is configured for it, else run as local subprocesses
rafiki the CLI client, the cockpit, the web UI (rafiki web), and the executor (rafiki executor serve). Links no Postgres driver
rafiki-hooks the webhook gateway, the one process meant to face the internet. Holds no database credential. See Webhook gateway

Documentation

Using rafiki

Installing rafiki rafiki setup, upgrades, what it configures
The cockpit and web UI watching and driving agents; keys
Agents and subagents child kinds, script children, subagent trees, limits, presets
Executors, daraja and sandboxes where agents run and what they can touch
Repos, skills and the Python SDK shared code and skills; scripting rafiki
Recall and memory searching past conversations
The proxy and library model selection, routing, the cache guard, model declarations and aliases, per-user subscription logins
Claude Code and subscription billing rafiki claude
Features the full list

Running rafiki

Deploying rafiki for real a shared daemon on a server or Kubernetes
Authentication first user, SSO, service tokens
Configuration paths, profiles, environment variables
Webhook gateway third-party events waking agents
Telemetry OpenTelemetry and metrics

Reference and development

Development building from source, running locally, tests
rafikid agent CLI every verb and flag
Control protocol the Connect API
Conversation tree content-addressed conversation storage: nodes, hashes, the cutover
Executor protocol the daemon-executor wire format
Vision and architecture where this is going
Migrating changes that need you to do something

License

See LICENSE and NOTICE.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages