agentlang 0.10.4 → 0.10.5
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 +22 -9
- package/out/extension/main.cjs +250 -250
- package/out/extension/main.cjs.map +2 -2
- package/out/language/generated/ast.d.ts +2 -12
- package/out/language/generated/ast.d.ts.map +1 -1
- package/out/language/generated/ast.js +0 -8
- package/out/language/generated/ast.js.map +1 -1
- package/out/language/generated/grammar.d.ts.map +1 -1
- package/out/language/generated/grammar.js +18 -52
- package/out/language/generated/grammar.js.map +1 -1
- package/out/language/main.cjs +522 -564
- package/out/language/main.cjs.map +3 -3
- package/out/language/parser.d.ts.map +1 -1
- package/out/language/parser.js +10 -3
- package/out/language/parser.js.map +1 -1
- package/out/runtime/api.d.ts.map +1 -1
- package/out/runtime/api.js +0 -14
- package/out/runtime/api.js.map +1 -1
- package/out/runtime/defs.d.ts +0 -1
- package/out/runtime/defs.d.ts.map +1 -1
- package/out/runtime/defs.js +1 -2
- package/out/runtime/defs.js.map +1 -1
- package/out/runtime/embeddings/chunker.d.ts +0 -18
- package/out/runtime/embeddings/chunker.d.ts.map +1 -1
- package/out/runtime/embeddings/chunker.js +15 -47
- package/out/runtime/embeddings/chunker.js.map +1 -1
- package/out/runtime/embeddings/openai.d.ts.map +1 -1
- package/out/runtime/embeddings/openai.js +11 -22
- package/out/runtime/embeddings/openai.js.map +1 -1
- package/out/runtime/embeddings/provider.d.ts +0 -1
- package/out/runtime/embeddings/provider.d.ts.map +1 -1
- package/out/runtime/embeddings/provider.js +1 -20
- package/out/runtime/embeddings/provider.js.map +1 -1
- package/out/runtime/exec-graph.js +5 -5
- package/out/runtime/exec-graph.js.map +1 -1
- package/out/runtime/interpreter.d.ts +4 -4
- package/out/runtime/interpreter.d.ts.map +1 -1
- package/out/runtime/interpreter.js +23 -30
- package/out/runtime/interpreter.js.map +1 -1
- package/out/runtime/loader.d.ts.map +1 -1
- package/out/runtime/loader.js +6 -2
- package/out/runtime/loader.js.map +1 -1
- package/out/runtime/logger.d.ts.map +1 -1
- package/out/runtime/logger.js +1 -8
- package/out/runtime/logger.js.map +1 -1
- package/out/runtime/module.d.ts +0 -6
- package/out/runtime/module.d.ts.map +1 -1
- package/out/runtime/module.js +1 -58
- package/out/runtime/module.js.map +1 -1
- package/out/runtime/modules/ai.d.ts +4 -4
- package/out/runtime/modules/ai.d.ts.map +1 -1
- package/out/runtime/modules/ai.js +70 -166
- package/out/runtime/modules/ai.js.map +1 -1
- package/out/runtime/modules/auth.d.ts.map +1 -1
- package/out/runtime/modules/auth.js +6 -4
- package/out/runtime/modules/auth.js.map +1 -1
- package/out/runtime/monitor.d.ts +2 -1
- package/out/runtime/monitor.d.ts.map +1 -1
- package/out/runtime/monitor.js +5 -1
- package/out/runtime/monitor.js.map +1 -1
- package/out/runtime/resolvers/sqldb/database.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/database.js +126 -128
- package/out/runtime/resolvers/sqldb/database.js.map +1 -1
- package/out/runtime/resolvers/sqldb/impl.d.ts +0 -1
- package/out/runtime/resolvers/sqldb/impl.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/impl.js +0 -3
- package/out/runtime/resolvers/sqldb/impl.js.map +1 -1
- package/out/runtime/services/documentFetcher.d.ts.map +1 -1
- package/out/runtime/services/documentFetcher.js +6 -21
- package/out/runtime/services/documentFetcher.js.map +1 -1
- package/out/runtime/state.d.ts +0 -14
- package/out/runtime/state.d.ts.map +1 -1
- package/out/runtime/state.js +0 -28
- package/out/runtime/state.js.map +1 -1
- package/package.json +19 -19
- package/src/language/agentlang.langium +2 -2
- package/src/language/generated/ast.ts +2 -12
- package/src/language/generated/grammar.ts +18 -52
- package/src/language/parser.ts +9 -2
- package/src/runtime/api.ts +0 -15
- package/src/runtime/defs.ts +1 -2
- package/src/runtime/embeddings/chunker.ts +14 -52
- package/src/runtime/embeddings/openai.ts +9 -27
- package/src/runtime/embeddings/provider.ts +1 -22
- package/src/runtime/exec-graph.ts +4 -4
- package/src/runtime/interpreter.ts +24 -29
- package/src/runtime/loader.ts +10 -2
- package/src/runtime/logger.ts +1 -12
- package/src/runtime/module.ts +1 -64
- package/src/runtime/modules/ai.ts +81 -206
- package/src/runtime/modules/auth.ts +6 -4
- package/src/runtime/monitor.ts +10 -1
- package/src/runtime/resolvers/sqldb/database.ts +130 -142
- package/src/runtime/resolvers/sqldb/impl.ts +0 -4
- package/src/runtime/services/documentFetcher.ts +6 -21
- package/src/runtime/state.ts +0 -29
- package/out/runtime/document-retriever.d.ts +0 -24
- package/out/runtime/document-retriever.d.ts.map +0 -1
- package/out/runtime/document-retriever.js +0 -258
- package/out/runtime/document-retriever.js.map +0 -1
- package/out/runtime/resolvers/vector/lancedb-store.d.ts +0 -16
- package/out/runtime/resolvers/vector/lancedb-store.d.ts.map +0 -1
- package/out/runtime/resolvers/vector/lancedb-store.js +0 -159
- package/out/runtime/resolvers/vector/lancedb-store.js.map +0 -1
- package/out/runtime/resolvers/vector/types.d.ts +0 -32
- package/out/runtime/resolvers/vector/types.d.ts.map +0 -1
- package/out/runtime/resolvers/vector/types.js +0 -2
- package/out/runtime/resolvers/vector/types.js.map +0 -1
- package/src/runtime/document-retriever.ts +0 -311
- package/src/runtime/resolvers/vector/lancedb-store.ts +0 -187
- package/src/runtime/resolvers/vector/types.ts +0 -39
package/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
<div align="center">
|
|
2
3
|
|
|
3
4
|
<p>
|
|
@@ -24,20 +25,18 @@
|
|
|
24
25
|
<a href="https://github.com/agentlang-ai/agentlang/tree/main/example"><img src="https://img.shields.io/badge/Examples-Page-yellow?logo=homepage&logoColor=yellow&style=for-the-badge"></a>
|
|
25
26
|
|
|
26
27
|
[](https://nodejs.org) [](https://github.com/agentlang-ai/agentlang/actions/workflows/ci.yml) [](https://www.npmjs.com/package/agentlang)
|
|
27
|
-
|
|
28
28
|
<hr>
|
|
29
29
|
|
|
30
30
|
## Agentlang - Team as Code
|
|
31
|
-
|
|
32
31
|
</div>
|
|
33
32
|
|
|
34
33
|
Agentlang is a declarative DSL (built on TypeScript) for creating AI Agents and full-stack Agentic Apps. With Agentlang, you define, version, run, mentor, and monitor teams of AI agents, along with the app infrastructure they need: data model, workflows, RBAC, integrations, and UI. We refer to this approach - bringing together AI agent development and App development into a single coherent discipline - as Team-as-Code (our riff on IaC).
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
* **For Devs and Non-Devs:** Code and vibe-code in your IDE, focusing on the business-logic of your app, not wiring. Alternatively, you can build, run, mentor and monitor your AI Team in Studio - our visual-builder (coming soon). Switch back-and-forth between the two modes seamlessly.
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
* **Robust Integrations:** The Agentlang runtime ships with native integrations for LLMs, databases, vector DBs, and auth providers. Our connector architecture is built for the enterprise, with a rapidly growing catalog for systems like Salesforce, ServiceNow, HubSpot, Snowflake, and more. Also, because Agentlang compiles to Node.js (and runs in the browser), you can use any existing JavaScript library out of the box.
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
* **Production-grade**: Under the hood, it’s all modern TypeScript—strong typing, tooling, testing, and CI/CD-friendly workflows—built for enterprise-class reliability, governance, and scale.
|
|
41
40
|
|
|
42
41
|
Agentlang introduces two foundational innovations: [Agentic Reliability Modeling](#-agentic-reliability-modeling) and [AgentLang Ontology](#agentlang-ontology)
|
|
43
42
|
|
|
@@ -102,7 +101,8 @@ flow TicketFlow {
|
|
|
102
101
|
|
|
103
102
|
agent TicketFlow {
|
|
104
103
|
llm "gpt4o",
|
|
105
|
-
role "
|
|
104
|
+
role "ticket_manager",
|
|
105
|
+
goal "You are a network ticket management application. Your job is to triage any ticket passed to you
|
|
106
106
|
and update the ticket with appropriate assigned_to, status and triaging comments.",
|
|
107
107
|
glossary [
|
|
108
108
|
{"name": "incident", "meaning": "a problem report", "synonyms": "ticket"},
|
|
@@ -133,6 +133,7 @@ workflow ticketInProgress {
|
|
|
133
133
|
}
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
|
|
136
137
|
### ✨ First-class AI Agents
|
|
137
138
|
|
|
138
139
|
Agents and many concepts agents use are built-in language constructs.
|
|
@@ -140,7 +141,8 @@ Agents and many concepts agents use are built-in language constructs.
|
|
|
140
141
|
```typescript
|
|
141
142
|
agent TicketFlow {
|
|
142
143
|
llm "gpt4o",
|
|
143
|
-
role "
|
|
144
|
+
role "ticket_manager",
|
|
145
|
+
goal "You are a network ticket management agent. Your job is to triage any ticket passed to you and
|
|
144
146
|
update the ticket with appropriate assigned_to, status and triaging comments."
|
|
145
147
|
}
|
|
146
148
|
|
|
@@ -210,6 +212,7 @@ As the flow executes an agent that specializes in evaluating decision tables wil
|
|
|
210
212
|
|
|
211
213
|
```typescript
|
|
212
214
|
agent salaryHikeAgent {
|
|
215
|
+
role "hr_manager",
|
|
213
216
|
instruction "Give an employee a salary-hike based on his/her sales performance",
|
|
214
217
|
tools acme/employee
|
|
215
218
|
}
|
|
@@ -226,6 +229,7 @@ As the `salaryHikeAgent` tries to compute the salary-increment for a particular
|
|
|
226
229
|
|
|
227
230
|
```typescript
|
|
228
231
|
agent salaryHikeAgent {
|
|
232
|
+
role "hr_manager",
|
|
229
233
|
instruction "Give an employee a salary-hike based on his/her sales performance",
|
|
230
234
|
tools acme/employee
|
|
231
235
|
}
|
|
@@ -254,6 +258,7 @@ Here, the provided scenario helps the agent to take a well-specified action in t
|
|
|
254
258
|
|
|
255
259
|
```typescript
|
|
256
260
|
agent campaignAnalyzer {
|
|
261
|
+
role "marketing_analyst",
|
|
257
262
|
instruction "Evaluate and optimize marketing campaign performance based on key performance indicators (KPIs) and assign a performance rating",
|
|
258
263
|
tools acme/campaign_eval,
|
|
259
264
|
// ...
|
|
@@ -317,6 +322,7 @@ entity Category {
|
|
|
317
322
|
relationship PostCategory between(Post, Category)
|
|
318
323
|
|
|
319
324
|
@public agent postEditor {
|
|
325
|
+
role "content_editor",
|
|
320
326
|
instruction "Create a new blog post based on the outline provided to you.",
|
|
321
327
|
tools [blog.core/Post]
|
|
322
328
|
}
|
|
@@ -328,8 +334,8 @@ What makes this model special is how seamlessly an agent can interact with it
|
|
|
328
334
|
|
|
329
335
|
To get started with Agentlang Ontology, please see the [Agentlang Tutorial](https://docs.fractl.io/app) or explore the following example applications:
|
|
330
336
|
|
|
331
|
-
|
|
332
|
-
|
|
337
|
+
* [Car Dealership](https://github.com/agentlang-ai/agentlang/tree/main/example/car_dealership)
|
|
338
|
+
* [Customer Support System](https://github.com/agentlang-ai/agentlang/tree/main/example/customer_support_system)
|
|
333
339
|
|
|
334
340
|
## 🚀 Getting Started
|
|
335
341
|
|
|
@@ -363,7 +369,14 @@ For contributors who want to build and develop Agentlang itself:
|
|
|
363
369
|
```shell
|
|
364
370
|
# Install dependencies
|
|
365
371
|
npm install
|
|
372
|
+
|
|
373
|
+
OR
|
|
374
|
+
|
|
375
|
+
# Install pnpm: https://pnpm.io/installation
|
|
376
|
+
# Use pnpm
|
|
377
|
+
pnpm install
|
|
366
378
|
```
|
|
379
|
+
**Note**: If pnpm shows build script warnings, run `pnpm approve-builds` and approve esbuild and sqlite3.
|
|
367
380
|
|
|
368
381
|
### ⚡ Build
|
|
369
382
|
|