Skip to content

Afnio Docs

Welcome to the Afnio documentation!


What is Afnio?

Afnio is a flexible and efficient framework for building and automatically optimizing AI agents and end-to-end workflows. It is particularly designed for complex AI systems where Language Models (LMs) are invoked multiple times, such as LM pipelines and agent-driven architectures. Afnio provides dynamic computation graphs, powerful prompt and hyperparameter optimizers, and a rich toolchain for preparing and managing data for optimization. Effortlessly build, optimize, and deploy AI agents for tasks such as classification, information retrieval, question answering, and tool calling.


How to use the docs

  • New to AI optimization frameworks? Start with Learn the Basics — a step-by-step walkthrough from Variables to a full training loop.
  • Coming from PyTorch or a similar framework? Jump to Getting Started → QuickStart for a Colab notebook that gets you optimizing in minutes.
  • Looking up a specific class or function? Head to the API Reference.

For the conceptual model behind textual gradients and the computation graph, see Core Concepts.