> For the complete documentation index, see [llms.txt](https://brainy.gitbook.io/flow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brainy.gitbook.io/flow/introduction/index.md).

# What is Caskada?

<div align="center"><picture><source srcset="https://cdn.jsdelivr.net/gh/skadaai/caskada@main/.github/media/logo-dark.png" media="(prefers-color-scheme: dark)"><img src="https://cdn.jsdelivr.net/gh/skadaai/caskada@main/.github/media/logo-light.png" alt="" width="280"></picture></div>

<p align="center">A radically minimalist AI framework (just <a href="https://github.com/skadaai/caskada/blob/main/python/caskada.py">300 lines</a>! 🤯)<br>Build Powerful AI Agents with Minimal Code, Maximum Freedom.<br><sub>Let Agents build Agents with Zero bloat, dependencies, or vendor lock-in 😮</sub></p>

<p align="center"><a href="https://pypi.org/project/caskada"><img src="https://img.shields.io/pypi/dw/caskada?logo=python&#x26;label=Python&#x26;style=flat-square" alt=""> </a><a href="https://npmjs.com/packages/caskada"><img src="https://img.shields.io/npm/d18m/caskada?logo=typescript&#x26;label=Typescript&#x26;style=flat-square" alt=""> </a><a href="https://discord.gg/N9mVvxRXyH"><img src="https://img.shields.io/discord/1346833819172601907?logo=discord&#x26;style=flat-square" alt=""> </a><a href="https://github.com/skadaai/caskada"><img src="https://img.shields.io/github/stars/skadaai/caskada?logo=github&#x26;style=flat-square" alt=""> </a><a href="https://github.com/sponsors/zvictor"><img src="https://img.shields.io/github/sponsors/zvictor?logo=github&#x26;style=flat-square" alt=""></a></p>

Caskada 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
* **Powerful 🦾**: Supports everything you love—([Multi-](/flow/design-patterns/multi_agent.md))[Agents](/flow/design-patterns/agent.md), [Workflow](/flow/design-patterns/workflow.md), [RAG](/flow/design-patterns/rag.md), and more
* **Agentic-Coding 🤖**: Designed for AI-assisted development
* **Universal 🌈**: Works with any LLM provider or API
* **Polyglot 🌍**: Python and Typescript are both supported

![](https://raw.githubusercontent.com/skadaai/caskada/master/.github/media/divider.png)

### Why Caskada?

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

![](https://raw.githubusercontent.com/skadaai/caskada/main/.github/media/meme.jpg)

|                 | **Abstraction** |                         **App-Specific Wrappers**                        |                                      **Vendor-Specific Wrappers**                                     |                    **Lines**                   |                      **Size**                     |
| --------------- | :-------------: | :----------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------: | :--------------------------------------------: | :-----------------------------------------------: |
| LangChain       |   Agent, Chain  |      <p>Many<br><sup><sub>(e.g., QA, Summarization)</sub></sup></p>      |                  <p>Many<br><sup><sub>(e.g., OpenAI, Pinecone, etc.)</sub></sup></p>                  |                      405K                      |                       +166MB                      |
| CrewAI          |   Agent, Chain  | <p>Many<br><sup><sub>(e.g., FileReadTool, SerperDevTool)</sub></sup></p> |             <p>Many<br><sup><sub>(e.g., OpenAI, Anthropic, Pinecone, etc.)</sub></sup></p>            |                       18K                      |                       +173MB                      |
| SmolAgent       |      Agent      |   <p>Some<br><sup><sub>(e.g., CodeAgent, VisitWebTool)</sub></sup></p>   |              <p>Some<br><sup><sub>(e.g., DuckDuckGo, Hugging Face, etc.)</sub></sup></p>              |                       8K                       |                       +198MB                      |
| LangGraph       |   Agent, Graph  |       <p>Some<br><sup><sub>(e.g., Semantic Search)</sub></sup></p>       |             <p>Some<br><sup><sub>(e.g., PostgresStore, SqliteSaver, etc.)</sub></sup></p>             |                       37K                      |                       +51MB                       |
| AutoGen         |      Agent      |    <p>Some<br><sup><sub>(e.g., Tool Agent, Chat Agent)</sub></sup></p>   | <p>Many <sup><sub>\[Optional]</sub></sup><br><sup><sub>(e.g., OpenAI, Pinecone, etc.)</sub></sup></p> | <p>7K<br><sup><sub>(core-only)</sub></sup></p> | <p>+26MB<br><sup><sub>(core-only)</sub></sup></p> |
| **Caskada** .ts |    **Graph**    |                                 **None**                                 |                                                **None**                                               |                     **300**                    |                     **few KB**                    |
| **Caskada** .py |    **Graph**    |                                 **None**                                 |                                                **None**                                               |                     **300**                    |                     **few KB**                    |

![](https://raw.githubusercontent.com/skadaai/caskada/master/.github/media/divider.png)

### How does Caskada work?

The single file in [Python](https://github.com/skadaai/caskada/blob/main/python/caskada.py) or [Typescript](https://github.com/skadaai/caskada/blob/main/typescript/caskada.ts) capture the core abstraction of LLM frameworks: Graph!<br>

<div align="center"><img src="https://raw.githubusercontent.com/skadaai/caskada/main/.github/media/abstraction.jpg" alt="" width="1300"></div>

<br>

* [Node](/flow/core-abstraction/node.md) handles simple (LLM) tasks with a clear lifecycle (`prep` → `exec` → `post`).
* [Flow](/flow/core-abstraction/flow.md) connects nodes through **Actions** (labeled edges), orchestrating execution.
* [Memory](/flow/core-abstraction/memory.md) manages shared (`global`) and isolated (`local`) state, enabling communication between nodes.

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

<div align="center"><img src="https://raw.githubusercontent.com/skadaai/caskada/main/.github/media/design.jpg" alt="" width="1300"></div>

<br>

* [Agent](/flow/design-patterns/agent.md) autonomously makes decisions based on context.
* [Workflow](/flow/design-patterns/workflow.md) chains multiple tasks into sequential pipelines.
* [RAG](/flow/design-patterns/rag.md) integrates data retrieval with generation.
* [Map Reduce](/flow/design-patterns/mapreduce.md) splits data tasks into Map and Reduce steps.
* [Structured Output](/flow/design-patterns/structure.md) formats outputs consistently.
* [Multi-Agents](/flow/design-patterns/multi_agent.md) coordinate multiple agents.

![](https://raw.githubusercontent.com/skadaai/caskada/master/.github/media/divider.png)

### Tutorials

|                                           Name                                          |            Difficulty           | Description                                                                    |
| :-------------------------------------------------------------------------------------: | :-----------------------------: | ------------------------------------------------------------------------------ |
|        [Chat](https://github.com/skadaai/caskada/tree/main/cookbook/python-chat)        |   <p>☆☆☆<br><em>Dummy</em></p>  | A basic chat bot with conversation history                                     |
|         [RAG](https://github.com/skadaai/caskada/tree/main/cookbook/python-rag)         |   <p>☆☆☆<br><em>Dummy</em></p>  | A simple Retrieval-augmented Generation process                                |
|    [Workflow](https://github.com/skadaai/caskada/tree/main/cookbook/python-workflow)    |   <p>☆☆☆<br><em>Dummy</em></p>  | A writing workflow that outlines, writes content, and applies styling          |
|  [Map-Reduce](https://github.com/skadaai/caskada/tree/main/cookbook/python-map-reduce)  |   <p>☆☆☆<br><em>Dummy</em></p>  | A resume qualification processor using map-reduce pattern for batch evaluation |
|       [Agent](https://github.com/skadaai/caskada/tree/main/cookbook/python-agent)       |   <p>☆☆☆<br><em>Dummy</em></p>  | A research agent that can search the web and answer questions                  |
| [Streaming](https://github.com/skadaai/caskada/tree/main/cookbook/python-llm-streaming) |   <p>☆☆☆<br><em>Dummy</em></p>  | A real-time LLM streaming demo with user interrupt capability                  |
| [Multi-Agent](https://github.com/skadaai/caskada/tree/main/cookbook/python-multi-agent) | <p>★☆☆<br><em>Beginner</em></p> | A Taboo word game for asynchronous communication between two agents            |
|  [Supervisor](https://github.com/skadaai/caskada/tree/main/cookbook/python-supervisor)  | <p>★☆☆<br><em>Beginner</em></p> | Research agent is getting unreliable... Let's build a supervision process      |
| [Parallel](https://github.com/skadaai/caskada/tree/main/cookbook/python-parallel-batch) | <p>★☆☆<br><em>Beginner</em></p> | A parallel execution demo that shows 3x speedup                                |
|    [Thinking](https://github.com/skadaai/caskada/tree/main/cookbook/python-thinking)    | <p>★☆☆<br><em>Beginner</em></p> | Solve complex reasoning problems through Chain-of-Thought                      |
|    [Memory](https://github.com/skadaai/caskada/tree/main/cookbook/python-chat-memory)   | <p>★☆☆<br><em>Beginner</em></p> | A chat bot with short-term and long-term memory                                |

And many more available for all levels! [Check them all out!](https://github.com/skadaai/caskada/tree/main/cookbook)

![](https://raw.githubusercontent.com/skadaai/caskada/master/.github/media/divider.png)

### Quick Start

New to Caskada? Check out our [Getting Started](https://github.com/zvictor/BrainyFlow/blob/main/docs/introduction/getting_started.md) guide to build your first flow in no time.

### Ready to Build Self-Coding Apps?

Check out [Agentic Coding Guidance](/flow/guides/agentic_coding.md), the fastest way to develop self-coding LLM projects with Caskada!

![](https://raw.githubusercontent.com/skadaai/caskada/master/.github/media/divider.png)

### Acknowledgement

We would like to extend our deepest gratitude to the creators and contributors of the PocketFlow framework, from which Caskada 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!

Get involved by joining our [Discord server](https://discord.gg/N9mVvxRXyH).

### Liability Disclaimer

Caskada 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

<p align="center"><a href="https://github.com/sponsors/zvictor?utm_source=caskada&#x26;utm_medium=sponsorship&#x26;utm_campaign=caskada&#x26;utm_id=caskada"><img src="https://cdn.jsdelivr.net/gh/skadaai/caskada@main/.github/media/brain.png" alt=""></a><br><br>Caskada runs on 300 lines of code and your generosity! 💰<br><a href="https://github.com/sponsors/zvictor?utm_source=caskada&#x26;utm_medium=sponsorship&#x26;utm_campaign=caskada&#x26;utm_id=caskada">Help us deliver more AI with less code (but maybe more caffeine) </a>☕<br><br><a href="https://github.com/sponsors/zvictor?utm_source=caskada&#x26;utm_medium=sponsorship&#x26;utm_campaign=caskada&#x26;utm_id=caskada">Your support</a> helps keep it minimal, powerful, and dependency-free! 🚀</p>

![](https://raw.githubusercontent.com/skadaai/caskada/master/.github/media/divider.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://brainy.gitbook.io/flow/introduction/index.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
