Local Agents.
In-process Intelligence.
Forget chatbots. With LLoyal HDK, you can drop agentic AI directly into your desktop and mobile apps. Models, tools, retrieval, and multi-agent workflows all run inside your app process — no API keys, no inference servers, and no user data leaving the device unless you want it to. You get the entire agentic envelope with a single import.
import { useAgent } from '@lloyal-labs/lloyal-agents';
import { MailSource } from './local-db';
// Drop an agent into your local app
const agent = yield* useAgent({
task: "Find my latest Amazon tracking number",
tools: [...new MailSource(db).tools, reportTool],
terminalTool: 'report',
});
console.log(agent.result);
import {
agentPool, parallel
} from '@lloyal-labs/lloyal-agents';
import { FS, Xero } from './local-app';
// Process receipts into Xero concurrently
const pool = yield* agentPool({
orchestrate: parallel(
receipts.map(file => ({
content: `Extract vendor and amount: ${file.name}`,
// Sibling awareness isolates each worker
systemPrompt: getWorkerPrompt(file, siblingFiles)
}))
),
tools: [FS.readImage, Xero.logExpense],
terminalTool: 'sync_xero',
});
import {
agentPool, chain
} from '@lloyal-labs/lloyal-agents';
import { FS, QuickBooks, UI } from './local-app';
// Build context across sequential desktop tasks
const pool = yield* agentPool({
orchestrate: chain([
{ task: 'extract_invoice', tools: [FS.readPdf] },
{ task: 'log_expense', tools: [QuickBooks.api] }
], (stage) => ({
task: { content: stage.task, systemPrompt: getPrompt() },
// Step 2 inherits step 1's data in O(1) time
userContent: `Findings from ${stage.task}:`,
// Natively update UI via Effection hooks
*afterExtend() {
yield* UI.updateProgress(`${stage.task} done`);
}
})),
tools: [mailgun.sendEmail],
terminalTool: 'send_email',
});
import {
agentPool, dag
} from '@lloyal-labs/lloyal-agents';
import { CMS, Gen, FS } from './local-tools';
// Pipeline demonstrating fan-out and convergence
const pool = yield* agentPool({
orchestrate: dag([
{ id: "notes", tools: [FS.readDir] },
{ id: "copy", dependsOn: ["notes"], tools: [CMS.tone] },
{ id: "img", dependsOn: ["copy"], tools: [Gen.image] },
{ id: "seo", dependsOn: ["copy"], tools: [CMS.seo] },
{ id: "pub", dependsOn: ["img", "seo"], tools: [CMS.post] }
]),
tools: [slack.notifyComms],
terminalTool: 'notify_comms',
});
Zero-Dependency Orchestration
Forget Docker compose and fragile promise chains. Orchestrate massive parallel swarms and multi-parent DAGs using native structured concurrency. Deterministic teardown, zero memory leaks.
Continuous Context Spine
Agents share memory, not strings. Branches inherit conversational state instantly via O(1) KV prefix sharing. Run 32K context pipelines on a consumer laptop without re-tokenizing massive prompts.
Retrieval-Interleaved Generation
Break the RAG bottleneck. Agents dynamically search, read, and rerank chunks during the generation loop. Connect local databases or the live web instantly via the pluggable Source contract.