Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlowForge

A lightweight LangChain Expression Language (LCEL) inspired pipeline execution framework built entirely from scratch in Python.

◈ Overview

FlowForge is an educational Python framework that recreates the core concepts behind modern AI workflow engines such as LangChain Expression Language (LCEL).

Instead of nesting function calls, FlowForge allows developers to compose reusable processing pipelines using intuitive operator syntax while keeping every component independent and composable.

The project focuses on understanding how AI frameworks work internally, rather than simply using them.

◈ Why FlowForge?

Modern AI applications are built as workflows rather than single function calls.

A typical execution pipeline looks like:

User Input
     |
Preprocessing
     |
  AI Model
     |
Post Processing
     |
  Formatting
     |
   Response

Frameworks like LangChain provide abstractions for connecting these stages together.

FlowForge recreates these abstractions from the ground up using Python and Object-Oriented Programming.

◈ Features

Runnable Abstraction

Every pipeline component follows a common interface.

  • Runnable

Each runnable implements a common execution interface, making every component interchangeable inside a pipeline.

RunnableLambda

Wrap any normal Python function into a runnable object.

RunnableSequence

Compose multiple runnable components into a sequential execution pipeline.

Example:

Stage 1 | Stage 2 | Stage 3

RunnableParallel

Execute multiple independent pipelines using the same input.

Example:

           Input
             |
    -------------------
    |        |        |
 Branch1  Branch2  Branch3
    |        |        |
    -------------------
             |
       Combined Output

This allows different transformations to happen simultaneously before merging the results.

RunnablePassthrough

Forward data without modifying it.

Useful when one branch requires the original input while other branches transform it.

Example:

Input
  |
----------------
|              |
Original      Processed
|              |
----------------

Operator Overloading

Build pipelines naturally using the | operator.

Instead of deeply nested function calls, pipelines can be composed in a readable left-to-right manner.

Example Flow:

Clean Text | Reverse Text | Duplicate Text

◈ Example Pipeline

A single pipeline can combine sequential and parallel execution.

Execution Graph:

                Input
                  |
        ---------------------
        |         |         |
    Original   Cleaned   Numbers
        |         |         |
        ---------------------
                  |
             String Parser
                  |
              Add Prefix
                  |
               Reverse
                  |
                Output

◈ Learning Objectives

This project is designed to deepen understanding of:

  • LangChain Expression Language (LCEL)
  • AI workflow orchestration
  • Functional composition
  • Framework architecture
  • Python API design
  • Operator overloading
  • Pipeline execution systems

Rather than using an existing library, FlowForge demonstrates how these concepts can be engineered from scratch.

◈ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

About

A lightweight implementation of a LangChain Expression Language (LCEL)-inspired pipeline execution framework built from scratch in Python using Object-Oriented Programming, operator overloading, and composable runnable components.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages