Astack AI Agent

by astack-tech• 35•• Scanned•Claim this listing•Request removal
Developer Toolsagentagentic frameworkagentic systemsagentsai

🤖 A composable framework for building AI applications.

Astack is an open-source ai agent by astack-tech, written mainly in TypeScript, with 35 GitHub stars and the MIT license. Its code was last updated Nov 1, 2026. The latest npm release is @astack-tech/core 0.2.0-beta.5, published Nov 1, 2026, with 68 downloads last week.

AStack

<img src="./assets/brand/readme-banner.svg" alt="AStack: Everything is a component. A composable TypeScript framework for AI applications." width="100%">

Website · Docs · Examples · Changelog · Contributing

English · 简体中文

CI npm license

Public beta. APIs can change between beta releases. Each release is described in the package changelogs.

AStack is a TypeScript framework for AI applications. It has one rule: everything is a component. Models, tools, agents and your own logic are components. A pipeline connects their ports into a graph, and data flows along the connections.

import { Pipeline } from '@astack-tech/core';

// Trim and Uppercase are two small components; see examples/pipeline.
const pipeline = new Pipeline();
pipeline.addComponent('trim', new Trim());
pipeline.addComponent('upper', new Uppercase());
pipeline.connect('trim.out', 'upper.in');

await pipeline.run('trim.in', '  hello  '); // 'HELLO'

The computation model

IdeaWhat it isAPI
ComponentA unit of work with named input and output portsclass X extends Component
PortA channel. Output ports connect to input ports.$i('in').receive(), $o('out').send()
PipelineA graph of components that runs data from a trigger port to an endpointaddComponent, connect, run

A component never calls another component. It reads its input ports and writes its output ports, and the pipeline decides where data goes. Each component stays small and testable, and you can rewire a graph without editing the components in it.

Every component works in two modes: call run(input) like a function, or add it to a pipeline, where the runtime calls _transform($i, $o). Agents, multi-step workflows and routing are patterns built from these ideas, not separate subsystems.

The runtime is HLang, a flow-based programming runtime built on RxJS. Each connection is an observable stream.

How AStack compares

AStack's computation model is original. PocketFlow reached a similar idea independently: a small core in which the graph is the framework. PocketFlow is written in Python and makes a 100-line core its defining goal. AStack does not optimize for line count; it optimizes for typed, reactive data flow in TypeScript. Haystack inspired AStack's API shape. AStack does not use Haystack code.

AStackPocketFlowHaystack
LanguageTypeScriptPythonPython
Unit of workComponent with named portsNode with prep, exec and postComponent with typed sockets
How data movesAlong each connection, from an output port to an input portThrough a shared store that nodes read and writeAlong connections between sockets
BranchingA component sends to the output port it choosespost returns an action; the flow follows that labeled edgeRouter components
ExecutionReactive streams; concurrent runs of a route resolve in orderA flow runs nodes one after another; async and parallel variants existA pipeline run loop
Design goalA typed, reactive data-flow modelA minimal core of about 100 linesA full framework for search and RAG

The main difference from PocketFlow is where state lives. PocketFlow nodes share one store. In AStack each connection carries the data for that step, so every input and output is visible in the graph. Details: Introduction.

Install

Requires Node.js 20 or later.

npm install @astack-tech/core@beta @astack-tech/components@beta
# Model providers and tools
npm install @astack-tech/integrations@beta @astack-tech/tools@beta

An agent in a few lines

import { Agent } from '@astack-tech/components';
import { ModelProvider } from '@astack-tech/integrations';
import { createTool } from '@astack-tech/tools';

const multiply = createTool(
  'multiply',
  'Multiply two numbers.',
  args => Number(args['a']) * Number(args['b'])
);

// Any model works: see the table below.
const model = new ModelProvider.Deepseek({ apiKey: process.env['DEEPSEEK_API_KEY'] ?? '' });

const agent = new Agent({ model, tools: [multiply] });

const { message, toolCalls } = await agent.run('What is 37 times 43?');

Any model

An agent depends on one interface, chatCompletion(messages), not on a vendor. OpenAICompatible calls any API that speaks the OpenAI chat completions protocol, and Deepseek is a preset of it.

ModelProvider
OpenAInew ModelProvider.OpenAICompatible({ apiKey, model: 'gpt-4o-mini' })
DeepSeeknew ModelProvider.Deepseek({ apiKey })
Qwen, Moonshot and other OpenAI-compatible APIsnew ModelProvider.OpenAICompatible({ apiKey, baseURL, model })
Local models through Ollama or vLLMnew ModelProvider.OpenAICompatible({ apiKey: 'ollama', baseURL: 'http://localhost:11434/v1', model: 'llama3.1' })
Any other APIAn object with chatCompletion(messages): see custom-model

The examples use DeepSeek so they run as written; change the line that creates the model to use another one. Details: Model providers.

Examples

Each example is one short file that shows one idea. Read them in order; the code is also rendered on astack.tech/examples.

#ExampleShowsAPI key
1componentDefine a component and run it as a functionNo
2pipelineConnect components and infer the endpointNo
3routingBranch through named output portsNo
4text-splitterSplit documents with a built-in componentNo
5toolsCreate tools and run tool callsNo
6chatCall a model directly and in a pipelineYes
7workflowChain outline, draft and edit stepsYes
8agentLet a model call a toolYes
9custom-modelDrive an agent with your own modelNo
10streaming-agentStream text and tool eventsYes
11rlm-agentQuestion a codebase too large for one promptYes
12http-serverServe a streaming agent over Server-Sent EventsYes
pnpm install && pnpm build
pnpm --filter @astack-examples/pipeline start

Packages

PackageContents
@astack-tech/coreComponent, Pipeline, Port
@astack-tech/componentsAgent, StreamingAgent, RLMAgent, TextSplitter, ToolInvoker
@astack-tech/toolscreateTool, tool sets, component tools, MCP tools
@astack-tech/integrationsModel providers: OpenAICompatible for any OpenAI-compatible API, and the Deepseek preset

Each package README lists its full API.

Documentation

PageTopic
IntroductionThe computation model and the comparison above
Getting startedInstall, first component, first pipeline
Components, Pipelines, RoutingThe core model
Tools, Model providersBuilding blocks for agents
Agents, Streaming, RLMAgent patterns
API referenceEvery export of every package, generated from the source and its TSDoc comments

Development

pnpm install
pnpm verify   # format, lint, types, tests, package checks, build

The rules for contributors and AI coding agents are in AGENTS.md: code is the single source of truth, every change starts with a failing test, and every gate runs at its strictest setting with zero warnings. Open pull requests against dev. See CONTRIBUTING.md and SECURITY.md.

License

MIT. Thanks to the HLang project for the runtime, to Haystack for the API inspiration, and to everyone who has contributed.

Astack alternatives

View more →

Similar ai agents in Developer Tools, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.

NameStarsLicenceLast updatedScan
Astack (this page)
astack-tech
35MITNov 1, 2026Scanned, no flagged issues
Deepseek Harness
deepseek-ai
268kMITOct 30, 2026Scanned, no flagged issues
Ponytail
DietrichGebert
182kMITOct 29, 2026Scanned, no flagged issues
Orca
stablyai
112kMITNov 1, 2026Scanned, no flagged issues
Deer Flow
bytedance
85kMITNov 1, 2026Scanned, no flagged issues
Ruflo
ruvnet
80kMITNov 1, 2026Scanned, no flagged issues