Enterprise-Grade AI Platform for Salesforce
Build intelligent AI agents powered by Large Language Models that seamlessly integrate with your Salesforce environment. Designed for security, scalability, and ease of use.
- Getting Started Guide
- Configuration Reference
- Standard Actions
- Developer Guide - Custom actions & context providers
- Security Guide
- Troubleshooting
AI Agent Studio is free and open-source. If you find it useful, consider supporting ongoing development.
β GitHub Sponsors | Buy Me a Coffee
This repository contains the core AI Agent Framework only. The aiAgentStudioAddons folder contains proprietary extensions not included in the open-source release.
The core framework in force-app provides all fundamental capabilities for building conversational AI agents with OpenAI.
Create AI-powered assistants that can:
- π¬ Chat naturally with users and remember conversation context
- π Search and retrieve Salesforce data intelligently
- βοΈ Create and update records based on user requests
- π Execute workflows with multiple steps automatically
- π Respect permissions - agents only access what users can access
- π― Work with multiple AI providers - OpenAI included, extensible for others
Deploy AI copilots that help support agents resolve cases faster by automatically searching knowledge bases, pulling customer history, and suggesting solutions - all while respecting your existing security model.
Give sales reps an intelligent assistant that can find accounts, surface open opportunities, create follow-up tasks, and provide real-time insights during customer conversations.
Build workflow agents that handle multi-step processes like lead qualification, case routing, or approval workflows - combining multiple AI-powered decisions into automated pipelines.
Embed conversational agents in Experience Cloud to let customers check order status, create support cases, or find answers from your knowledge base without waiting for human agents.
flowchart LR
subgraph Input
A[π€ User Message]
end
subgraph Framework
B[π Orchestrator]
C[π§ LLM]
D[π§ Tools]
end
subgraph Salesforce
E[π Data]
F[π Context]
G[πΎ Memory]
end
A --> B
B --> C
C --> D
D --> E
F --> B
G --> C
D --> H[β
Response]
- User sends a message through the chat component or API
- Context is gathered from the current record, user profile, and related data
- LLM analyzes the request with full conversation history
- Tools execute Salesforce operations (query, create, update, post)
- Response is delivered back to the user with full audit trail
All operations run asynchronously using Platform Events or Queueables, ensuring scalability for enterprise workloads.
| Feature | Description |
|---|---|
| Three Agent Types | Conversational (chat), Function (single-task), Workflow (multi-step) |
| Smart Memory | Buffer window and summary-based conversation history |
| Built-in Security | Automatic CRUD, FLS, and sharing rule enforcement |
| Standard Actions | Create, update, query records, post to Chatter, execute Flows |
| Extensible | Custom actions, context providers, LLM adapters, memory managers |
| Observability | Full logging of LLM interactions, tool executions, and token usage |
| Async Processing | Platform Events (high concurrency) or Queueables (debugging) |
| Challenge | How We Solve It |
|---|---|
| Security concerns with AI | Runs in user context with automatic CRUD/FLS enforcement. No privilege escalation. Full audit trail. |
| Integration complexity | Native Salesforce - no external servers, middleware, or data sync. Works with your existing org. |
| Vendor lock-in | Bring your own LLM. OpenAI included, easily add Claude, Gemini, or others via adapter pattern. |
| Scalability | Async processing handles thousands of concurrent conversations. Choose Platform Events or Queueables. |
| Customization needs | Extensible architecture with interfaces for custom actions, context providers, and memory strategies. |
| Governance & compliance | Every interaction logged to AgentDecisionStep__c. See exactly what the AI decided and why. |
- Salesforce org (Sandbox recommended)
- System Administrator access
- OpenAI API key
Option 1: CumulusCI (Recommended for Scratch Orgs)
If you have CumulusCI set up:
cci flow run dev_org --org devThis single command:
- Creates a scratch org with the framework deployed
- Deploys seed data and sample configurations
- Assigns required permission sets (
AIAgentStudioConfigurator,AIAgentStudioEndUser) - Enables Knowledge user and assigns
KnowledgeDemopermission set - Creates comprehensive sample data (agents, capabilities, test records)
- Sets up a Connected App for API access
Option 2: Salesforce CLI
sf project deploy start -d force-app/main/default -o your-org-alias- Create Named Credential for OpenAI API (
https://api.openai.com) - Create LLM Configuration with your Named Credential and model settings
- Create AI Agent Definition with identity/instruction prompts
- Add Capabilities (tools) the agent can use
- Add Chat Component to a Lightning page
π Full Getting Started Guide β
Core Components:
AgentExecutionService- Main entry point for starting agent executionsConversationalOrchestrator- Manages multi-turn chat conversationsLLMInteractionService- Handles communication with AI providersCapabilityExecutionService- Executes tools/actions securelyOpenAIProviderAdapter- OpenAI/Azure OpenAI integration
Extension Points:
IAgentAction- Build custom actions for any business logicIAgentContextProvider- Supply dynamic context to agentsILLMProviderAdapter- Add support for additional AI providersIMemoryManager- Implement custom conversation memory strategies
π Architecture Details β | Developer Guide β
- Use at your own risk - Test thoroughly in sandbox before production
- AI content verification - LLMs can hallucinate; review automated actions
- Data privacy - User inputs are sent to external AI providers
- Cost awareness - Monitor token consumption; set appropriate history limits
Copyright Β© 2025 Sonal
Licensed under Mozilla Public License 2.0 (MPL-2.0)
β
Commercial use | β
Modification | β
Distribution |
Made with π€ and π‘ in 2025
Empowering Salesforce teams to build intelligent AI experiences
