Minimalist AI framework in 65 Lines. Enable LLMs to Program Themselves.
Project description
A 65-line minimalist AI framework 🤯
Let Agents build Agents with zero bloat, zero dependencies, zero vendor lock-in 😮
Features
-
Lightweight: Zero bloat, zero dependencies, zero vendor lock-in.
-
Expressive: Everything you love—(Multi-)Agents, Workflow, RAG, and more.
-
Agentic Coding: Let AI Agents (e.g., Cursor AI) build Agents—10x productivity boost!
Getting started
-
To install in Python,
pip install brainyflowor just copy the source code (only 65 lines!). -
To install in Javascript,
npm install brainyflowor just copy the source code. -
To learn more, check out the documentation. For an in-depth design dive, read the essay.
-
🎉 We now have a discord!
Why Brainy Flow?
Current LLM frameworks are bloated... You only need 65 lines for 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 | Graph | None | None | 65 | few KB |
How does Brainy Flow work?
The single file in python or typescript capture the core abstraction of LLM frameworks: Graph!
From there, it's easy to implement popular design patterns like (Multi-)Agents, Workflow, RAG, etc.
✨ Below are basic tutorials:
| Name | Difficulty | Description |
|---|---|---|
| Chat | ☆☆☆ Dummy |
A basic chat bot with conversation history |
| RAG | ☆☆☆ Dummy |
A simple Retrieval-augmented Generation process |
| Workflow | ☆☆☆ Dummy |
A writing workflow that outlines, writes content, and applies styling |
| Map-Reduce | ☆☆☆ Dummy |
A resume qualification processor using map-reduce pattern for batch evaluation |
| Agent | ☆☆☆ Dummy |
A research agent that can search the web and answer questions |
| Streaming | ☆☆☆ Dummy |
A real-time LLM streaming demo with user interrupt capability |
| Multi-Agent | ★☆☆ Beginner |
A Taboo word game for asynchronous communication between two agents |
| Supervisor | ★☆☆ Beginner |
Research agent is getting unreliable... Let's build a supervision process |
| Parallel | ★☆☆ Beginner |
A parallel execution demo that shows 3x speedup |
| Thinking | ★☆☆ Beginner |
Solve complex reasoning problems through Chain-of-Thought |
| Memory | ★☆☆ Beginner |
A chat bot with short-term and long-term memory |
👀 Want to see other tutorials for dummies? Create an issue!
How to Use Brainy Flow?
🚀 Through Agentic Coding—the fastest LLM App development paradigm-where humans design and agents code!
- Want to learn Agentic Coding?
- To setup, read this post!
- Check out my YouTube! Read this Guide!
- Want to build your own LLM App? Start with our Python template or Typescript template!
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.
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
BrainyFlow runs on 65 lines of code and your generosity! 💰
Help us deliver more AI with less code (but maybe more coffee)
☕
Your support helps keep it minimal, powerful, and dependency-free! 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brainyflow-0.1.3.tar.gz.
File metadata
- Download URL: brainyflow-0.1.3.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
006226f262a71982d1516fa0c87e097e89d27a0f337af98254740c562b1a0a1a
|
|
| MD5 |
7a2f0e4357786834c0937a3e77503ffd
|
|
| BLAKE2b-256 |
ff891081545309868a8f69f70c678f4c0485171db7a73fe90879956d37d94c32
|
Provenance
The following attestation bundles were made for brainyflow-0.1.3.tar.gz:
Publisher:
python-publish.yml on zvictor/BrainyFlow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brainyflow-0.1.3.tar.gz -
Subject digest:
006226f262a71982d1516fa0c87e097e89d27a0f337af98254740c562b1a0a1a - Sigstore transparency entry: 190472130
- Sigstore integration time:
-
Permalink:
zvictor/BrainyFlow@a83729ede4676bcb24641f7f9c2923b2973fc440 -
Branch / Tag:
refs/heads/fix-actions - Owner: https://github.com/zvictor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a83729ede4676bcb24641f7f9c2923b2973fc440 -
Trigger Event:
push
-
Statement type:
File details
Details for the file brainyflow-0.1.3-py3-none-any.whl.
File metadata
- Download URL: brainyflow-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcf20a1b57729635069e403333f465467ae805299011c518730391f9ff613603
|
|
| MD5 |
c540a0b2b34c91651cda7439c5b04976
|
|
| BLAKE2b-256 |
80ca73b6e15b61c79dfdf9bea9b9d547bd530ea2a49a86e4f15926e5d247fab2
|
Provenance
The following attestation bundles were made for brainyflow-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on zvictor/BrainyFlow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brainyflow-0.1.3-py3-none-any.whl -
Subject digest:
fcf20a1b57729635069e403333f465467ae805299011c518730391f9ff613603 - Sigstore transparency entry: 190472132
- Sigstore integration time:
-
Permalink:
zvictor/BrainyFlow@a83729ede4676bcb24641f7f9c2923b2973fc440 -
Branch / Tag:
refs/heads/fix-actions - Owner: https://github.com/zvictor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a83729ede4676bcb24641f7f9c2923b2973fc440 -
Trigger Event:
push
-
Statement type: