Thanks to visit codestin.com
Credit goes to www.astack.tech

Built on Monadic Paradigm

AStack

The composable framework for AI applications

Build any AI pattern with type-safe components, zero adaptation layers, and mathematical composition guarantees from HLang's monadic foundation.

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

Technical Innovations

Built on HLang's monadic foundation with mathematical composition guarantees

Monadic Component System

Every component extends HLang's TransformNode, 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

Zero Adaptation

Components connect directly via ports without serialization or protocol translation

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 agent patterns

Monadic Component Base

Built on HLang's TransformNode with monadic composition laws

Componentextends TransformNode
data
Port.I('in')
result
Port.O('out')
run(data)
Standalone
_transform($i, $o)
Pipeline
component.ts
// Every component extends TransformNode
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(this.inPort, async (data) => {
      const result = await this.process(data);
      $o(this.outPort, result);
    });
  }
}

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

$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
Zero Adaptation Layer
Direct integration
Multiple adapters
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.