Skip to content

Commit 3137350

Browse files
authored
Added agentforce dialect and agent fabric dialect to docs (#2)
* added agentforce dialect and agent fabric dialect to docs * incorp feedback
1 parent e84404a commit 3137350

51 files changed

Lines changed: 4399 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/docs/dialects/agentfabric/index.md

Lines changed: 616 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
sidebar_label: "Introduction"
3+
---
4+
5+
# Get Started with Agent Script for Agentforce
6+
7+
Agent Script is a language for building predictable, context-aware agent workflows. It combines the flexibility of natural language instructions with the reliability of programmatic expressions, allowing you to create agents that balance LLM reasoning with deterministic logic.
8+
9+
:::note
10+
We brought over this Salesforce documentation from the [Agentforce Developer Guide](https://developer.salesforce.com/docs/ai/agentforce/guide/get-started.html). This section contains documentation that is specific to Agentforce use cases and may contain references to Agentforce Builder.
11+
:::
12+
13+
![Agent Script UI](/img/agent-script/agent-script-view2.png)
14+
15+
## What's Agent Script?
16+
17+
Agent Script is a domain-specific language designed for authoring conversational AI agents. It combines the flexibility of natural language instructions for handling conversational tasks with the reliability of programmatic expressions for handling business rules.
18+
19+
In Agent Script, you use expressions to:
20+
- Define if/else conditions, transitions, and other control flow logic
21+
- Set, modify, and compare variables to maintain state
22+
- Select subagents and actions based on conditions
23+
- Build predictable, context-aware workflows that don't rely solely on LLM interpretation
24+
25+
For example, you can use script to control when your agent transitions from one subagent to another or when actions run in a particular sequence (action chaining).
26+
27+
## Authoring Agent Script
28+
29+
There are multiple ways to author Agent Script:
30+
31+
- **Visual Tools**: Use [Agentforce Builder](/agentforce-builder/overview) for a visual authoring experience with Canvas and Script views
32+
- **Code Editor**: Use the [Agentforce DX VS Code Extension](https://developer.salesforce.com/docs/ai/agentforce/guide/agent-dx.html) for local development with full language support
33+
- **Text Editor**: Edit `.agent` files directly with any text editor - they're plain text files using YAML-like syntax
34+
35+
36+
## What Can You Do with Agent Script?
37+
38+
Agent Script preserves the conversational skills and complex reasoning ability derived from natural language prompts, and it adds the determinism of programmatic instructions. For example, in Agent Script, you can define:
39+
40+
- Specific areas where an LLM is free to make reasoning decisions. See [Reasoning Instructions](reference/ascript-ref-instructions.md).
41+
- Specific areas where the agent must execute deterministically. See [Reasoning Instructions](reference/ascript-ref-instructions.md).
42+
- Variables to reliably store information about the agent's current state, rather than relying on LLM context memory. See [Variables](reference/ascript-ref-variables.md).
43+
- Conditional expressions to determine the agent's execution path or LLM's utterances. For example, you can instruct the agent to speak differently to the customer based on the value of the `is_member` variable. Or you can deterministically specify which action to run based on the value of the `appointment_type` variable. See [Conditional Expressions](reference/ascript-ref-expressions.md).
44+
- Conditions under which the agent transitions to a new subagent. You can deterministically transition to a new subagent. Or you can expose a subagent transition to the LLM as a tool, allowing the LLM to decide when and whether to switch subagents. See [Tools](reference/ascript-ref-tools.md) and [Utils](reference/ascript-ref-utils.md).
45+
46+
## Example Agent Script
47+
48+
Here’s a simple example of what Agent Script looks like.
49+
50+
```agentscript title="Agent Script Example"
51+
system:
52+
instructions: "You are a friendly and empathetic agent that helps customers with their questions."
53+
messages:
54+
error: "Sorry, something went wrong."
55+
welcome: "Hello! How are you feeling today?"
56+
57+
config:
58+
agent_name: "HelloWorldBot"
59+
default_agent_user: "hello@world.com"
60+
61+
language:
62+
default_locale: "en_US"
63+
additional_locales: ""
64+
65+
variables:
66+
isPremiumUser: mutable boolean = False
67+
description: "Indicates whether the user is a premium user."
68+
69+
start_agent hello_world:
70+
description: "Respond to the user."
71+
reasoning:
72+
instructions: ->
73+
if @variables.isPremiumUser:
74+
| ask the user if they want to redeem their Premium points
75+
else:
76+
| ask the user if they want to upgrade to Premium service
77+
```
78+
79+
Among other compelling features, you can see in the above reasoning instructions that you can specify conditional logic (after the `->`) alongside LLM prompts (after the `|`). This combination gives you the advantages of predictable, deterministic logic, alongside the power of LLM reasoning.
80+
81+
## Next Steps
82+
83+
To learn how to build agents in Canvas view or by chatting with Agentforce, see [Build Enterprise-Ready Agents with the New Agentforce Builder](https://help.salesforce.com/s/articleView?id=ai.agent_builder_intro.htm) in Salesforce Help.
84+
85+
To learn more about Agent Script, review these topics.
86+
87+
- [Language Characteristics](./ascript-lang.md)
88+
- [Agent Script Blocks](./ascript-blocks.md)
89+
- [Flow of Control](./ascript-flow.md)
90+
- [Agent Script Patterns](./patterns/ascript-patterns.md)
91+
- [Agent Script Examples](./examples/ascript-examples.md)
92+
- [Manage Agent Script Agents](./ascript-manage.md)
93+
- [Agent Script Reference](reference/ascript-reference.md)

0 commit comments

Comments
 (0)