Skip to main content

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

StatusUpdated
🟢 Stable2026-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

ConceptDescription
Agent DefinitionStatic config declaring tools, permissions, and budgets
Agent ExecutionRuntime that processes steps, enforces budgets, and handles errors
ToolA sandboxed function the agent can invoke (e.g., analyze_compliance)
Credit BudgetMaximum AI credits an agent run can consume
Step BudgetMaximum number of tool invocations per run
Feature GateEntitlement tier required to use the agent

Built-in Agents (5)

AgentIDFeature GateMax StepsCredit BudgetCategory
Journal Assistantjournal_assistantAGENT_BASIC515journals
Compliance Checkercompliance_checkerAGENT_MULTI_STEP1030compliance
Expense Auditorexpense_auditorAGENT_MULTI_STEP1540finance
Report Generatorreport_generatorAGENT_MULTI_STEP1550reporting
Grant Proposal Writergrant_proposal_writerAGENT_AUTONOMOUS2080grants

Feature Tiers

TierCapabilities
AGENT_BASICSingle-step tool calls, limited scope
AGENT_MULTI_STEPMulti-step workflows, moderate budgets
AGENT_AUTONOMOUSFull 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

GuardEnforcement
Tool SandboxingAgents can only call tools in their allowedTools list
Step BudgetExecution stops at maxSteps even if task is incomplete
Credit BudgetRun aborts if credit budget would be exceeded
RBACUser must hold all requiredPermissions to trigger an agent
Feature GateOrganization must have the required entitlement tier

Adding a New Agent

  1. 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',
};
  1. Add to the registry:
export const AGENT_DEFINITIONS: AgentDefinition[] = [
  // ... existing agents
  MY_AGENT,
];
  1. Implement tools (if new tools are needed) in src/features/agents/tools/.
  2. Test the agent using the Agent VI UI or programmatically via AgentExecutionService.startRun().

DocumentPath
Agent Framework (full architecture)docs/product/features/agent-framework.md
Agent Execution Architecturedocs/engineering/architecture/agent-execution-architecture.md
Agent Domain Modeldocs/product/domain/agent-domain-model.md
Credit System Architecturedocs/engineering/architecture/credit-system-architecture.md
Agent UI Componentsdocs/engineering/frontend/agent-ui-components.md

Key Files Reference

FilePurpose
src/features/agents/services/agentDefinitions.tsAll 5 built-in agent definitions
src/features/agents/services/agentExecutionService.tsRuntime execution engine
src/features/agents/types.tsAgentDefinition, AgentRun, AgentStep types
src/features/agents/tools/Tool implementations
src/config/entitlements.tsFeature gate definitions