@falai/agent 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,33 +93,6 @@
|
|
|
93
93
|
|
|
94
94
|
---
|
|
95
95
|
|
|
96
|
-
## 🏗️ Architecture
|
|
97
|
-
|
|
98
|
-
`@falai/agent` uses a **state machine-driven architecture** where:
|
|
99
|
-
|
|
100
|
-
- 🎯 **Conversations are explicit state machines** - Predictable, testable flows using the Route DSL
|
|
101
|
-
- 🔧 **Tools execute automatically** - Based on state transitions and guideline matching, not AI decisions
|
|
102
|
-
- 🧠 **AI only generates messages** - The AI never sees or calls tools; it just creates natural responses
|
|
103
|
-
- 🔄 **Preparation iterations gather data** - Tools run in loops before message generation to enrich context
|
|
104
|
-
- 📦 **Domain-based organization** - Tools grouped logically with route-level access control
|
|
105
|
-
|
|
106
|
-
**Example:**
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
route.initialState
|
|
110
|
-
.transitionTo({ chatState: "What's your name?" })
|
|
111
|
-
.transitionTo(
|
|
112
|
-
{ toolState: saveName }, // ← Tool executes automatically
|
|
113
|
-
"User provided their name"
|
|
114
|
-
)
|
|
115
|
-
.transitionTo({ chatState: "Thanks! What's your email?" });
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
The AI generates conversational messages while the engine handles tool execution and flow control. This creates **deterministic, controllable agents** perfect for structured conversations like customer support, onboarding, and multi-step processes.
|
|
119
|
-
|
|
120
|
-
📖 **[Read the full architecture guide →](./docs/ARCHITECTURE.md)**
|
|
121
|
-
|
|
122
|
-
---
|
|
123
96
|
|
|
124
97
|
## 📦 Installation
|
|
125
98
|
|
|
@@ -178,10 +151,10 @@ const bookingRoute = agent.createRoute({
|
|
|
178
151
|
});
|
|
179
152
|
|
|
180
153
|
bookingRoute.initialState
|
|
181
|
-
.transitionTo(
|
|
182
|
-
|
|
183
|
-
"User provided hotel name and date"
|
|
184
|
-
)
|
|
154
|
+
.transitionTo({
|
|
155
|
+
toolState: checkAvailability,
|
|
156
|
+
condition: "User provided hotel name and date",
|
|
157
|
+
})
|
|
185
158
|
.transitionTo({ chatState: "Confirm booking and provide summary" });
|
|
186
159
|
|
|
187
160
|
// 4️⃣ Start conversing
|