Skip to main content

A building block library for composed agent workflows

Project description

agenticblocks 🧱

A composable building block library for AI agent workflows. / Uma biblioteca componível para construir fluxos de agentes de IA.

🇺🇸 English | 🇧🇷 Português


🇺🇸 English

Philosophy

A library to build agent workflows like Lego blocks. Each step in your agentic pipeline is a self-contained block, with strictly typed inputs and outputs via Pydantic and natively concurrent execution using AsyncIO and NetworkX graphs.

  • Strong typing: Pydantic validates connections and prevents unmatched dependencies between LLM tool calls.
  • Standardized connections: Blocks only know their own inputs and outputs. Thus, entire workflows can act as single blocks later.
  • Smart Parallelism (Waves): The asyncio engine fires simultaneous tasks (waves) whenever dependencies are resolved, maximizing API speed.

Getting Started

Install the module locally for development:

pip install -e .

1. Define Input and Output Models

from pydantic import BaseModel

class HelloInput(BaseModel):
    name: str

class HelloOutput(BaseModel):
    greeting: str

2. Create the Logic Block

from agenticblocks.core.block import Block

class HelloWorldBlock(Block[HelloInput, HelloOutput]):
    name: str = "say_hello"
    
    async def run(self, input: HelloInput) -> HelloOutput:
        msg = f"Hello, {input.name}! Welcome to agenticblocks."
        return HelloOutput(greeting=msg)

3. Connect and Execute

import asyncio
from agenticblocks.core.graph import WorkflowGraph
from agenticblocks.runtime.executor import WorkflowExecutor

async def main():
    graph = WorkflowGraph()
    graph.add_block(HelloWorldBlock(name="say_hello"))

    executor = WorkflowExecutor(graph)
    ctx = await executor.run(initial_input={"name": "Alice"})
    
    print(ctx.get_output("say_hello").greeting)

asyncio.run(main())

Check the examples/ directory for full demos.


🇧🇷 Português

Filosofia

Uma biblioteca para construir fluxos de agentes no estilo Lego. Cada passo do seu pipeline agêntico é um bloco auto-contido, com entradas e saídas rigorosamente tipadas via Pydantic e execução simultânea usando AsyncIO e grafos do NetworkX.

  • Forte tipagem: Pydantic valida os encaixes e previne dependências não satisfeitas.
  • Encaixes padronizados: Blocos só conhecem as próprias entradas e saídas. Workflows inteiros funcionam como blocos únicos.
  • Paralelismo Inteligente (Ondas): O motor dispara tarefas simultâneas (waves) sempre que as dependências de um bloco são resolvidas, otimizando a velocidade de conexões a APIs.

Primeiros Passos

Instale o módulo de forma local editável:

pip install -e .

A estrutura segue o modelo mostrado na sessão em inglês (Inglês: Input/Output Models, Logic Block, e Graph Execution). Consulte os scripts interativos e completos dentro da pasta examples/:

  • 01_hello_world.py: Simulação básica e limpa do tutorial inicial.
  • 02_llm_pipeline.py: Um pipeline completo demonstrando a paralelização de parsing de dados complexos com um mock de LLM Call.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agenticblocks_io-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agenticblocks_io-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file agenticblocks_io-0.1.0.tar.gz.

File metadata

  • Download URL: agenticblocks_io-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agenticblocks_io-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad5327f852f8b2948e8642fa4a65147cab54e657cc73407830f988b87dc6fd98
MD5 eb85edfaffd410c6a2fa6ed096a98102
BLAKE2b-256 be2c49f1eca80abcf53fe21e44cb83c556939e5e49801e49d4f410dd59d945dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for agenticblocks_io-0.1.0.tar.gz:

Publisher: workflow.yml on gilzamir18/agenticblocks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agenticblocks_io-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agenticblocks_io-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 431fa708c3631284ba0a683e12c4017a478212a055bd2c93fcf005e1ea9f20d7
MD5 0ec1e2fbb7432327726531ddfc24728a
BLAKE2b-256 410573271b8f07d747f8a2ea5461ac07a3e945dcef140a25e3c631ab80b6d67c

See more details on using hashes here.

Provenance

The following attestation bundles were made for agenticblocks_io-0.1.0-py3-none-any.whl:

Publisher: workflow.yml on gilzamir18/agenticblocks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page