gauss-ts 2.0.0 → 2.0.2
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 +147 -396
- package/dist/{agent-nEZAfWFD.d.ts → agent-Da25i24I.d.ts} +50 -0
- package/dist/{agent-DXZT4Hd-.d.cts → agent-U5pITdVk.d.cts} +50 -0
- package/dist/agent.cjs +4 -4
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.d.cts +2 -2
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +3 -3
- package/dist/agent.js.map +1 -1
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -3
- package/dist/index.d.ts +48 -3
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/orchestration.cjs +5 -2
- package/dist/orchestration.cjs.map +1 -1
- package/dist/orchestration.d.cts +32 -2
- package/dist/orchestration.d.ts +32 -2
- package/dist/orchestration.js +5 -2
- package/dist/orchestration.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,497 +2,248 @@
|
|
|
2
2
|
|
|
3
3
|
# 🔮 gauss-ts
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Rust-powered AI Agent SDK for TypeScript
|
|
6
6
|
|
|
7
7
|
[](https://github.com/giulio-leone/gauss/actions/workflows/ci.yml)
|
|
8
8
|
[](https://www.npmjs.com/package/gauss-ts)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**Rust-powered • Multi-provider • Enterprise-grade • Plug-and-play DX**
|
|
12
12
|
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
+
Gauss gives you a beautiful TypeScript API over a high-performance Rust core.
|
|
16
|
+
Build single agents, hierarchical teams, DAG pipelines, MCP/A2A systems, and enterprise guardrailed workflows in a few lines.
|
|
17
|
+
|
|
15
18
|
---
|
|
16
19
|
|
|
17
|
-
##
|
|
20
|
+
## Install
|
|
18
21
|
|
|
19
22
|
```bash
|
|
20
23
|
npm install gauss-ts
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
Set one provider key (auto-detection is built in):
|
|
24
27
|
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const answer = await gauss("Explain quantum computing in 3 sentences");
|
|
28
|
+
```bash
|
|
29
|
+
export OPENAI_API_KEY=sk-...
|
|
30
|
+
# or ANTHROPIC_API_KEY / GOOGLE_API_KEY / OPENROUTER_API_KEY / ...
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
---
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
## Quick Start
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
import { Agent, OPENAI_DEFAULT } from "gauss-ts";
|
|
37
|
+
### One-liner
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
model: OPENAI_DEFAULT, // "gpt-5.2"
|
|
41
|
-
instructions: "You are a helpful assistant.",
|
|
42
|
-
});
|
|
39
|
+
```ts
|
|
40
|
+
import { gauss } from "gauss-ts";
|
|
43
41
|
|
|
44
|
-
const
|
|
45
|
-
console.log(
|
|
42
|
+
const text = await gauss("Explain retrieval-augmented generation in 3 bullets.");
|
|
43
|
+
console.log(text);
|
|
46
44
|
```
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## Features
|
|
51
|
-
|
|
52
|
-
### 🤖 Agents
|
|
46
|
+
### Full control
|
|
53
47
|
|
|
54
|
-
```
|
|
48
|
+
```ts
|
|
55
49
|
import { Agent, OPENAI_DEFAULT } from "gauss-ts";
|
|
56
50
|
|
|
57
51
|
const agent = new Agent({
|
|
58
|
-
name: "
|
|
52
|
+
name: "assistant",
|
|
59
53
|
model: OPENAI_DEFAULT, // "gpt-5.2"
|
|
60
|
-
instructions: "You are a
|
|
61
|
-
temperature: 0.
|
|
62
|
-
maxSteps: 5,
|
|
63
|
-
tools: [searchTool, calculateTool],
|
|
54
|
+
instructions: "You are a concise senior engineer.",
|
|
55
|
+
temperature: 0.2,
|
|
64
56
|
});
|
|
65
57
|
|
|
66
|
-
|
|
67
|
-
const result = await agent.run("Find the population of Tokyo");
|
|
58
|
+
const result = await agent.run("Design a clean API for a weather service.");
|
|
68
59
|
console.log(result.text);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Stream
|
|
72
|
-
for await (const event of agent.streamIter("Tell me a story")) {
|
|
73
|
-
if (event.type === "text_delta") process.stdout.write(event.delta);
|
|
74
|
-
}
|
|
60
|
+
agent.destroy();
|
|
75
61
|
```
|
|
76
62
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
const weatherTool = {
|
|
81
|
-
name: "get_weather",
|
|
82
|
-
description: "Get current weather for a location",
|
|
83
|
-
parameters: {
|
|
84
|
-
type: "object",
|
|
85
|
-
properties: {
|
|
86
|
-
city: { type: "string", description: "City name" },
|
|
87
|
-
},
|
|
88
|
-
required: ["city"],
|
|
89
|
-
},
|
|
90
|
-
execute: async (args: { city: string }) => {
|
|
91
|
-
return { temperature: 22, condition: "sunny" };
|
|
92
|
-
},
|
|
93
|
-
};
|
|
63
|
+
---
|
|
94
64
|
|
|
95
|
-
|
|
96
|
-
name: "weather-bot",
|
|
97
|
-
model: OPENAI_DEFAULT,
|
|
98
|
-
tools: [weatherTool],
|
|
99
|
-
});
|
|
100
|
-
```
|
|
65
|
+
## Multi-Agent in a Few Lines
|
|
101
66
|
|
|
102
|
-
###
|
|
67
|
+
### 1) Team.quick() (hierarchical team bootstrap)
|
|
103
68
|
|
|
104
|
-
```
|
|
105
|
-
import {
|
|
69
|
+
```ts
|
|
70
|
+
import { Team } from "gauss-ts";
|
|
106
71
|
|
|
107
|
-
const team =
|
|
108
|
-
name: "
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
new Agent({ name: "critic", model: "gemini-2.5-flash", instructions: "Review and critique." }),
|
|
113
|
-
],
|
|
114
|
-
strategy: "round-robin",
|
|
115
|
-
});
|
|
72
|
+
const team = Team.quick("architecture-team", "parallel", [
|
|
73
|
+
{ name: "planner", instructions: "Break work into milestones." },
|
|
74
|
+
{ name: "implementer", instructions: "Produce production-ready code." },
|
|
75
|
+
{ name: "reviewer", instructions: "Find defects and risks." },
|
|
76
|
+
]);
|
|
116
77
|
|
|
117
|
-
const
|
|
78
|
+
const out = await team.run("Implement a resilient webhook ingestion service.");
|
|
79
|
+
console.log(out.finalText);
|
|
80
|
+
team.destroy();
|
|
118
81
|
```
|
|
119
82
|
|
|
120
|
-
###
|
|
83
|
+
### 2) Graph.pipeline() (2-line DAG)
|
|
121
84
|
|
|
122
|
-
```
|
|
85
|
+
```ts
|
|
123
86
|
import { Agent, Graph } from "gauss-ts";
|
|
124
87
|
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.addNode("write", writer)
|
|
131
|
-
.addEdge("research", "write");
|
|
132
|
-
|
|
133
|
-
const result = await pipeline.run("Explain quantum computing");
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### 🔄 Workflows
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
import { Agent, Workflow } from "gauss-ts";
|
|
140
|
-
|
|
141
|
-
const planner = new Agent({ name: "planner" });
|
|
142
|
-
const executor = new Agent({ name: "executor" });
|
|
143
|
-
|
|
144
|
-
const wf = new Workflow()
|
|
145
|
-
.addStep("plan", planner)
|
|
146
|
-
.addStep("execute", executor)
|
|
147
|
-
.addDependency("execute", "plan");
|
|
148
|
-
|
|
149
|
-
const result = await wf.run("Build a REST API");
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### 🌐 Multi-Agent Network
|
|
153
|
-
|
|
154
|
-
```typescript
|
|
155
|
-
import { Agent, Network } from "gauss-ts";
|
|
156
|
-
|
|
157
|
-
const analyst = new Agent({ name: "analyst" });
|
|
158
|
-
const coder = new Agent({ name: "coder" });
|
|
159
|
-
|
|
160
|
-
const net = new Network()
|
|
161
|
-
.addAgent(analyst)
|
|
162
|
-
.addAgent(coder)
|
|
163
|
-
.setSupervisor("analyst");
|
|
164
|
-
|
|
165
|
-
const result = await net.delegate("coder", "Implement a sorting algorithm");
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### 🧠 Memory
|
|
169
|
-
|
|
170
|
-
```typescript
|
|
171
|
-
import { Agent, Memory } from "gauss-ts";
|
|
172
|
-
|
|
173
|
-
const memory = new Memory();
|
|
174
|
-
const agent = new Agent({
|
|
175
|
-
name: "assistant",
|
|
176
|
-
model: OPENAI_DEFAULT,
|
|
177
|
-
memory,
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
// Memory persists across conversations
|
|
181
|
-
await agent.run("My name is Alice and I love hiking.");
|
|
182
|
-
const result = await agent.run("What do you know about me?");
|
|
183
|
-
// → "You're Alice, and you enjoy hiking!"
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### 📚 RAG / Vector Store
|
|
187
|
-
|
|
188
|
-
```typescript
|
|
189
|
-
import { VectorStore } from "gauss-ts";
|
|
190
|
-
|
|
191
|
-
const store = new VectorStore();
|
|
192
|
-
await store.add("TypeScript is a typed superset of JavaScript.");
|
|
193
|
-
await store.add("Rust is a systems programming language.");
|
|
88
|
+
const graph = Graph.pipeline([
|
|
89
|
+
{ nodeId: "analyze", agent: new Agent({ instructions: "Analyze requirements" }) },
|
|
90
|
+
{ nodeId: "build", agent: new Agent({ instructions: "Implement solution" }) },
|
|
91
|
+
{ nodeId: "verify", agent: new Agent({ instructions: "Validate outputs" }) },
|
|
92
|
+
]);
|
|
194
93
|
|
|
195
|
-
const
|
|
94
|
+
const out = await graph.run("Build a typed SDK wrapper around a REST API.");
|
|
95
|
+
console.log(out.finalText);
|
|
96
|
+
graph.destroy();
|
|
196
97
|
```
|
|
197
98
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
```typescript
|
|
201
|
-
import { McpServer } from "gauss-ts";
|
|
202
|
-
|
|
203
|
-
const server = new McpServer("my-tools", "1.0.0");
|
|
204
|
-
|
|
205
|
-
server.addTool({
|
|
206
|
-
name: "calculate",
|
|
207
|
-
description: "Evaluate a math expression",
|
|
208
|
-
parameters: { type: "object", properties: { expr: { type: "string" } } },
|
|
209
|
-
execute: async ({ expr }) => ({ result: eval(expr) }),
|
|
210
|
-
});
|
|
99
|
+
---
|
|
211
100
|
|
|
212
|
-
|
|
213
|
-
```
|
|
101
|
+
## Agent DX
|
|
214
102
|
|
|
215
|
-
###
|
|
103
|
+
### Inline tools with `withTool()`
|
|
216
104
|
|
|
217
|
-
```
|
|
218
|
-
import { Agent
|
|
105
|
+
```ts
|
|
106
|
+
import { Agent } from "gauss-ts";
|
|
219
107
|
|
|
220
|
-
const agent = new Agent({
|
|
108
|
+
const agent = new Agent({ instructions: "Use tools when useful." })
|
|
109
|
+
.withTool(
|
|
110
|
+
"sum",
|
|
111
|
+
"Sum two numbers",
|
|
112
|
+
({ a, b }: { a: number; b: number }) => ({ result: a + b }),
|
|
113
|
+
{
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: { a: { type: "number" }, b: { type: "number" } },
|
|
116
|
+
required: ["a", "b"],
|
|
117
|
+
}
|
|
118
|
+
);
|
|
221
119
|
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
properties: {
|
|
226
|
-
languages: { type: "array", items: { type: "string" } },
|
|
227
|
-
},
|
|
228
|
-
required: ["languages"],
|
|
229
|
-
},
|
|
230
|
-
maxParseRetries: 2,
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
console.log(data.languages); // ["TypeScript", "Rust", "Python"]
|
|
120
|
+
const out = await agent.run("What is 12 + 30?");
|
|
121
|
+
console.log(out.text);
|
|
122
|
+
agent.destroy();
|
|
234
123
|
```
|
|
235
124
|
|
|
236
|
-
###
|
|
237
|
-
|
|
238
|
-
```typescript
|
|
239
|
-
import { Agent, OPENAI_REASONING, ANTHROPIC_PREMIUM } from "gauss-ts";
|
|
125
|
+
### Streaming helpers
|
|
240
126
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
127
|
+
```ts
|
|
128
|
+
// Low-level async iterable events
|
|
129
|
+
const stream = agent.streamIter("Write a short release note");
|
|
130
|
+
for await (const event of stream) {
|
|
131
|
+
if (event.type === "text_delta") process.stdout.write(event.text ?? "");
|
|
132
|
+
}
|
|
247
133
|
|
|
248
|
-
//
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
model: ANTHROPIC_PREMIUM,
|
|
252
|
-
thinkingBudget: 10000,
|
|
134
|
+
// High-level DX helper: returns final text + optional delta callback
|
|
135
|
+
const finalText = await agent.streamText("Write a changelog", (delta) => {
|
|
136
|
+
process.stdout.write(delta);
|
|
253
137
|
});
|
|
254
|
-
|
|
255
|
-
const result = await thinker.run("Analyze this complex problem...");
|
|
256
|
-
console.log(result.thinking); // Internal reasoning process
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### 📝 Prompt Templates
|
|
260
|
-
|
|
261
|
-
```typescript
|
|
262
|
-
import { template, summarize, translate, codeReview } from "gauss-ts";
|
|
263
|
-
|
|
264
|
-
// Custom template
|
|
265
|
-
const greet = template("Hello {{name}}, you are a {{role}}.");
|
|
266
|
-
console.log(greet({ name: "Alice", role: "developer" }));
|
|
267
|
-
|
|
268
|
-
// Built-in templates
|
|
269
|
-
const prompt = summarize({ format: "article", style: "bullet points", text: "..." });
|
|
270
|
-
const translated = translate({ language: "French", text: "Hello world" });
|
|
271
|
-
const review = codeReview({ language: "typescript", code: "const x = 1;" });
|
|
272
138
|
```
|
|
273
139
|
|
|
274
|
-
###
|
|
140
|
+
### Config helpers
|
|
275
141
|
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const results = await batch(
|
|
280
|
-
["Translate: Hello", "Translate: World", "Translate: Goodbye"],
|
|
281
|
-
{ concurrency: 2, provider: "openai" },
|
|
282
|
-
);
|
|
283
|
-
results.forEach((r) => console.log(r.result?.text ?? r.error?.message));
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
### 🔁 Retry with Backoff
|
|
287
|
-
|
|
288
|
-
```typescript
|
|
289
|
-
import { withRetry, retryable } from "gauss-ts";
|
|
290
|
-
|
|
291
|
-
const data = await withRetry(() => agent.run("Summarize this"), {
|
|
292
|
-
maxRetries: 3,
|
|
293
|
-
backoff: "exponential", // "fixed" | "linear" | "exponential"
|
|
294
|
-
baseDelayMs: 1000,
|
|
295
|
-
jitter: 0.1,
|
|
296
|
-
onRetry: (err, attempt, delay) => console.log(`Retry ${attempt} in ${delay}ms`),
|
|
297
|
-
});
|
|
142
|
+
```ts
|
|
143
|
+
// Explicit env-intent constructor
|
|
144
|
+
const a = Agent.fromEnv({ instructions: "Be precise." });
|
|
298
145
|
|
|
299
|
-
//
|
|
300
|
-
const
|
|
301
|
-
const result = await resilientRun("Hello");
|
|
146
|
+
// Clone with a different model
|
|
147
|
+
const b = a.withModel("gpt-4.1");
|
|
302
148
|
```
|
|
303
149
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
```typescript
|
|
307
|
-
import { createFallbackProvider, createCircuitBreaker, createResilientAgent } from "gauss-ts";
|
|
150
|
+
---
|
|
308
151
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
152
|
+
## Core Features
|
|
153
|
+
|
|
154
|
+
- **Agents**: `Agent`, `gauss()`
|
|
155
|
+
- **Teams**: `Team`, `Team.quick()`
|
|
156
|
+
- **Graphs**: `Graph`, `Graph.pipeline()`, `addConditionalEdge()`
|
|
157
|
+
- **Workflows / Networks**: `Workflow`, `Network`
|
|
158
|
+
- **Typed tools**: `tool()`, `createToolExecutor()`, `withTool()`
|
|
159
|
+
- **MCP**: `McpServer`, `McpClient`
|
|
160
|
+
- **A2A**: `A2aClient`
|
|
161
|
+
- **Memory + RAG**: `Memory`, `VectorStore`, `TextSplitter`, `loadText/loadMarkdown/loadJson`
|
|
162
|
+
- **Guardrails + Middleware**: `GuardrailChain`, `MiddlewareChain`
|
|
163
|
+
- **Reliability**: retry, circuit breaker, fallback providers
|
|
164
|
+
- **Observability & quality**: `Telemetry`, `EvalRunner`
|
|
165
|
+
- **Enterprise preset**: `enterprisePreset()`, `enterpriseRun()`
|
|
313
166
|
|
|
314
|
-
|
|
315
|
-
const agent = createResilientAgent({ fallback, circuitBreaker: breaker });
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
### 🔀 Pipeline & Async Helpers
|
|
167
|
+
---
|
|
319
168
|
|
|
320
|
-
|
|
321
|
-
import { pipe, mapAsync, filterAsync, reduceAsync, compose } from "gauss-ts";
|
|
169
|
+
## Errors (typed hierarchy)
|
|
322
170
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
171
|
+
```ts
|
|
172
|
+
import {
|
|
173
|
+
GaussError,
|
|
174
|
+
DisposedError,
|
|
175
|
+
ProviderError,
|
|
176
|
+
ToolExecutionError,
|
|
177
|
+
ValidationError,
|
|
178
|
+
} from "gauss-ts";
|
|
328
179
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
180
|
+
try {
|
|
181
|
+
await agent.run("hello");
|
|
182
|
+
} catch (err) {
|
|
183
|
+
if (err instanceof DisposedError) {
|
|
184
|
+
// resource already destroyed
|
|
185
|
+
}
|
|
186
|
+
}
|
|
334
187
|
```
|
|
335
188
|
|
|
336
189
|
---
|
|
337
190
|
|
|
338
|
-
##
|
|
191
|
+
## Model Constants
|
|
339
192
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
193
|
+
```ts
|
|
343
194
|
import {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
// Anthropic
|
|
351
|
-
ANTHROPIC_DEFAULT, // "claude-sonnet-4-20250514"
|
|
352
|
-
ANTHROPIC_PREMIUM, // "claude-opus-4-20250414"
|
|
353
|
-
ANTHROPIC_FAST, // "claude-haiku-4-20250414"
|
|
354
|
-
|
|
355
|
-
// Google
|
|
356
|
-
GOOGLE_DEFAULT, // "gemini-2.5-flash"
|
|
357
|
-
GOOGLE_PREMIUM, // "gemini-2.5-pro"
|
|
358
|
-
GOOGLE_IMAGE, // "gemini-2.0-flash"
|
|
359
|
-
|
|
360
|
-
// OpenRouter
|
|
361
|
-
OPENROUTER_DEFAULT, // "openai/gpt-5.2"
|
|
362
|
-
|
|
363
|
-
// DeepSeek
|
|
364
|
-
DEEPSEEK_DEFAULT, // "deepseek-chat"
|
|
365
|
-
DEEPSEEK_REASONING, // "deepseek-reasoner"
|
|
366
|
-
|
|
367
|
-
// Helpers
|
|
368
|
-
PROVIDER_DEFAULTS, // Record<string, string>
|
|
369
|
-
defaultModel, // (provider: string) => string
|
|
195
|
+
OPENAI_DEFAULT, OPENAI_FAST, OPENAI_REASONING,
|
|
196
|
+
ANTHROPIC_DEFAULT, ANTHROPIC_FAST, ANTHROPIC_PREMIUM,
|
|
197
|
+
GOOGLE_DEFAULT, GOOGLE_PREMIUM,
|
|
198
|
+
DEEPSEEK_DEFAULT, DEEPSEEK_REASONING,
|
|
199
|
+
PROVIDER_DEFAULTS, defaultModel,
|
|
370
200
|
} from "gauss-ts";
|
|
371
201
|
```
|
|
372
202
|
|
|
373
203
|
---
|
|
374
204
|
|
|
375
|
-
##
|
|
205
|
+
## Providers
|
|
376
206
|
|
|
377
|
-
| Provider | Env Variable | Default
|
|
378
|
-
|
|
207
|
+
| Provider | Env Variable | Example Default |
|
|
208
|
+
|---|---|---|
|
|
379
209
|
| OpenAI | `OPENAI_API_KEY` | `gpt-5.2` |
|
|
380
210
|
| Anthropic | `ANTHROPIC_API_KEY` | `claude-sonnet-4-20250514` |
|
|
381
211
|
| Google | `GOOGLE_API_KEY` | `gemini-2.5-flash` |
|
|
382
212
|
| DeepSeek | `DEEPSEEK_API_KEY` | `deepseek-chat` |
|
|
383
|
-
| Groq | `GROQ_API_KEY` |
|
|
384
|
-
| Ollama |
|
|
213
|
+
| Groq | `GROQ_API_KEY` | provider-dependent |
|
|
214
|
+
| Ollama | local runtime | `llama3.2` |
|
|
385
215
|
| OpenRouter | `OPENROUTER_API_KEY` | `openai/gpt-5.2` |
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
# or
|
|
392
|
-
export ANTHROPIC_API_KEY=sk-ant-...
|
|
393
|
-
# or
|
|
394
|
-
export GOOGLE_API_KEY=AIza...
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
---
|
|
398
|
-
|
|
399
|
-
## 🧩 All Features
|
|
400
|
-
|
|
401
|
-
| Feature | Module | Description |
|
|
402
|
-
|---------|--------|-------------|
|
|
403
|
-
| **Agent** | `Agent`, `gauss()` | LLM agent with tools, structured output, streaming |
|
|
404
|
-
| **Streaming** | `AgentStream` | Async iterable streaming with `for await` |
|
|
405
|
-
| **Batch** | `batch()` | Parallel prompt execution with concurrency control |
|
|
406
|
-
| **Graph** | `Graph` | DAG-based multi-agent pipeline |
|
|
407
|
-
| **Workflow** | `Workflow` | Step-based execution with dependencies |
|
|
408
|
-
| **Team** | `Team` | Multi-agent team with strategy (round-robin, etc.) |
|
|
409
|
-
| **Network** | `Network` | Multi-agent delegation with supervisor |
|
|
410
|
-
| **Memory** | `Memory` | Persistent conversation memory |
|
|
411
|
-
| **VectorStore** | `VectorStore` | Embedding storage and semantic search (RAG) |
|
|
412
|
-
| **MCP** | `McpServer` | Model Context Protocol server |
|
|
413
|
-
| **Middleware** | `MiddlewareChain` | Request/response processing pipeline |
|
|
414
|
-
| **Guardrails** | `GuardrailChain` | Content moderation, PII, token limits, regex |
|
|
415
|
-
| **Retry** | `withRetry`, `retryable` | Exponential/linear/fixed backoff with jitter |
|
|
416
|
-
| **Resilience** | `createResilientAgent` | Fallback providers + circuit breaker |
|
|
417
|
-
| **Structured** | `structured()` | Typed JSON extraction with auto-retry |
|
|
418
|
-
| **Templates** | `template()` | Composable prompt templates with built-ins |
|
|
419
|
-
| **Pipeline** | `pipe`, `mapAsync`, `compose` | Async data flow composition |
|
|
420
|
-
| **Evaluation** | `EvalRunner` | Agent quality scoring with datasets |
|
|
421
|
-
| **Telemetry** | `Telemetry` | Spans, metrics, and export |
|
|
422
|
-
| **Approval** | `ApprovalManager` | Human-in-the-loop approval flow |
|
|
423
|
-
| **Checkpoint** | `CheckpointStore` | Save/restore agent state |
|
|
424
|
-
| **Tokens** | `countTokens` | Token counting and context window info |
|
|
425
|
-
| **Plugins** | `PluginRegistry` | Extensible plugin system |
|
|
426
|
-
| **Config** | `parseAgentConfig` | JSON config parsing with env resolution |
|
|
427
|
-
| **A2A** | `A2aClient` | Agent-to-Agent protocol client |
|
|
428
|
-
| **Tool Registry** | `ToolRegistry` | Searchable tool catalog with examples |
|
|
429
|
-
| **Spec Parsers** | `AgentSpec`, `SkillSpec` | AGENTS.MD & SKILL.MD discovery and parsing |
|
|
216
|
+
| Together | `TOGETHER_API_KEY` | provider-dependent |
|
|
217
|
+
| Fireworks | `FIREWORKS_API_KEY` | provider-dependent |
|
|
218
|
+
| Mistral | `MISTRAL_API_KEY` | provider-dependent |
|
|
219
|
+
| Perplexity | `PERPLEXITY_API_KEY` | provider-dependent |
|
|
220
|
+
| xAI | `XAI_API_KEY` | provider-dependent |
|
|
430
221
|
|
|
431
222
|
---
|
|
432
223
|
|
|
433
|
-
##
|
|
224
|
+
## Architecture
|
|
434
225
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
▼
|
|
444
|
-
gauss-core (Rust engine)
|
|
226
|
+
```text
|
|
227
|
+
gauss-ts (TypeScript SDK)
|
|
228
|
+
│
|
|
229
|
+
▼
|
|
230
|
+
gauss-napi (NAPI bindings)
|
|
231
|
+
│
|
|
232
|
+
▼
|
|
233
|
+
gauss-core (Rust engine)
|
|
445
234
|
```
|
|
446
235
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
## 📁 Examples
|
|
450
|
-
|
|
451
|
-
See the [`examples/`](examples/) directory for **23 complete examples** covering every feature:
|
|
452
|
-
|
|
453
|
-
| # | Example | Feature |
|
|
454
|
-
|---|---------|---------|
|
|
455
|
-
| 01 | Basic Agent | Agent creation, run, stream |
|
|
456
|
-
| 02 | Planning Agent | Multi-step planning |
|
|
457
|
-
| 03 | Sub-agent Orchestration | Agent delegation |
|
|
458
|
-
| 04 | MCP Integration | Model Context Protocol |
|
|
459
|
-
| 05 | Persistent Memory | Conversation memory |
|
|
460
|
-
| 06 | Full-Featured | All features combined |
|
|
461
|
-
| 07 | Plugin System | Custom plugins |
|
|
462
|
-
| 08 | A2A Server | Agent-to-Agent protocol |
|
|
463
|
-
| 09 | CLI & REST | HTTP + CLI interfaces |
|
|
464
|
-
| 10 | Team Coordination | Multi-agent teams |
|
|
465
|
-
| 11 | Voice Pipeline | Audio/voice processing |
|
|
466
|
-
| 12 | Workflow DSL | Declarative workflows |
|
|
467
|
-
| 13 | Multimodal Vision | Image understanding |
|
|
468
|
-
| 14 | Video Processing | Video analysis |
|
|
469
|
-
| 15 | Universal Provider | Cross-provider usage |
|
|
470
|
-
| 16 | LLM Recording | Record & replay |
|
|
471
|
-
| 17 | Zero Config | Auto-detect everything |
|
|
472
|
-
| 18 | Tool Registry | Searchable tools |
|
|
473
|
-
| 19 | Graph Pipeline | DAG pipelines |
|
|
474
|
-
| 20 | Network Delegation | Supervisor networks |
|
|
475
|
-
| 21 | Structured Output | JSON extraction |
|
|
476
|
-
| 22 | DX Utilities | Developer experience helpers |
|
|
477
|
-
| 23 | Reasoning | o4-mini, extended thinking |
|
|
236
|
+
All heavy orchestration and runtime logic is executed in Rust.
|
|
478
237
|
|
|
479
238
|
---
|
|
480
239
|
|
|
481
|
-
##
|
|
482
|
-
|
|
483
|
-
| Package | Language | Description |
|
|
484
|
-
|---------|----------|-------------|
|
|
485
|
-
| [`gauss-core`](https://github.com/giulio-leone/gauss-core) | Rust | Core engine — NAPI + PyO3 + WASM |
|
|
486
|
-
| [`gauss-ts`](https://github.com/giulio-leone/gauss) | TypeScript | This SDK (NAPI bindings) |
|
|
487
|
-
| [`gauss-py`](https://github.com/giulio-leone/gauss-py) | Python | Python SDK (PyO3 bindings) |
|
|
488
|
-
|
|
489
|
-
## API Reference
|
|
490
|
-
|
|
491
|
-
```bash
|
|
492
|
-
npm run docs
|
|
493
|
-
```
|
|
240
|
+
## Ecosystem
|
|
494
241
|
|
|
495
|
-
|
|
242
|
+
| Package | Language | Repo |
|
|
243
|
+
|---|---|---|
|
|
244
|
+
| `gauss-core` | Rust | https://github.com/giulio-leone/gauss-core |
|
|
245
|
+
| `gauss-ts` | TypeScript | https://github.com/giulio-leone/gauss |
|
|
246
|
+
| `gauss-py` | Python | https://github.com/giulio-leone/gauss-py |
|
|
496
247
|
|
|
497
248
|
## License
|
|
498
249
|
|