Native Shell
Native Shell:AI 生成的 UI,在你的应用中原生呈现,覆盖每个平台。iOS、Android、macOS、Windows 与 Linux 上的应用、GPUI 应用与网页在运行时加载已签名、沙箱隔离的 TSX 模块并绘制 th
AI 翻译
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A TypeScript agent framework that decomposes AI agent patterns into eight composable step primitives. Noetic treats context boundary management as a first-class concern and provides a pluggable context system with well-defined lifecycle hooks.
Step<I, O> — a typed, serializable unit of work| Package | Description |
|---|---|
@noetic-tools/core | Core framework — step primitives, agent harness, context layers, patterns |
@noetic-tools/eval | Scored evaluation, GEPA-based prompt optimization, regression testing |
@noetic/web | Documentation site (Next.js + Fumadocs) |
| Primitive | Kind | Purpose |
|---|---|---|
runCode | runCode | Pure async computation with retry support |
callModel | callModel | LLM call with tools, structured output, and layered context |
step.acpAgent | acp-agent | Delegate a turn to a coding agent over the Agent Client Protocol |
invokeTool | invokeTool | Direct tool execution with Zod-validated I/O |
conditional | conditional | Conditional routing — returns a step or null |
inParallel | inParallel | Parallel execution — race, all, or settle modes |
spawn | spawn | Child execution with an isolated context boundary |
loop | loop | Iteration with termination predicates and an inbox |
Patterns like ReAct, Ralph Wiggum, task trees, and thread weaving are 15–30 line compositions of these primitives.
Prerequisites: Bun
bun install
# All packages
bun test
# Single package
cd packages/core && bun test
cd packages/core && bun run typecheck
cd packages/eval && bun run typecheck
# Root — runs Biome across the whole repo
bun run lint
bun run lint:fix
bun run format
cd packages/web
bun run dev # localhost:3000
bun run build
import { AgentHarness, any, callModel, loop, until } from '@noetic-tools/core';
// A ReAct agent is just a loop of LLM calls
const agent = loop({
id: 'react-loop',
steps: [
callModel({
id: 'assistant',
model: 'openai/gpt-4o',
instructions: 'You are a helpful assistant.',
tools: [searchTool, calculatorTool],
}),
],
until: any(until.noToolCalls(), until.maxSteps(10)),
});
const harness = new AgentHarness({ name: 'assistant', agentGraph: agent, params: {} });
await harness.execute('What is 12! ?');
const { text } = await harness.getAgentResponse();
Context layers participate in execution via lifecycle hooks (init, recall, store, onSpawn, onReturn, onComplete, dispose). Built-in layers cover common patterns:
| Layer | Slot | Purpose |
|---|---|---|
scratchpad | 100 | Short-term facts and observations |
observations | 200 | Timestamped event log |
taskState | 250 | Persisted task artifacts |
instructions | 350 | Unchanging background facts |
toolCalls | auto | Per-tool state from Tool.context declarations |
The @noetic-tools/eval package provides a describe/it API for scored evaluations and GEPA-based prompt optimization:
import { describe, it, scorer } from '@noetic-tools/eval';
describe(myAgent, { objective: 'Answers factual questions', passThreshold: 0.8 }, () => {
it('answers factual questions', async (ctx) => {
const exec = await ctx.execute('What is the capital of France?');
await exec.score([scorer.answerRelevancy(), scorer.completeness()]);
});
});
noetic-eval # Run evaluations
noetic-eval -u # Run GEPA optimization
@openrouter/sdk (peer dependency)Detailed specifications live in specs/, covering every primitive, the context system, error model, observability, and patterns.
The specs are consumed by SpecBuilt, which automatically implements new features and modifies existing code to keep the implementation aligned with the specs.
Contributions are welcome. See CONTRIBUTING.md for dev setup,
the Developer Certificate of Origin (DCO) sign-off requirement, and the PR process.
Please also read our CODE_OF_CONDUCT.md. To report a security
vulnerability, follow SECURITY.md. Common questions are answered in the
FAQ.
Licensed under the Apache License, Version 2.0. See NOTICE for
attribution.