README - kongusen/loom-agent GitHub Wiki
Get a Loom agent running in under 5 minutes.
pip install loom-agent
export ANTHROPIC_API_KEY=sk-ant-...import asyncio
from loom import Agent, Model, Runtime
async def main():
agent = Agent(
model=Model.anthropic("claude-sonnet-4"),
instructions="You are a concise assistant.",
runtime=Runtime.sdk(),
)
result = await agent.run("List the main capabilities of Loom")
print(result.output)
asyncio.run(main())-
Agentis the only top-level execution object. -
Modelselects the provider-backed model. -
Runtimeselects the execution profile and policy composition. -
Capabilitydeclares files, web, shell, MCP, and skill access. - Use
agent.run()for one-off executions. - Use
agent.session(SessionConfig(...))when the application needs continuity. - Use
RuntimeSignalandSignalAdapterfor gateway, cron, heartbeat, webhook, and application events.
- Start from
from loom import ...for the main application path. - Use
from loom.config import ...for advanced configuration internals. - Use
from loom.runtime import ...only when you need runtime states or mechanism contracts directly.
Use Model to select a provider-backed model:
Model.anthropic(...)Model.openai(...)Model.gemini(...)Model.qwen(...)Model.ollama(...)
Provider implementations live under loom/providers/, but application code should normally configure providers through Model.