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.
  • WorkflowsDurableWorkflow for multi-step agent compositions with persistence.
  • Directives@datetime, @context, @memory, /tool.name directives 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 UniversalAgent constructor.

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:

Pattern examples

Where to go to ship it

  • 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.