aisdk is a unified, layered AI toolkit for R. The self-contained core package exposes a single provider:model interface over many AI providers, plus agent / tool / skill base classes and robust request machinery. A family of companion packages extends that core with extra providers, multi-agent orchestration, the Model Context Protocol, a skill ecosystem, messaging channels, charting/reporting, a Shiny web UI, and local model inference — each opt-in, so the core stays lean.
# Install the family from GitHub (recommended while the companion packages# make their way onto CRAN). install.packages("pak") first if you need it.pak::pak("YuLab-SMU/aisdk") # core only; see "Get started" for the full familylibrary(aisdk)chat <-create_chat_session("openai:gpt-4o")generate_text(chat, "Summarise the tidyverse in one sentence.")
See Get started for a one-step install of the whole family.
Multi-agent layer: Flow (delegation tracing, guardrails), AgentTeam (Manager–Worker), and the Mission system (planning, DAG scheduling, retries, checkpointing).
Shiny web chat interface and model-configuration UI for interactive, streaming conversations.
Design
The core (aisdk) is deliberately self-contained and the only package that needs to be on CRAN for the basics to work. Everything else registers itself with the core on load — providers into the provider registry, skills into the skill registry, the ggplot coercion handler into the serializer — so heavy or optional dependencies never reach the core unless you actually install the companion. See Get started for the typical setup.