
PocketFlow.js is a TypeScript port of the original Python version - a minimalist LLM framework.
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!
npm install pocketflow
Alternatively, you can simply copy the source code directly into your project.
Run the following command to create a new PocketFlow project:
npx create-pocketflow
Use cursor/windsurf/any other LLM builtin IDE to open the project.
You can type the following prompt to the agent to confirm the project is setup correctly:
Help me describe briefly about PocketFlow.js
Simply start typing your prompt, and the AI agent will build the project for you.
Here's a simple example:
I want to create an application that can write novel:
1. User can enter a novel title
2. It will generate a outline of the novel
3. It will generate a chapter based on the outline
4. It will save the chapter to ./output/title_name.md
First, read the requirements carefully.
Then, start with design.md first. Stop there until further instructions.
Once you have the design, and you have no questions, start the implementation by simply typing:
Start implementing the design.
To run tests locally:
# Install dependencies
npm install
# Run tests
npm test
We welcome contributions from the community! Here's how you can help:
Please read and follow our Code of Conduct to foster an inclusive community.
We use GitHub Actions for continuous integration and deployment:
Note: To publish to npm, maintainers need to configure the NPM_TOKEN secret in the repository settings.
Fork the Repository
Create your own fork of the repo
Create a Branch
Create a feature branch (git checkout -b feature/amazing-feature)
For bug fixes, use (git checkout -b fix/bug-description)
Make Your Changes
Follow the code style and conventions
Keep your changes focused and related to a single issue
Test Your Changes
Ensure all tests pass with npm test
Add new tests if appropriate
Commit Your Changes
Use clear and descriptive commit messages
Reference issue numbers in commit messages when applicable
Submit a Pull Request
To create a CursorRule to make AI agents work more effectively on the codebase:
# Clone your forked repository
git clone https://github.com/yourusername/PocketFlow-Typescript.git
cd PocketFlow-Typescript
# Install dependencies
npm install
# Run tests
npm test
When reporting bugs, please include:
This project is licensed under the MIT License - see the LICENSE file for details.
$ claude mcp add PocketFlow-Typescript \
-- python -m otcore.mcp_server <graph>