@lakitu/sdk 0.1.2 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +383 -213
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,24 +4,221 @@
4
4
 
5
5
  # @lakitu/sdk
6
6
 
7
- > Self-hosted AI agent framework for [Convex](https://convex.dev) + [E2B](https://e2b.dev) with **code execution**.
7
+ > **The Professional OS for Autonomous AI Agents**
8
8
 
9
- Lakitu runs AI agents in secure E2B sandboxes where they write and execute TypeScript code. Instead of JSON tool calls, agents import from **KSAs** (Knowledge, Skills, and Abilities) plain TypeScript modules.
10
-
11
- ## Quick Start
9
+ Lakitu is a framework for building AI agents that actually finish what they start. While most agents suffer from "agentic amnesia"—forgetting their plan halfway through complex tasks—Lakitu provides the execution environment, structured memory, and competency system that transforms unreliable chatbots into autonomous professionals.
12
10
 
13
11
  ```bash
14
- # In your Convex project
15
12
  npx @lakitu/sdk init
13
+ ```
16
14
 
17
- # Build your E2B sandbox template
18
- npx @lakitu/sdk build
15
+ ---
16
+
17
+ ## The Problem with Current AI Agents
18
+
19
+ Today's coding agents fail in predictable ways:
20
+
21
+ | Failure Mode | What Happens | Root Cause |
22
+ |--------------|--------------|------------|
23
+ | **Agentic Amnesia** | Agent completes 30% of work, declares victory | Context window fills with noise, plan is forgotten |
24
+ | **Environment Corruption** | Agent breaks the host system | No execution isolation |
25
+ | **Behavioral Drift** | Agent ignores instructions over time | Competencies buried in monolithic prompts |
26
+ | **State Blindness** | Agent hallucinates progress | No structured state to verify against |
27
+
28
+ Lakitu solves each of these with four integrated systems:
29
+
30
+ ```
31
+ ┌─────────────────────────────────────────────────────────────────────┐
32
+ │ LAKITU FRAMEWORK │
33
+ ├─────────────────────────────────────────────────────────────────────┤
34
+ │ │
35
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌────────┐ │
36
+ │ │ E2B Sandbox │ │ KSA Files │ │ Beads │ │ Convex │ │
37
+ │ │ (Security) │ │ (Competency) │ │ (Memory) │ │(State) │ │
38
+ │ └──────────────┘ └──────────────┘ └──────────────┘ └────────┘ │
39
+ │ │ │ │ │ │
40
+ │ ▼ ▼ ▼ ▼ │
41
+ │ Hardware-level Structured Git-backed Real-time │
42
+ │ isolation via behavioral task graph reactive │
43
+ │ Firecracker configuration with decay database │
44
+ │ microVMs & modular skills & forensics │
45
+ │ │
46
+ └─────────────────────────────────────────────────────────────────────┘
47
+ ```
48
+
49
+ ---
50
+
51
+ ## The Code Execution Model
52
+
53
+ Traditional agents use JSON tool calls. Lakitu agents write and execute code:
19
54
 
20
- # Publish template to E2B
21
- npx @lakitu/sdk publish
22
55
  ```
56
+ Traditional Agent: Lakitu Agent:
57
+ ┌───────────────────┐ ┌───────────────────┐
58
+ │ LLM Response │ │ LLM Response │
59
+ │ { │ │ ```typescript │
60
+ │ "tool": "x", │ vs │ import { x } │
61
+ │ "args": {...} │ │ await x(...) │
62
+ │ } │ │ ``` │
63
+ └────────┬──────────┘ └────────┬──────────┘
64
+ │ │
65
+ Parse JSON Execute TypeScript
66
+ Route to executor in E2B sandbox
67
+ │ │
68
+ ┌────▼────┐ ┌───────▼───────┐
69
+ │ Limited │ │ Full Computer │
70
+ │ Actions │ │ File, Shell, │
71
+ └─────────┘ │ Browser, etc. │
72
+ └───────────────┘
73
+ ```
74
+
75
+ **Why code execution?**
23
76
 
24
- ## Installation
77
+ - **Token Efficient** — No tool schemas sent every request (saves 40-60% tokens)
78
+ - **Composable** — Chain operations naturally: `const data = await fetch(); await process(data);`
79
+ - **Debuggable** — See exactly what code ran, not just tool call logs
80
+ - **Model Agnostic** — Any LLM that generates code works
81
+
82
+ ---
83
+
84
+ ## The Four Pillars
85
+
86
+ ### 1. E2B Sandbox — Hardware-Level Security
87
+
88
+ Agents need filesystem access and terminal commands. Running this on your machine is dangerous. Lakitu uses [E2B](https://e2b.dev) sandboxes powered by **Firecracker microVMs**—the same technology AWS uses for Lambda.
89
+
90
+ | Metric | Docker | E2B Firecracker |
91
+ |--------|--------|-----------------|
92
+ | Startup | 500ms - 2s | **~150ms** |
93
+ | Isolation | OS-level (namespaces) | **Hardware-level (KVM)** |
94
+ | Security | Process boundaries | **Full VM isolation** |
95
+ | Persistence | Ephemeral | **Up to 14 days** |
96
+
97
+ The agent gets its own cloud computer where it can install packages, run tests, and verify actions—without any risk to your environment.
98
+
99
+ ```typescript
100
+ // Agent writes code that executes in the sandbox
101
+ import { file, shell } from './ksa';
102
+
103
+ await file.write('app.ts', code);
104
+ const result = await shell.exec('bun test');
105
+
106
+ if (result.exitCode !== 0) {
107
+ // Agent can read errors and self-correct
108
+ const errors = await file.read('test-output.log');
109
+ // ... fix and retry
110
+ }
111
+ ```
112
+
113
+ ### 2. KSA Files — Structured Competency
114
+
115
+ The "monolithic prompt" problem: instructions, persona, and tool definitions crammed into one system message leads to behavioral drift. Lakitu introduces **KSA (Knowledge, Skills, and Abilities) files**—a framework borrowed from industrial-organizational psychology.
116
+
117
+ | Component | Definition | Agent Example |
118
+ |-----------|------------|---------------|
119
+ | **Knowledge** | Theoretical understanding | "TypeScript generics", "REST API design" |
120
+ | **Skills** | Practical application | "Writing unit tests", "Database migrations" |
121
+ | **Abilities** | Underlying capabilities | "Multi-step reasoning", "Self-correction" |
122
+
123
+ Instead of prose prompts, you define machine-readable competency files:
124
+
125
+ ```typescript
126
+ import { defineKSA, fn, service } from "@lakitu/sdk";
127
+
128
+ export const migrationKSA = defineKSA("database-migrations")
129
+ .description("Perform zero-downtime database migrations")
130
+ .category("skills")
131
+
132
+ .fn("planMigration", fn()
133
+ .description("Analyze schema changes and create migration plan")
134
+ .param("currentSchema", { type: "string", required: true })
135
+ .param("targetSchema", { type: "string", required: true })
136
+ .impl(service("services.Migration.internal.plan"))
137
+ )
138
+
139
+ .fn("executeMigration", fn()
140
+ .description("Run migration with rollback capability")
141
+ .param("plan", { type: "object", required: true })
142
+ .param("dryRun", { type: "boolean", default: true })
143
+ .impl(service("services.Migration.internal.execute"))
144
+ )
145
+
146
+ .build();
147
+ ```
148
+
149
+ This achieves **behavioral firmware**—stable, testable, version-controlled agent capabilities.
150
+
151
+ ### 3. Beads — Git-Backed Task Memory
152
+
153
+ Markdown todo lists fail because they're unstructured and fall out of sync. Agents using them complete a subtask, forget the six-phase plan, and declare victory at 30%.
154
+
155
+ **Beads** is a git-backed graph issue tracker designed for AI agents:
156
+
157
+ ```bash
158
+ bd init # Initialize task database
159
+ bd create "Migrate to Riverpod" -t epic
160
+ bd create "Setup dependencies" --parent bd-a1b2
161
+ bd ready # List unblocked tasks
162
+ bd update bd-c3d4 --status in_progress
163
+ bd close bd-c3d4 --reason "Migration complete"
164
+ bd compact # Summarize old tasks, preserve context
165
+ ```
166
+
167
+ **Key features:**
168
+
169
+ - **Dependency-aware**: `bd ready` returns only unblocked tasks
170
+ - **Hash-based IDs**: No merge conflicts in multi-agent workflows
171
+ - **Semantic decay**: `bd compact` summarizes 100 lines of history into 5 lines of context
172
+ - **Forensic audit**: Every task change is tracked in git
173
+
174
+ ```
175
+ ┌─────────────────────────────────────────────────────────────────┐
176
+ │ BEADS TASK GRAPH │
177
+ ├─────────────────────────────────────────────────────────────────┤
178
+ │ │
179
+ │ [Epic: Migrate App] │
180
+ │ │ │
181
+ │ ┌────┴────┐ │
182
+ │ ▼ ▼ │
183
+ │ [Setup] [Core Migration] │
184
+ │ │ │ │
185
+ │ ▼ ┌────┴────┐ │
186
+ │ ✓ [Service A] [Service B] ← blocked by Service A │
187
+ │ │ │
188
+ │ ▼ │
189
+ │ [discovered: memory leak] ← auto-created during work │
190
+ │ │
191
+ └─────────────────────────────────────────────────────────────────┘
192
+ ```
193
+
194
+ ### 4. Convex — Localized Real-Time State
195
+
196
+ For agents to work as collaborative partners, they need more than files—they need a **reactive state layer**. Lakitu deploys a localized [Convex](https://convex.dev) backend inside the sandbox.
197
+
198
+ **Why this matters:**
199
+
200
+ - **State Persistence**: Complex application state survives process restarts
201
+ - **Reactive Orchestration**: Database changes trigger functions—coordinate multi-agent swarms
202
+ - **Verification**: Agent can check actual state vs. claimed progress (prevents hallucinated completion)
203
+ - **Full-Stack Autonomy**: Agent can develop, deploy, and manage entire applications
204
+
205
+ ```typescript
206
+ // Agent stores structured state, not just files
207
+ await ctx.runMutation(api.tasks.complete, {
208
+ taskId: "bd-a1b2",
209
+ result: { filesChanged: 3, testsPass: true }
210
+ });
211
+
212
+ // Other agents (or humans) see updates instantly
213
+ const status = await ctx.runQuery(api.project.status);
214
+ // { completed: 23, remaining: 4, blocked: 1 }
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Quick Start
220
+
221
+ ### Installation
25
222
 
26
223
  ```bash
27
224
  npm install @lakitu/sdk
@@ -29,237 +226,226 @@ npm install @lakitu/sdk
29
226
  bun add @lakitu/sdk
30
227
  ```
31
228
 
32
- ## CLI Commands
33
-
34
- ### `npx @lakitu/sdk init`
35
-
36
- Initialize Lakitu in your Convex project:
229
+ ### Initialize in Your Convex Project
37
230
 
38
231
  ```bash
39
232
  npx @lakitu/sdk init
40
- npx @lakitu/sdk init --dir ./convex # Custom convex directory
41
- npx @lakitu/sdk init --skip-install # Skip npm install
42
233
  ```
43
234
 
44
235
  This creates:
45
236
  ```
46
237
  convex/
47
238
  └── lakitu/
48
- ├── config.ts # Lakitu configuration
239
+ ├── config.ts # Framework configuration
49
240
  └── example.ts # Example KSA to get started
50
241
  ```
51
242
 
52
- ### `npx @lakitu/sdk build`
53
-
54
- Build your E2B sandbox template with pre-deployed Convex functions:
243
+ ### Build Your Sandbox Template
55
244
 
56
245
  ```bash
57
- npx @lakitu/sdk build # Build both base + custom templates
58
- npx @lakitu/sdk build --base # Build base template only
59
- npx @lakitu/sdk build --custom # Build custom template only
246
+ npx @lakitu/sdk build
60
247
  ```
61
248
 
62
- ### `npx @lakitu/sdk publish`
249
+ This:
250
+ 1. Starts a local Convex backend
251
+ 2. Pre-deploys your functions
252
+ 3. Builds an E2B template with everything baked in
253
+ 4. Sandboxes boot in ~150ms with functions ready
63
254
 
64
- Manage your E2B templates:
255
+ ### Configure
65
256
 
66
- ```bash
67
- npx @lakitu/sdk publish
68
- ```
69
-
70
- ## The Code Execution Model
257
+ Edit `convex/lakitu/config.ts`:
71
258
 
72
- Traditional agents use JSON tool calls. Lakitu agents write code:
259
+ ```typescript
260
+ import { Lakitu } from "@lakitu/sdk";
73
261
 
262
+ export default Lakitu.configure({
263
+ template: "lakitu",
264
+ model: "anthropic/claude-sonnet-4-20250514",
265
+
266
+ ksas: [
267
+ // Core capabilities
268
+ "file", "shell", "browser", "beads",
269
+
270
+ // Your custom KSAs
271
+ "./migrations",
272
+ "./testing",
273
+ ],
274
+
275
+ pool: {
276
+ min: 0,
277
+ max: 5,
278
+ idleTimeout: 300_000,
279
+ },
280
+ });
74
281
  ```
75
- Traditional Agent: Lakitu Agent:
76
- ┌─────────────────┐ ┌─────────────────┐
77
- │ LLM Response │ │ LLM Response │
78
- │ { │ │ ```typescript │
79
- │ "tool": "x", │ vs │ import { x } │
80
- │ "args": {} │ │ await x(...) │
81
- │ } │ │ ``` │
82
- └────────┬────────┘ └────────┬────────┘
83
- │ │
84
- Parse JSON Execute TypeScript
85
- Route to tool (E2B sandbox)
86
- │ │
87
- ┌────▼────┐ ┌───────▼───────┐
88
- │ Executor │ │ KSA Modules │
89
- └─────────┘ └───────────────┘
90
- ```
91
-
92
- **Why code execution?**
93
- - **Token efficient** — No tool schemas sent every request
94
- - **Composable** — Chain operations naturally in code
95
- - **Debuggable** — See exactly what code ran
96
- - **Model agnostic** — Any LLM that generates code works
97
282
 
98
283
  ---
99
284
 
100
- ## KSA SDK
285
+ ## CLI Reference
101
286
 
102
- KSAs (Knowledge, Skills, and Abilities) are capability modules that agents use via code execution. The SDK provides a type-safe builder API for defining KSAs.
287
+ | Command | Description |
288
+ |---------|-------------|
289
+ | `npx @lakitu/sdk init` | Initialize Lakitu in your Convex project |
290
+ | `npx @lakitu/sdk init --dir ./convex` | Specify custom Convex directory |
291
+ | `npx @lakitu/sdk build` | Build E2B template (base + custom) |
292
+ | `npx @lakitu/sdk build --base` | Build base template only |
293
+ | `npx @lakitu/sdk build --custom` | Build custom template only |
294
+ | `npx @lakitu/sdk publish` | Manage E2B templates |
295
+
296
+ ---
297
+
298
+ ## KSA SDK Reference
103
299
 
104
300
  ### Defining a KSA
105
301
 
106
302
  ```typescript
107
- import { defineKSA, fn, service, primitive } from "@lakitu/sdk";
108
-
109
- export const myKSA = defineKSA("myKsa")
110
- .description("Description of what this KSA does")
111
- .category("skills") // "core" | "skills" | "deliverables"
112
- .group("research") // Optional subcategory
113
- .icon("mdi-search") // Optional MDI icon
114
-
115
- // Add functions
116
- .fn("search", fn()
117
- .description("Search for something")
118
- .param("query", { type: "string", required: true })
303
+ import { defineKSA, fn, service, primitive, composite } from "@lakitu/sdk";
304
+
305
+ export const myKSA = defineKSA("name")
306
+ .description("What this KSA enables")
307
+ .category("skills") // "core" | "skills" | "deliverables"
308
+ .group("subcategory") // Optional grouping
309
+ .icon("mdi-icon-name") // Optional MDI icon
310
+
311
+ .fn("functionName", fn()
312
+ .description("What this function does")
313
+ .param("input", { type: "string", required: true })
119
314
  .param("limit", { type: "number", default: 10 })
120
- .returns<SearchResult[]>()
121
- .impl(service("services.Search.internal.query")
122
- .mapArgs(({ query, limit }) => ({ q: query, max: limit }))
123
- .mapResult(r => r.results)
124
- )
125
- )
126
-
127
- .fn("readFile", fn()
128
- .description("Read a local file")
129
- .param("path", { type: "string", required: true })
130
- .impl(primitive("file.read"))
315
+ .returns<ResultType>()
316
+ .impl(/* implementation */)
131
317
  )
132
-
318
+
133
319
  .build();
134
320
  ```
135
321
 
136
- ### SDK Exports
137
-
138
- ```typescript
139
- import {
140
- // Builders
141
- defineKSA, // Create a KSA definition
142
- fn, // Create a function definition
143
- service, // Service implementation (calls cloud Convex)
144
- primitive, // Primitive implementation (local sandbox ops)
145
- composite, // Composite implementation (chain operations)
146
-
147
- // Registry utilities
148
- createRegistry,
149
- getFunction,
150
-
151
- // Types
152
- type KSADef,
153
- type FunctionDef,
154
- type ParamDef,
155
- type Implementation,
156
- } from "@lakitu/sdk";
157
- ```
158
-
159
322
  ### Implementation Types
160
323
 
161
- #### Service Implementation
162
- Calls a Convex function via the cloud gateway:
163
-
324
+ **Service** — Call cloud Convex functions:
164
325
  ```typescript
165
326
  .impl(service("services.MyService.internal.action")
166
- .mapArgs(({ input }) => ({ data: input })) // Transform args
167
- .mapResult(r => r.value) // Transform result
327
+ .mapArgs(({ input }) => ({ data: input }))
328
+ .mapResult(r => r.value)
168
329
  )
169
330
  ```
170
331
 
171
- #### Primitive Implementation
172
- Uses local sandbox capabilities (file, shell, browser):
173
-
332
+ **Primitive** — Local sandbox operations:
174
333
  ```typescript
175
334
  .impl(primitive("file.read"))
176
335
  .impl(primitive("shell.exec"))
177
336
  .impl(primitive("browser.screenshot"))
178
337
  ```
179
338
 
180
- Available primitives:
181
- - `file.read`, `file.write`, `file.edit`, `file.glob`, `file.grep`, `file.ls`, `file.exists`, `file.stat`
182
- - `shell.exec`
183
- - `browser.open`, `browser.screenshot`, `browser.click`, `browser.type`, `browser.getHtml`, `browser.getText`, `browser.close`
184
-
185
- #### Composite Implementation
186
- Chain multiple operations:
187
-
339
+ **Composite** — Chain multiple operations:
188
340
  ```typescript
189
341
  .impl(composite()
190
- .call("file.read", { filePath: "./config.json" }, "config")
342
+ .call("file.read", { path: "./config.json" }, "config")
191
343
  .call("myKsa.process", ctx => ({ data: ctx.vars.config }), "result")
192
344
  .return(ctx => ctx.vars.result)
193
345
  )
194
346
  ```
195
347
 
348
+ ### Available Primitives
349
+
350
+ | Category | Operations |
351
+ |----------|------------|
352
+ | **file** | `read`, `write`, `edit`, `glob`, `grep`, `ls`, `exists`, `stat` |
353
+ | **shell** | `exec` |
354
+ | **browser** | `open`, `screenshot`, `click`, `type`, `getHtml`, `getText`, `close` |
355
+
196
356
  ### Parameter Types
197
357
 
198
358
  ```typescript
199
359
  .param("name", { type: "string", required: true })
200
360
  .param("count", { type: "number", default: 10 })
201
361
  .param("enabled", { type: "boolean", default: false })
202
- .param("tags", { type: "array" })
203
- .param("options", { type: "object" })
362
+ .param("items", { type: "array" })
363
+ .param("config", { type: "object" })
204
364
  ```
205
365
 
206
366
  ---
207
367
 
208
- ## Configuration
368
+ ## Built-in KSAs
209
369
 
210
- After running `init`, configure Lakitu in `convex/lakitu/config.ts`:
370
+ | Category | KSA | Capabilities |
371
+ |----------|-----|--------------|
372
+ | **Core** | `file` | Filesystem CRUD, glob, grep |
373
+ | | `shell` | Terminal command execution |
374
+ | | `browser` | Playwright-based web automation |
375
+ | | `beads` | Task tracking and memory management |
376
+ | **Skills** | `web` | Search, scrape, content extraction |
377
+ | | `news` | News monitoring and sentiment |
378
+ | | `social` | Social media data extraction |
379
+ | | `companies` | Company enrichment and tech stacks |
380
+ | **Deliverables** | `pdf` | PDF generation from markdown |
381
+ | | `email` | Email composition and sending |
211
382
 
212
- ```typescript
213
- import { Lakitu } from "@lakitu/sdk";
383
+ ---
214
384
 
215
- export default Lakitu.configure({
216
- // E2B template name (build with: npx lakitu build)
217
- template: "lakitu",
385
+ ## The Lakitu Workflow
218
386
 
219
- // Default model for agent
220
- model: "anthropic/claude-sonnet-4-20250514",
387
+ A complete example of how the four pillars work together:
221
388
 
222
- // KSA modules to enable
223
- ksas: [
224
- // Built-in KSAs
225
- "file",
226
- "shell",
227
- "browser",
228
- "beads",
229
-
230
- // Custom KSAs
231
- "./myCustomKsa",
232
- ],
389
+ ### Phase 1: Planning & Competency Loading
233
390
 
234
- // Sandbox pool settings
235
- pool: {
236
- min: 0,
237
- max: 5,
238
- idleTimeout: 300_000,
239
- },
391
+ ```bash
392
+ # Developer initializes project
393
+ bd init
394
+ bd create "Migrate Flutter app from Provider to Riverpod" -t epic
395
+ ```
396
+
397
+ Agent loads relevant KSAs: `flutter-widgets`, `riverpod-state`, `testing`.
398
+
399
+ ### Phase 2: Execution in Secure Sandbox
400
+
401
+ ```typescript
402
+ // Agent queries for unblocked work
403
+ const tasks = await beads.getReady();
404
+ // → [{ id: "bd-a1b2", title: "Setup Riverpod dependencies" }]
405
+
406
+ // Works in isolated E2B environment
407
+ await shell.exec("flutter pub add flutter_riverpod");
408
+ await file.edit("pubspec.yaml", oldDeps, newDeps);
409
+
410
+ // Runs tests to verify
411
+ const result = await shell.exec("flutter test");
412
+ if (result.exitCode !== 0) {
413
+ // Self-corrects based on error output
414
+ }
415
+ ```
416
+
417
+ ### Phase 3: Continuous Memory Management
418
+
419
+ ```typescript
420
+ // Agent completes task
421
+ await beads.close("bd-a1b2", "Dependencies configured");
422
+
423
+ // Discovers secondary issue during work
424
+ await beads.create({
425
+ title: "Memory leak in Widget #22",
426
+ type: "bug",
427
+ discoveredFrom: "bd-a1b2"
240
428
  });
429
+
430
+ // Periodic compaction keeps context fresh
431
+ await beads.compact(); // 100 lines → 5 line summary
241
432
  ```
242
433
 
243
- ---
434
+ ### Phase 4: Session Handoff
244
435
 
245
- ## Built-in KSAs
436
+ ```bash
437
+ # End of session
438
+ bd sync # Sync to git
439
+ git push
246
440
 
247
- | Category | KSA | Functions |
248
- |----------|-----|-----------|
249
- | **Core** | `file` | `read`, `write`, `edit`, `glob`, `grep`, `ls` |
250
- | | `shell` | `exec` |
251
- | | `browser` | `open`, `screenshot`, `click`, `type`, `getText` |
252
- | | `beads` | `create`, `update`, `close`, `list`, `getReady` |
253
- | **Skills** | `web` | `search`, `scrape` |
254
- | | `news` | `trending`, `search`, `analyze` |
255
- | | `social` | `tiktok`, `instagram`, `twitter`, `search` |
256
- | | `companies` | `enrich`, `search`, `techStack` |
257
- | **Deliverables** | `pdf` | `generate` |
258
- | | `email` | `send`, `sendBulk` |
441
+ # Next session (human or agent)
442
+ bd sync # Pull latest state
443
+ bd ready # Immediately oriented to project state
444
+ ```
259
445
 
260
446
  ---
261
447
 
262
- ## Architecture
448
+ ## Architecture Deep Dive
263
449
 
264
450
  ```
265
451
  ┌─────────────────────────────────────────────────────────────────────────┐
@@ -277,76 +463,53 @@ export default Lakitu.configure({
277
463
  │ ▼ │
278
464
  │ ┌─────────────────────────────────────────────────────────────────┐ │
279
465
  │ │ CLOUD GATEWAY │ │
280
- │ │ HTTP → Convex Services (OpenRouter, external APIs) │ │
466
+ │ │ HTTP → Convex Services (LLMs, APIs, External Data) │ │
281
467
  │ └─────────────────────────────────────────────────────────────────┘ │
282
468
  │ │
469
+ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────────┐ │
470
+ │ │ /workspace/ │ │ /artifacts/ │ │ .beads/ │ │
471
+ │ │ Working files │ │ PDFs, images │ │ Task graph (JSONL) │ │
472
+ │ └─────────────────┘ └─────────────────┘ └─────────────────────┘ │
473
+ │ │
283
474
  │ ┌─────────────────────────────────────────────────────────────────┐ │
284
- │ │ /home/user/workspace/ Working files │ │
285
- │ │ /home/user/artifacts/ Persistent outputs (PDFs, screenshots) │ │
475
+ │ │ LOCALIZED CONVEX │ │
476
+ │ │ Real-time state Reactive triggers • Multi-agent coordination │ │
286
477
  │ └─────────────────────────────────────────────────────────────────┘ │
287
478
  └─────────────────────────────────────────────────────────────────────────┘
288
479
  ```
289
480
 
290
481
  ---
291
482
 
292
- ## Example: Custom KSA
293
-
294
- Create `convex/lakitu/weather.ts`:
295
-
296
- ```typescript
297
- import { defineKSA, fn, service } from "@lakitu/sdk";
298
-
299
- export const weatherKSA = defineKSA("weather")
300
- .description("Weather data and forecasts")
301
- .category("skills")
302
- .group("data")
303
-
304
- .fn("current", fn()
305
- .description("Get current weather for a location")
306
- .param("location", { type: "string", required: true, description: "City name or coordinates" })
307
- .impl(service("services.Weather.internal.getCurrent"))
308
- )
483
+ ## Environment Variables
309
484
 
310
- .fn("forecast", fn()
311
- .description("Get weather forecast")
312
- .param("location", { type: "string", required: true })
313
- .param("days", { type: "number", default: 7 })
314
- .impl(service("services.Weather.internal.getForecast"))
315
- )
485
+ | Variable | Description |
486
+ |----------|-------------|
487
+ | `E2B_API_KEY` | Your E2B API key (or run `e2b auth login`) |
316
488
 
317
- .build();
489
+ ---
318
490
 
319
- export default weatherKSA;
320
- ```
491
+ ## Comparison with Other Frameworks
321
492
 
322
- The agent can then use it:
493
+ | Framework | Focus | Lakitu Synergy |
494
+ |-----------|-------|----------------|
495
+ | **CrewAI** | Role-based agent collaboration | Lakitu provides secure execution environment |
496
+ | **LangGraph** | Deterministic state flows | Lakitu provides persistent memory across nodes |
497
+ | **AutoGen** | Multi-agent conversation | Lakitu provides structured task coordination |
498
+ | **Lakitu** | **Infrastructure & Memory** | Foundation layer for reliable autonomy |
323
499
 
324
- ```typescript
325
- import { current, forecast } from './ksa/weather';
326
-
327
- const weather = await current("San Francisco");
328
- console.log(`Current: ${weather.temp}°F, ${weather.condition}`);
329
-
330
- const nextWeek = await forecast("San Francisco", 7);
331
- for (const day of nextWeek) {
332
- console.log(`${day.date}: ${day.high}°F / ${day.low}°F`);
333
- }
334
- ```
500
+ While orchestration frameworks manage *how* agents talk, Lakitu manages *where* they work, *what* they remember, and *how* they verify their progress.
335
501
 
336
502
  ---
337
503
 
338
- ## Environment Variables
504
+ ## The Future: Agent Villages
339
505
 
340
- For `build` command:
341
- - `E2B_API_KEY` — Your E2B API key (or run `e2b auth login`)
342
-
343
- ---
506
+ Lakitu is designed for the "Agent Village"—coordinated swarms working toward massive goals. In this model:
344
507
 
345
- ## Requirements
508
+ - **State lives in Convex**: Agents don't need leaders; they query `bd ready`
509
+ - **Memory lives in Beads**: Blockers auto-propagate across the swarm
510
+ - **Execution lives in E2B**: Each agent has isolated, secure compute
346
511
 
347
- - [Convex](https://convex.dev) project
348
- - [E2B](https://e2b.dev) account (for sandbox hosting)
349
- - Node.js 18+ or Bun
512
+ The human role shifts from "manager of minutiae" to "strategist of epics."
350
513
 
351
514
  ---
352
515
 
@@ -356,9 +519,16 @@ For `build` command:
356
519
  - [GitHub](https://github.com/shinyobjectz/lakitu)
357
520
  - [E2B Documentation](https://e2b.dev/docs)
358
521
  - [Convex Documentation](https://docs.convex.dev)
522
+ - [Beads Issue Tracker](https://github.com/steveyegge/beads)
359
523
 
360
524
  ---
361
525
 
362
526
  ## License
363
527
 
364
528
  MIT
529
+
530
+ ---
531
+
532
+ <p align="center">
533
+ <i>The future of AI is not a better chatbot—it's a system that lands the plane every time.</i>
534
+ </p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lakitu/sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Self-hosted AI agent framework for Convex + E2B with code execution",
5
5
  "type": "module",
6
6
  "main": "./dist/sdk/index.js",