Pillar — SDK
The Python library that makes adding AI to your product feel like a normal pull request.
The SDK pillar is the pip-installable surface — pip install sagewai and you have UniversalAgent, tool calling, memory, workflows, directives, MCP, sandbox, and model-swap. No admin server required. No other Sagewai pillar required. The platform layers on top when you need them; the SDK is useful on its own.
What the pillar does
UniversalAgent— the core agent class. Single-turn or multi-turn, tool-calling or pure chat, any LLM via LiteLLM.- Tools and MCP — Python tools registered with the agent, and MCP-compliant tool servers (Anthropic's open standard) attached transparently.
- Memory and RAG — vector memory, graph memory (
GraphMemory,NebulaGraphMemory), strategy-based extraction, semantic-checkpoint recall. - Workflows —
DurableWorkflowfor multi-step agent compositions with persistence. - Directives —
@datetime,@context,@memory,/tool.namedirectives that expand at prompt-resolution time. The harness any LLM moat. - Sandbox — agents running inside isolated containers with scoped credentials. The Sealed-spine integration for the SDK.
- Model swap — same code, any LLM. Anthropic, OpenAI, Ollama, LM Studio, Modal, Vast.ai endpoints — all behind the same
UniversalAgentconstructor.
What proves it works
Primary lighthouse
Moderation and classification — the cleanest single proof of ML and LLM both first-class. Three HuggingFace classifiers in a sealed sandbox-ml container, judged by a Haiku-class LLM, audit per call.
Sibling lighthouses
- Memory and retrieval — semantic checkpoint recall (Example 37) and graph-beats-vector for incident response (Example 41).
Foundation examples
The SDK pillar's foundation surface is most of the Foundation section. Pick the ones that match what you're shipping:
- 02 — tool_agent — tool calling
- 04 — memory_agent — memory basics
- 05 — workflow — multi-step workflows
- 06 — guardrails — safety filters
- 07 — mcp_tools — MCP integration
- 08 — directives — directive library
- 03 — multi_model, 13 — model_routing, 18 — local_llm_routing — model swap
Pattern examples
- 19 — domain_model
- 21 — full_stack
- 27 — app_factory
- 29 — memory_strategies
- 31 — grounded_multi_model
- 32 — global_shared_memory
Where to go to ship it
- Quickstart — the 60-second hello-world.
- Getting started — the longer "build a portfolio site with Claude Code" tour.
- Core concepts: Agents —
UniversalAgent, composition patterns. - Core concepts: Memory & RAG — the memory subsystem.
- Core concepts: Workflows —
DurableWorkflow, approval gates. - Core concepts: Directives — directive-library deep dive.
- API reference: Agents — the full agent API.
Related
- Sealed spine — the security architecture that makes the SDK safe to point at production.
- Pillars overview — the other four pillars and how they compose with the SDK.