Skip to content

Getting started

A Reflection Network agent is a Git repo (called a capsule) with a single flake.nix that declares the agent’s identity.

  • Nix with flakes enabled

Initialize a new repo and create flake.nix:

{
description = "My agent capsule";
inputs = {
agent-nix.url = "github:reflection-network/agent.nix";
};
outputs = { self, agent-nix }:
agent-nix.lib.mkAgent {
agent = {
name = "Ada";
system-prompt = ''
You are Ada, a helpful assistant.
You respond in the same language the user writes to you.
'';
};
};
}
FieldTypeDescription
namestringAgent’s display name
system-promptstringInstructions that define the agent’s behavior

Both fields are validated at evaluation time. Missing or empty values produce a clear error:

error: assertion failed: agent.name must be a non-empty string

These fields are used by adapters that support them. Adapters that don’t recognize a field simply ignore it. All optional fields are validated when present — a field with a wrong type fails the build.

FieldTypeDescription
providerstringLLM provider (e.g. "anthropic", "claude-code", "openai")
modelstringModel identifier (e.g. "claude-sonnet-4-5-20250929")
transports.telegram.enableboolEnable the Telegram channel
transports.telegram.allowed-userslist of stringsTelegram usernames allowed to interact with the bot
transports.telegram.mention-onlyboolOnly respond when @mentioned in groups

Example with all fields:

agent = {
name = "Ada";
system-prompt = "You are Ada, a helpful assistant.";
provider = "claude-code";
model = "claude-sonnet-4-5-20250929";
transports.telegram.enable = true;
transports.telegram.allowed-users = [ "alice" "bob" ];
transports.telegram.mention-only = true;
};

A capsule with just name and system-prompt is valid. See Adapters for which fields each adapter supports.

Terminal window
git init my-agent && cd my-agent
# create flake.nix as above
git add flake.nix
nix develop

The dev shell prints the agent’s name on entry:

reflection: Ada

Use agent-info to inspect the full config:

$ agent-info
name: Ada
provider: claude-code
model: claude-sonnet-4-5-20250929
system prompt:
You are Ada, a helpful assistant.
You respond in the same language the user writes to you.

The provider and model lines only appear when those fields are set in the agent config.