A lightweight LangChain Expression Language (LCEL) inspired pipeline execution framework built entirely from scratch in Python.
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.
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.
Every pipeline component follows a common interface.
- Runnable
Each runnable implements a common execution interface, making every component interchangeable inside a pipeline.
Wrap any normal Python function into a runnable object.
Compose multiple runnable components into a sequential execution pipeline.
Example:
Stage 1 | Stage 2 | Stage 3
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.
Forward data without modifying it.
Useful when one branch requires the original input while other branches transform it.
Example:
Input
|
----------------
| |
Original Processed
| |
----------------
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
A single pipeline can combine sequential and parallel execution.
Execution Graph:
Input
|
---------------------
| | |
Original Cleaned Numbers
| | |
---------------------
|
String Parser
|
Add Prefix
|
Reverse
|
Output
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.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).