AdalFlow is a Python library for building and automatically optimizing LLM applications — think PyTorch, but for prompts and pipelines. It gives you composable components for RAG, agents and chatbots, plus a trainer that tunes prompts and pipeline parameters from your data instead of by trial and error. The project has about 4,200 stars on GitHub and is under active development in 2026.
AdalFlow’s design borrows PyTorch’s two-level philosophy: lightweight core building blocks (model clients, prompts, retrievers, output parsers, generators) and a higher-level Component abstraction you assemble into applications. Its differentiator is auto-optimization: a textual-gradient optimizer, inspired by how neural networks learn, critiques failed outputs and rewrites prompts iteratively, while a trainer/evaluator loop measures each change against your dataset. The library ships unified clients for OpenAI, Anthropic, Google, Groq, local models and more, includes FAISS and BM25 retrievers, rerankers and summarizers for RAG, and provides tracing to debug every step. SylphAI maintains it as the foundation of their LLM-app tooling, and it is used for research agents, question-answering systems and production chatbots where prompt quality needs to be engineered, not guessed.
The project grew out of SylphAI’s consulting work on LLM systems and is maintained with a research bent: its optimizer implements ideas from papers on automatic prompt optimization, and the library is designed so optimized prompts remain readable text you can inspect and ship, not opaque vectors. It also emphasizes local-first development — components cache calls, work offline against local models, and keep your data flow explicit — which makes it popular for teams in regulated settings who still want systematic prompt engineering.
AdalFlow is free and open source under the MIT license; you only pay your chosen model provider’s API costs.
AdalFlow is for LLM application developers and researchers who want to build RAG systems and agents with prompts that improve systematically from data.