AdalFlow Repo Skill
Use this skill when a task involves the AdalFlow Python package: building model-agnostic LLM task pipelines, structured outputs, RAG, agents, tool calling, evaluation, prompt/few-shot/text-gradient optimization, or tracing.
AdalFlow uses PyTorch-like Component building blocks. A typical workflow combines Prompt, ModelClient, Generator, DataClass/parser objects, retrievers, tools, agents, metrics, and tracing callbacks.
First checks
- Read repository provenance before assuming this skill is current for a checkout.
- For a package install/import task, read package overview and root troubleshooting.
- For a quick environment smoke, run check_adalflow_environment.py in the target Python environment.
- Then route to the most specific sub-skill below.
Install/import guidance
For AdalFlow 1.1.1, use Python 3.9+ and include the OpenAI SDK for reliable top-level import because the current Generator module imports OpenAI response event types:
python -m pip install "adalflow[openai]"
python - <<'PY'
import adalflow as adal
print(adal.__version__)
from adalflow import Component, DataClass, Generator, Agent, Runner
print("adalflow import ok")
PY
Install additional extras only for workflows that need them, such as provider SDKs, FAISS/LanceDB/Postgres/Qdrant retrieval, MCP, torch/transformers, datasets, or SQLAlchemy. Do not treat a missing API key, service, dataset, or accelerator as a base package failure.
Route map
Core components and structured I/O
Read core-components-and-structured-io for:
Component, DataComponent, Sequential, ComponentList, Prompt, DataClass, and required_field.
- JSON/YAML/list/int/float/bool parsers and
DataClassParser structured-output prompts.
- Service-free mini-pipeline checks that do not call a model provider.
Model clients, generators, and embedders
Read model-client-and-generator-workflows for:
ModelClient, Generator, GeneratorOutput, Embedder, and BatchEmbedder.
prompt_kwargs, model_kwargs, ModelType, output processors, cache behavior, and async/streaming basics.
- Provider extras and no-credential fake-client tests.
Retrieval, RAG, and data pipelines
Read retrieval-rag-and-data-pipelines for:
Document, TextSplitter, LocalDB, ToEmbeddings, and RetrieverOutputToContextStr.
BM25Retriever, FAISSRetriever, LanceDB, Postgres, Qdrant, and RAG context assembly.
- Optional vector-store, embedding-dimension, stale-index, and service troubleshooting.
Agents, tools, streaming, HITL, and MCP
Read agents-tools-and-streaming for:
FunctionTool, ToolManager, FunctionDefinition, FunctionOutput, and ToolOutput.
Agent, Runner, ReActAgent, RunnerResult, StepOutput, and stream events.
- Human approval/permission handlers, safe tool patterns, and optional MCP tools.
Evaluation and optimization
Read evaluation-and-optimization for:
AnswerMatchAcc, RetrieverEvaluator, cautious LLMasJudge, and dataset loaders.
Parameter, GradComponent, AdalComponent, Trainer, BootstrapFewShot, TGDOptimizer, EvalFnToTextLoss, LLMAsTextLoss, and optimize_anything.
- Training/benchmark workflows that require provider credentials, data, and runtime budget.
Tracing, observability, and configuration
Read tracing-observability-and-configuration for:
setup_env, logging helpers, config loading, and default artifact roots.
GeneratorStateLogger, GeneratorCallLogger, callbacks, spans, trace providers, and optional MLflow.
- Debug artifacts, path hygiene, and trace/log troubleshooting.
Cross-workflow rules
- Start service-free when possible: validate
DataClass, parser, TextSplitter, metrics, fake ModelClient, or fake Runner behavior before adding providers.
- Choose provider extras only after the required
ModelClient is known. API credentials and network calls are workflow prerequisites, not skill smoke checks.
- For RAG, separate data preparation, retrieval index construction, context formatting, generator configuration, evaluation metrics, and tracing; each has a different owner sub-skill.
- For agents, verify tools independently with
FunctionTool/ToolManager before letting an LLM planner call them.
- For optimization, define evaluation and loss contracts before running
Trainer.fit; prefer Trainer.diagnose or metric smokes before expensive training.
- For tracing/logging, keep artifacts in explicit writable directories and avoid logging secrets, provider payloads, or machine-specific paths.
When not to use this skill
- The task is only about editing this repository's release process, CI, or publishing scripts.
- The task needs a different package's APIs and only mentions AdalFlow as background context.
- The user asks Creator to perform downstream research directly; switch to Researcher mode instead of using this operating graph here.
1---2name: adalflow3description: "Use AdalFlow to build, debug, evaluate, optimize, trace, and4 operate LLM task pipelines, RAG systems, agents, tools, and structured-output5 workflows."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/adalflow9 disco-role: operating10license: MIT11---1213# AdalFlow Repo Skill1415Use this skill when a task involves the AdalFlow Python package: building model-agnostic LLM task pipelines, structured outputs, RAG, agents, tool calling, evaluation, prompt/few-shot/text-gradient optimization, or tracing.1617AdalFlow uses PyTorch-like `Component` building blocks. A typical workflow combines `Prompt`, `ModelClient`, `Generator`, `DataClass`/parser objects, retrievers, tools, agents, metrics, and tracing callbacks.1819## First checks20211. Read [repository provenance](references/repo-provenance.md) before assuming this skill is current for a checkout.222. For a package install/import task, read [package overview](references/package-overview.md) and [root troubleshooting](references/troubleshooting.md).233. For a quick environment smoke, run [check_adalflow_environment.py](scripts/check_adalflow_environment.py) in the target Python environment.244. Then route to the most specific sub-skill below.2526## Install/import guidance2728For AdalFlow 1.1.1, use Python 3.9+ and include the OpenAI SDK for reliable top-level import because the current `Generator` module imports OpenAI response event types:2930```bash31python -m pip install "adalflow[openai]"32python - <<'PY'33import adalflow as adal34print(adal.__version__)35from adalflow import Component, DataClass, Generator, Agent, Runner36print("adalflow import ok")37PY38```3940Install additional extras only for workflows that need them, such as provider SDKs, FAISS/LanceDB/Postgres/Qdrant retrieval, MCP, torch/transformers, datasets, or SQLAlchemy. Do not treat a missing API key, service, dataset, or accelerator as a base package failure.4142## Route map4344### Core components and structured I/O4546Read [core-components-and-structured-io](sub-skills/core-components-and-structured-io/SKILL.md) for:4748- `Component`, `DataComponent`, `Sequential`, `ComponentList`, `Prompt`, `DataClass`, and `required_field`.49- JSON/YAML/list/int/float/bool parsers and `DataClassParser` structured-output prompts.50- Service-free mini-pipeline checks that do not call a model provider.5152### Model clients, generators, and embedders5354Read [model-client-and-generator-workflows](sub-skills/model-client-and-generator-workflows/SKILL.md) for:5556- `ModelClient`, `Generator`, `GeneratorOutput`, `Embedder`, and `BatchEmbedder`.57- `prompt_kwargs`, `model_kwargs`, `ModelType`, output processors, cache behavior, and async/streaming basics.58- Provider extras and no-credential fake-client tests.5960### Retrieval, RAG, and data pipelines6162Read [retrieval-rag-and-data-pipelines](sub-skills/retrieval-rag-and-data-pipelines/SKILL.md) for:6364- `Document`, `TextSplitter`, `LocalDB`, `ToEmbeddings`, and `RetrieverOutputToContextStr`.65- `BM25Retriever`, `FAISSRetriever`, LanceDB, Postgres, Qdrant, and RAG context assembly.66- Optional vector-store, embedding-dimension, stale-index, and service troubleshooting.6768### Agents, tools, streaming, HITL, and MCP6970Read [agents-tools-and-streaming](sub-skills/agents-tools-and-streaming/SKILL.md) for:7172- `FunctionTool`, `ToolManager`, `FunctionDefinition`, `FunctionOutput`, and `ToolOutput`.73- `Agent`, `Runner`, `ReActAgent`, `RunnerResult`, `StepOutput`, and stream events.74- Human approval/permission handlers, safe tool patterns, and optional MCP tools.7576### Evaluation and optimization7778Read [evaluation-and-optimization](sub-skills/evaluation-and-optimization/SKILL.md) for:7980- `AnswerMatchAcc`, `RetrieverEvaluator`, cautious `LLMasJudge`, and dataset loaders.81- `Parameter`, `GradComponent`, `AdalComponent`, `Trainer`, `BootstrapFewShot`, `TGDOptimizer`, `EvalFnToTextLoss`, `LLMAsTextLoss`, and `optimize_anything`.82- Training/benchmark workflows that require provider credentials, data, and runtime budget.8384### Tracing, observability, and configuration8586Read [tracing-observability-and-configuration](sub-skills/tracing-observability-and-configuration/SKILL.md) for:8788- `setup_env`, logging helpers, config loading, and default artifact roots.89- `GeneratorStateLogger`, `GeneratorCallLogger`, callbacks, spans, trace providers, and optional MLflow.90- Debug artifacts, path hygiene, and trace/log troubleshooting.9192## Cross-workflow rules9394- Start service-free when possible: validate `DataClass`, parser, `TextSplitter`, metrics, fake `ModelClient`, or fake `Runner` behavior before adding providers.95- Choose provider extras only after the required `ModelClient` is known. API credentials and network calls are workflow prerequisites, not skill smoke checks.96- For RAG, separate data preparation, retrieval index construction, context formatting, generator configuration, evaluation metrics, and tracing; each has a different owner sub-skill.97- For agents, verify tools independently with `FunctionTool`/`ToolManager` before letting an LLM planner call them.98- For optimization, define evaluation and loss contracts before running `Trainer.fit`; prefer `Trainer.diagnose` or metric smokes before expensive training.99- For tracing/logging, keep artifacts in explicit writable directories and avoid logging secrets, provider payloads, or machine-specific paths.100101## When not to use this skill102103- The task is only about editing this repository's release process, CI, or publishing scripts.104- The task needs a different package's APIs and only mentions AdalFlow as background context.105- The user asks Creator to perform downstream research directly; switch to Researcher mode instead of using this operating graph here.