BrainyFlow
GitHub
BrainyFlow
  • Introduction
    • What is BrainyFlow?
    • Installation
    • Getting Started
    • Comparison
  • Cookbook
    • Python Examples
    • Typescript Examples
  • Core Abstraction
    • Overview
    • Node
    • Flow
    • Memory
  • Design Patterns
    • Overview
    • Agent
    • Workflow
    • RAG
    • Map Reduce
    • Structured Output
    • Multi-Agents (Advanced)
  • Utility Functions
    • Overview
    • LLM Wrapper
    • Web Search
    • Chunking
    • Embedding
    • Vector Databases
    • Text-to-Speech
  • Guides
    • Best Practices
    • Agentic Coding Guide
    • Throttling
    • Visualization & Logging
    • Testing
    • Migrating from PocketFlow
    • Migrating from Older Versions
Powered by GitBook
On this page
  • Features
  • Why Brainy Flow?
  • How does BrainyFlow work?
  • Tutorials
  • Quick Start
  • Ready to Build Self-Coding Apps?
  • Acknowledgement
  • Contributors Wanted!
  • Liability Disclaimer
  • Sponsors
Edit on GitHub
  1. Introduction

What is BrainyFlow?

Last updated 4 days ago

A radically minimalist AI framework (just ! 🤯) Build Powerful AI Agents with Minimal Code, Maximum Freedom. Let Agents build Agents with Zero bloat, dependencies, or vendor lock-in 😮

BrainyFlow is a framework enabling Agentic Coding through powerful abstractions.

It provides a simple interface for building complex AI applications based on nested directed graphs with shared state. It enables both humans and AI assistants to collaborate effectively on designing and implementing AI systems.

Features

  • Brain-Easy 🧠: Intuitive for both humans and AI assistants

  • Minimalist Design ✨: Core abstractions in just (you heard it right!) 300 lines of code

  • Freedom 🔓: Zero bloat, dependencies, or vendor lock-in

  • Composable 🧩: Build complex systems from simple, reusable components

  • Agentic-Coding 🤖: Designed for AI-assisted development

  • Universal 🌈: Works with any LLM provider or API

  • Polyglot 🌍: Python and Typescript are both supported

Why Brainy Flow?

Current LLM frameworks are bloated... You actually only need 300 lines for a robust LLM Framework!

Abstraction

App-Specific Wrappers

Vendor-Specific Wrappers

Lines

Size

LangChain

Agent, Chain

Many (e.g., QA, Summarization)

Many (e.g., OpenAI, Pinecone, etc.)

405K

+166MB

CrewAI

Agent, Chain

Many (e.g., FileReadTool, SerperDevTool)

Many (e.g., OpenAI, Anthropic, Pinecone, etc.)

18K

+173MB

SmolAgent

Agent

Some (e.g., CodeAgent, VisitWebTool)

Some (e.g., DuckDuckGo, Hugging Face, etc.)

8K

+198MB

LangGraph

Agent, Graph

Some (e.g., Semantic Search)

Some (e.g., PostgresStore, SqliteSaver, etc.)

37K

+51MB

AutoGen

Agent

Some (e.g., Tool Agent, Chat Agent)

Many [Optional] (e.g., OpenAI, Pinecone, etc.)

7K (core-only)

+26MB (core-only)

BrainyFlow .ts

Graph

None

None

300

few KB

BrainyFlow .py

Graph

None

None

300

few KB

How does BrainyFlow work?

From there, it's easy to implement all popular design patterns:

Tutorials

Name
Difficulty
Description

☆☆☆ Dummy

A basic chat bot with conversation history

☆☆☆ Dummy

A simple Retrieval-augmented Generation process

☆☆☆ Dummy

A writing workflow that outlines, writes content, and applies styling

☆☆☆ Dummy

A resume qualification processor using map-reduce pattern for batch evaluation

☆☆☆ Dummy

A research agent that can search the web and answer questions

☆☆☆ Dummy

A real-time LLM streaming demo with user interrupt capability

★☆☆ Beginner

A Taboo word game for asynchronous communication between two agents

★☆☆ Beginner

Research agent is getting unreliable... Let's build a supervision process

★☆☆ Beginner

A parallel execution demo that shows 3x speedup

★☆☆ Beginner

Solve complex reasoning problems through Chain-of-Thought

★☆☆ Beginner

A chat bot with short-term and long-term memory

Quick Start

Ready to Build Self-Coding Apps?

Acknowledgement

We would like to extend our deepest gratitude to the creators and contributors of the PocketFlow framework, from which BrainyFlow originated as a fork.

Contributors Wanted!

We're looking for contributors for all aspects of the project. Whether you're interested in documentation, testing, or implementing features, we'd love your help!

Liability Disclaimer

BrainyFlow is provided "as is" without any warranties or guarantees. We do not take responsibility for how the generated output is used, including but not limited to its accuracy, legality, or any potential consequences arising from its use.

Sponsors

Powerful 🦾: Supports everything you love—(), , , and more

The single file in or capture the core abstraction of LLM frameworks: Graph!

handles simple (LLM) tasks with a clear lifecycle (prep → exec → post).

connects nodes through Actions (labeled edges), orchestrating execution.

manages shared (global) and isolated (local) state, enabling communication between nodes.

autonomously makes decisions based on context.

chains multiple tasks into sequential pipelines.

integrates data retrieval with generation.

splits data tasks into Map and Reduce steps.

formats outputs consistently.

coordinate multiple agents.

And many more available for all levels!

New to BrainyFlow? Check out our guide to build your first flow in no time.

Check out , the fastest way to develop self-coding LLM projects with BrainyFlow!

Get involved by joining our .

BrainyFlow runs on 300 lines of code and your generosity! 💰 ☕ helps keep it minimal, powerful, and dependency-free! 🚀

Multi-
Agents
Workflow
RAG
Python
Typescript
Node
Flow
Memory
Agent
Workflow
RAG
Map Reduce
Structured Output
Multi-Agents
Check them all out!
Getting Started
Agentic Coding Guidance
Discord server
Chat
RAG
Workflow
Map-Reduce
Agent
Streaming
Multi-Agent
Supervisor
Parallel
Thinking
Memory
300 lines
Help us deliver more AI with less code (but maybe more caffeine)
Your support