Built on Monadic FBP Paradigm

AStack

The composable framework for AI applications

Build any ai application pattern with type-safe components, Observable streams, and mathematical composition guarantees from HLang's monadic FBP foundation.

example.ts
$npm install @astack-tech/core@beta
Scroll to explore

Technical Innovations

Built on HLang's monadic foundation with mathematical composition guarantees

Monadic Component System

Every component extends HLang's TransformNode (Component in AStack), providing mathematical composition guarantees. Agents, tools, and pipelines share the same base interface with type-safe ports.

In
Input Port
C
Component
Out
Output Port

Data Flow Paradigm

Flow-Based Programming treating LLMs as stateless generators, not control flow components

Dual Execution Modes

Independent execution with run() or reactive pipeline mode with _transform()

Type-Safe Port System

Port.I() and Port.O() provide compile-time type checking and runtime validation for component connections

stringComponentResult<T>

Modular Design

Core, components, and integrations as separate packages

Easy Integration

OpenAI-compatible interfaces for any model provider

Computation Model

Built on HLang's monadic paradigm - the foundation for all computation patterns

Monadic Component Base

Built on HLang's TransformNode (Component in AStack) with monadic composition laws

data
Port.I('in')
MyComponentextends Component
result
Port.O('out')
run(data)
Standalone
_transform($i, $o)
Pipeline
component.ts
// Every component extends Component
import { Component } from '@astack-tech/core';

class MyComponent extends Component {
  // Type-safe input/output ports
  inPort = Port.I('in');
  outPort = Port.O('out');

  // Dual execution modes:
  // 1. Independent execution
  async run(data) {
    return this.process(data);
  }

  // 2. Reactive pipeline execution
  _transform($i, $o) {
    $i('in').receive(async (input) => {
      const output = await this.run(input);
      $o('out').send(output);
    });
  }
}

Monadic Laws

Composition follows mathematical laws ensuring predictable behavior

Direct Connections

Port-to-port data flow without intermediate layers

Reactive Streams

Built-in backpressure and flow control for real-time processing

Quick Start

Get up and running with AStack in minutes

1

Install AStack

terminal
$ npm install @astack-tech/core @astack-tech/components
2

Create Your First Agent

agent.ts
import { Agent } from "@astack-tech/components";
import { Deepseek } from "@astack-tech/integrations";

const agent = new Agent({
  model: new Deepseek({ model: "deepseek-chat" }),
  tools: [searchTool, writeTool],
});

const result = await agent.run("Research AI trends");
3

Run & Explore

Your agent is ready! Explore more examples and documentation on GitHub.

Technical Independence

100% original framework with independent architecture, inspired by Haystack's API style

Feature
AStack
Others
Data Flow Paradigm
Flow-Based Programming with monadic composition
Control flow loops
Dual Run Modes
run() + _transform()
Single mode
Type-Safe Ports
Full type safety
Runtime checks
Language
TypeScript
Python
""

AStack provides developers with a more concise and flexible component-based AI framework through an independently innovative technical approach.