Interface: AgencyOptions
Defined in: packages/agentos/src/api/types.ts:1642
Configuration for the agency() factory function.
Extends BaseAgentConfig with a required agents roster and optional
multi-agent orchestration settings.
Example
import { agency, hitl } from '@framers/agentos';
const myAgency = agency({
provider: 'openai',
model: 'gpt-4o',
strategy: 'sequential',
agents: {
researcher: { instructions: 'Find relevant papers.' },
writer: { instructions: 'Write a clear summary.' },
},
controls: { maxTotalTokens: 50_000, onLimitReached: 'warn' },
hitl: {
approvals: { beforeTool: ['delete-file'], beforeReturn: true },
handler: hitl.autoApprove(),
timeoutMs: 30_000,
onTimeout: 'reject',
},
on: {
agentStart: (e) => console.log(`[${e.agent}] started`),
agentEnd: (e) => console.log(`[${e.agent}] done in ${e.durationMs}ms`),
},
});
See
agency -- the factory function that consumes this configuration.
See BaseAgentConfig for the shared config surface inherited by this interface.
Extends
BaseAgentConfig
Properties
adaptive?
optionaladaptive:boolean
Defined in: packages/agentos/src/api/types.ts:1669
Whether the orchestrator may override strategy at runtime based on
task complexity signals.
agents
agents:
Record<string,BaseAgentConfig|Agent>
Defined in: packages/agentos/src/api/types.ts:1647
Named roster of sub-agents. Each value is either a BaseAgentConfig
object (the agency will instantiate it) or a pre-built Agent instance.
apiKey?
optionalapiKey:string
Defined in: packages/agentos/src/api/types.ts:1300
Override the provider API key instead of reading from environment variables.
Inherited from
BaseAgentConfig.apiKey
avatar?
optionalavatar:AvatarConfig
Defined in: packages/agentos/src/api/types.ts:1440
Avatar visual presentation configuration.
Inherited from
BaseAgentConfig.avatar
baseUrl?
optionalbaseUrl:string
Defined in: packages/agentos/src/api/types.ts:1302
Override the provider base URL (useful for local proxies or Ollama).
Inherited from
BaseAgentConfig.baseUrl
channels?
optionalchannels:Record<string,Record<string,unknown>>
Defined in: packages/agentos/src/api/types.ts:1445
Channel adapter configurations keyed by channel name. Values are channel-specific option objects passed through opaquely.
Inherited from
BaseAgentConfig.channels
cognitiveMechanisms?
optionalcognitiveMechanisms:CognitiveMechanismsConfig
Defined in: packages/agentos/src/api/types.ts:1492
Cognitive mechanisms config: the eight memory mechanisms of
CognitiveMemoryManager (reconsolidation, retrieval-induced forgetting,
involuntary recall, feeling of knowing, temporal gist, schema encoding,
source-confidence decay and emotion regulation). Pass {} for the
defaults, or override fields per mechanism.
The mechanisms run inside a CognitiveMemoryManager initialized with this
config (CognitiveMemoryConfig.cognitiveMechanisms). agent() without
runtime: 'gmi' and agency() construct no memory manager, so they log a
warning and leave this field unused; agent({ runtime: 'gmi' }) with memory
on passes it to the agent's memory manager. On the full runtime, a
gmiManagerConfig.cognitiveMemoryFactory builds the manager for each GMI.
See
Inherited from
BaseAgentConfig.cognitiveMechanisms
controls?
optionalcontrols:ResourceControls
Defined in: packages/agentos/src/api/types.ts:1467
Resource limits (tokens, cost, time). agency() and the full runtime
enforce every field against the entire run. The lightweight agent()
helper forwards two of them per call: maxTotalTokens caps each LLM
call's completion output (mapped to maxTokens when no explicit
maxTokens is set, NOT the prompt+completion run total) and
maxDurationMs bounds each LLM request (mapped to requestTimeout).
The remaining fields stay agency()-only.
Inherited from
BaseAgentConfig.controls
customModelParams?
optionalcustomModelParams:Record<string,unknown>
Defined in: packages/agentos/src/api/types.ts:1410
Provider-specific TOP-LEVEL request-payload parameters forwarded verbatim
on every generate/stream/session call via
ModelCompletionOptions.customModelParams. Providers spread these onto
the outgoing request body — the escape hatch for params the typed options
don't model, e.g. OpenRouter provider-routing preferences:
customModelParams: { provider: { sort: 'throughput' } }
Inherited from
BaseAgentConfig.customModelParams
dependsOn?
optionaldependsOn:string[]
Defined in: packages/agentos/src/api/types.ts:1474
Names of other agents in the agency that must complete before this agent runs.
Used with strategy: 'graph' to build an explicit dependency DAG.
Agents with no dependsOn are roots and run first.
Example
`dependsOn: ['researcher']` — this agent waits for `researcher` to finish.
Inherited from
BaseAgentConfig.dependsOn
discovery?
optionaldiscovery:DiscoveryConfig
Defined in: packages/agentos/src/api/types.ts:1422
Runtime capability discovery configuration.
Inherited from
BaseAgentConfig.discovery
effort?
optionaleffort:string
Defined in: packages/agentos/src/api/types.ts:1398
Reasoning-effort control forwarded to every generate/stream/session call.
On effort-capable Claude models (Opus 4.5+, Sonnet 4.6, Fable/Mythos 5) the
provider sends output_config.effort (low|medium|high|xhigh|max). On
OpenAI reasoning models (o-series, GPT-5.x) the provider sends
reasoning_effort (chat) / reasoning.effort (Responses), with max
clamping to xhigh — OpenAI's ceiling — and a model-aware guard capping
xhigh → high on ids not probe-verified for xhigh (gpt-5.5/5.6 families
are verified). Independent of thinking; ignored on unsupported
models/values. Works per-agent in agency() rosters — each sub-agent may
pin its own depth.
Inherited from
BaseAgentConfig.effort
emergent?
optionalemergent:EmergentConfig
Defined in: packages/agentos/src/api/types.ts:1436
Emergent agent synthesis configuration.
Inherited from
BaseAgentConfig.emergent
guardrails?
optionalguardrails:string[] |GuardrailsConfig
Defined in: packages/agentos/src/api/types.ts:1428
Guardrail policy identifiers or structured config.
string[]— shorthand; applies to both input and output.GuardrailsConfig— full control with separate input/output lists.
Inherited from
BaseAgentConfig.guardrails
hitl?
optionalhitl:HitlConfig
Defined in: packages/agentos/src/api/types.ts:1434
Human-in-the-loop approval configuration.
Inherited from
BaseAgentConfig.hitl
instructions?
optionalinstructions:string
Defined in: packages/agentos/src/api/types.ts:1296
Free-form system instructions prepended to the system prompt.
Inherited from
BaseAgentConfig.instructions
maxRounds?
optionalmaxRounds:number
Defined in: packages/agentos/src/api/types.ts:1674
Maximum number of orchestration rounds before the run is terminated.
Applies to iterative strategies like "debate" and "review-loop".
maxSteps?
optionalmaxSteps:number
Defined in: packages/agentos/src/api/types.ts:1331
Maximum number of agentic steps (LLM calls) per invocation. Defaults to 5.
Inherited from
BaseAgentConfig.maxSteps
maxTokens?
optionalmaxTokens:number
Defined in: packages/agentos/src/api/types.ts:1364
Upper bound on completion tokens for each LLM call the agent makes.
Forwarded to the underlying generateText / streamText call on
every generate(), stream(), and session.send() invocation.
Caps tail spend when a model misbehaves and yaps past the intended output size. Omit to use the provider default — AnthropicProvider defaults to 16000 (set 2026-05-17; was 4096), OpenAIProvider defaults to 4096, GeminiProvider defaults to 8192. Set to ~2× the agent's typical response size so normal calls finish naturally and only runaway generations hit the cap.
Example
// Cap a roleplay agent at 1024 — short turns, fast feedback.
const companion = agent({
provider: 'anthropic',
model: 'claude-sonnet-4-6',
instructions: 'Reply in character. 2-3 sentences.',
maxTokens: 1024,
});
// Tool-use agent emitting verbose JSON — go big so structured
// output doesn't truncate mid-token. Opus 4.7 supports 32000.
const codegen = agent({
provider: 'anthropic',
model: 'claude-opus-4-7',
tools: { GenerateCode, RunTests, JudgeOutput },
maxTokens: 16000,
});
Inherited from
BaseAgentConfig.maxTokens
memory?
optionalmemory:boolean|MemoryConfig
Defined in: packages/agentos/src/api/types.ts:1418
Memory configuration. agent() reads it only with runtime: 'gmi', where true
or a MemoryConfig turns on cognitive memory for the agent's sessions (its
embedding and consolidation fields are read) and false keeps it off, also
under cognition: 'full'. A session's message history is set by history, not
by this field.
Inherited from
BaseAgentConfig.memory
model?
optionalmodel:string
Defined in: packages/agentos/src/api/types.ts:1289
Model identifier. Accepted in two formats:
- Plain model name (e.g.
"gpt-4o") whenprovideris also set. Preferred. "provider:model"combined string (e.g."openai:gpt-4o").
Inherited from
BaseAgentConfig.model
name?
optionalname:string
Defined in: packages/agentos/src/api/types.ts:1298
Display name for the agent, injected into the system prompt.
Inherited from
BaseAgentConfig.name
observability?
optionalobservability:ObservabilityConfig
Defined in: packages/agentos/src/api/types.ts:1455
Observability and telemetry configuration.
Inherited from
BaseAgentConfig.observability
on?
optionalon:AgencyCallbacks
Defined in: packages/agentos/src/api/types.ts:1457
Event callbacks fired at various lifecycle points during the run.
Inherited from
BaseAgentConfig.on
output?
optionaloutput:unknown
Defined in: packages/agentos/src/api/types.ts:1451
Output schema for structured generation.
Accepts a Zod schema at runtime; typed as unknown here to avoid a
hard dependency on the zod package in the types layer.
Inherited from
BaseAgentConfig.output
permissions?
optionalpermissions:PermissionsConfig
Defined in: packages/agentos/src/api/types.ts:1432
Fine-grained tool and resource permission overrides.
Inherited from
BaseAgentConfig.permissions
personality?
optionalpersonality:Partial<{agreeableness:number;conscientiousness:number;emotionality:number;extraversion:number;honesty:number;honesty_humility:number;honestyHumility:number;openness:number;opennessToExperience:number; }>
Defined in: packages/agentos/src/api/types.ts:1310
HEXACO-inspired personality trait overrides (0–1 scale).
Encoded as a human-readable trait string appended to the system prompt.
The SOUL.md spellings honestyHumility / honesty_humility and
opennessToExperience are accepted for honesty and openness; when
both spellings are given, the canonical key wins.
Inherited from
BaseAgentConfig.personality
provenance?
optionalprovenance:AgencyProvenanceConfig
Defined in: packages/agentos/src/api/types.ts:1453
Provenance and audit-trail configuration.
Inherited from
BaseAgentConfig.provenance
provider?
optionalprovider:string
Defined in: packages/agentos/src/api/types.ts:1294
Provider name (e.g. "openai", "anthropic", "ollama").
Auto-detected from environment API keys when omitted.
Inherited from
BaseAgentConfig.provider
quorum?
optionalquorum:AgencyQuorumConfig
Defined in: packages/agentos/src/api/types.ts:1659
Minimum viable panel for the parallel strategy, checked AFTER the
fan-out against the agents that actually SUCCEEDED (HITL-rejected and
errored agents don't count): minAgents = successful agents required;
minProviders = distinct providers among them — provider diversity is
what makes a multi-model panel meaningful, and a panel that quietly
collapsed to one vendor must not synthesize a false consensus.
Shortfall throws AgencyQuorumError by default; set
onShortfall: 'proceed' to log a warning and synthesize anyway.
Ignored by strategies other than parallel.
rag?
optionalrag:RagConfig
Defined in: packages/agentos/src/api/types.ts:1420
Retrieval-Augmented Generation configuration.
Inherited from
BaseAgentConfig.rag
security?
optionalsecurity:object
Defined in: packages/agentos/src/api/types.ts:1430
Security tier controlling permitted tools and capabilities.
tier
tier:
SecurityTier
Inherited from
BaseAgentConfig.security
strategy?
optionalstrategy:AgencyStrategy
Defined in: packages/agentos/src/api/types.ts:1664
Orchestration strategy for coordinating sub-agents.
Defaults to "sequential" when omitted.
thinking?
optionalthinking:false| {budgetTokens:number; }
Defined in: packages/agentos/src/api/types.ts:1385
Extended-thinking switch forwarded to Claude models on every
generate() / stream() / session call this agent makes. Any positive
budgetTokens turns adaptive thinking on (the number itself is not
sent). false turns thinking off with the model's own off shape; Opus
5.5, Fable and Mythos always think. Omitted keeps the model's default:
thinking on for Opus 5 and later, Sonnet 5 and later, Fable and Mythos,
off for older models. Other providers ignore it.
Example
const codegen = agent({
provider: 'anthropic',
model: 'claude-opus-5',
tools: { GenerateCode, RunTests, JudgeOutput },
maxTokens: 24000,
thinking: { budgetTokens: 8000 },
});
Inherited from
BaseAgentConfig.thinking
tools?
optionaltools:AdaptableToolInput
Defined in: packages/agentos/src/api/types.ts:1329
Tools available to the agent on every call.
Accepts:
- a named high-level tool map
- an
ExternalToolRegistry(Record,Map, or iterable) - a prompt-only
ToolDefinitionForLLM[]
Inherited from
BaseAgentConfig.tools
verifyCitations?
optionalverifyCitations:VerifyCitationsConfig
Defined in: packages/agentos/src/api/types.ts:1525
Auto-verify citations after every generation.
When set, the agent retrieves sources for each user input, runs
generation, then scores each atomic claim in the response against the
retrieved sources via CitationVerifier. The resulting VerifiedResponse
is attached to the generation result's grounding field — no separate
verifier.verify(text, sources) call needed.
Pass a config object with the embedding function and the source retriever the verifier should use:
Example
const docsAgent = agent({
provider: 'openai',
model: 'gpt-4o',
verifyCitations: {
embedFn: (texts) => embeddingManager.embedBatch(texts),
retrieve: (query) => retriever.search(query),
},
});
const result = await docsAgent.generate('How do I configure a guardrail?');
console.log(result.text);
console.log(result.grounding?.overallGrounded);
for (const claim of result.grounding?.claims ?? []) {
if (claim.verdict !== 'supported') console.warn(claim.text);
}
Inherited from
BaseAgentConfig.verifyCitations
voice?
optionalvoice:VoiceConfig
Defined in: packages/agentos/src/api/types.ts:1438
Voice interface configuration.
Inherited from
BaseAgentConfig.voice