Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Agent Quick-Start Guide
| Status | Updated |
|---|
| 🟢 Stable | 2026-02-22 |
Overview
This guide helps developers understand and work with GrantMaster’s AI agent system (Agent VI). Agents are multi-step AI workflows that perform complex tasks — compliance checking, report generation, proposal writing — by chaining tool calls with credit-budgeted execution.
Key Concepts
| Concept | Description |
|---|
| Agent Definition | Static config declaring tools, permissions, and budgets |
| Agent Execution | Runtime that processes steps, enforces budgets, and handles errors |
| Tool | A sandboxed function the agent can invoke (e.g., analyze_compliance) |
| Credit Budget | Maximum AI credits an agent run can consume |
| Step Budget | Maximum number of tool invocations per run |
| Feature Gate | Entitlement tier required to use the agent |
Built-in Agents (5)
| Agent | ID | Feature Gate | Max Steps | Credit Budget | Category |
|---|
| Journal Assistant | journal_assistant | AGENT_BASIC | 5 | 15 | journals |
| Compliance Checker | compliance_checker | AGENT_MULTI_STEP | 10 | 30 | compliance |
| Expense Auditor | expense_auditor | AGENT_MULTI_STEP | 15 | 40 | finance |
| Report Generator | report_generator | AGENT_MULTI_STEP | 15 | 50 | reporting |
| Grant Proposal Writer | grant_proposal_writer | AGENT_AUTONOMOUS | 20 | 80 | grants |
Feature Tiers
| Tier | Capabilities |
|---|
AGENT_BASIC | Single-step tool calls, limited scope |
AGENT_MULTI_STEP | Multi-step workflows, moderate budgets |
AGENT_AUTONOMOUS | Full autonomy, large budgets, complex chains |
Agent Definition Structure
File: src/features/agents/services/agentDefinitions.ts
interface AgentDefinition {
id: string;
name: string;
description: string;
requiredFeature: Feature; // Entitlement gate
requiredPermissions: Permission[]; // RBAC permissions user must hold
allowedTools: string[]; // Sandboxed tool whitelist
maxSteps: number; // Step budget
defaultCreditBudget: number; // Credit budget
icon: string; // Lucide icon name
category: string; // UI grouping
}
Example: Compliance Checker
const COMPLIANCE_CHECKER: AgentDefinition = {
id: 'compliance_checker',
name: 'Compliance Checker',
description: 'Analyzes journals and expenses for compliance issues.',
requiredFeature: Feature.AGENT_MULTI_STEP,
requiredPermissions: [Permission.VIEW_JOURNALS, Permission.VIEW_PROJECTS],
allowedTools: ['analyze_compliance', 'query_documents', 'generate_report'],
maxSteps: 10,
defaultCreditBudget: 30,
icon: 'ShieldCheck',
category: 'compliance',
};
Execution Flow
Guard Rails
| Guard | Enforcement |
|---|
| Tool Sandboxing | Agents can only call tools in their allowedTools list |
| Step Budget | Execution stops at maxSteps even if task is incomplete |
| Credit Budget | Run aborts if credit budget would be exceeded |
| RBAC | User must hold all requiredPermissions to trigger an agent |
| Feature Gate | Organization must have the required entitlement tier |
Adding a New Agent
- Define the agent in
src/features/agents/services/agentDefinitions.ts:
const MY_AGENT: AgentDefinition = {
id: 'my_agent',
name: 'My Agent',
description: 'Does something useful.',
requiredFeature: Feature.AGENT_MULTI_STEP,
requiredPermissions: [Permission.VIEW_PROJECTS],
allowedTools: ['query_documents', 'generate_report'],
maxSteps: 10,
defaultCreditBudget: 25,
icon: 'Zap',
category: 'custom',
};
- Add to the registry:
export const AGENT_DEFINITIONS: AgentDefinition[] = [
// ... existing agents
MY_AGENT,
];
-
Implement tools (if new tools are needed) in
src/features/agents/tools/.
-
Test the agent using the Agent VI UI or programmatically via
AgentExecutionService.startRun().
| Document | Path |
|---|
| Agent Framework (full architecture) | docs/product/features/agent-framework.md |
| Agent Execution Architecture | docs/engineering/architecture/agent-execution-architecture.md |
| Agent Domain Model | docs/product/domain/agent-domain-model.md |
| Credit System Architecture | docs/engineering/architecture/credit-system-architecture.md |
| Agent UI Components | docs/engineering/frontend/agent-ui-components.md |
Key Files Reference
| File | Purpose |
|---|
src/features/agents/services/agentDefinitions.ts | All 5 built-in agent definitions |
src/features/agents/services/agentExecutionService.ts | Runtime execution engine |
src/features/agents/types.ts | AgentDefinition, AgentRun, AgentStep types |
src/features/agents/tools/ | Tool implementations |
src/config/entitlements.ts | Feature gate definitions |