API reference
This page lists the import path for every public name in loomflow,
grouped by purpose, so you can find where something lives. Each
group links to the page that explains how to use it. For full
parameter-by-parameter references see Agent,
Workflow and the
architecture classes.
The package ships a py.typed marker, so IDEs (Pylance, Pyright,
mypy) get autocomplete and go-to-definition on every public symbol.
If your IDE doesn’t pick this up, see Common pitfall: stale
install.
Agent
from loomflow import Agent, Tuning
from loomflow import ApprovalDecision, GoalStopHook, StopHook, StopHookResultThe model-driven loop. See What is an Agent
and the Agent reference.
Tuning groups the rarely-touched knobs (retry_policy, secrets,
auto_consolidate, response_tone, stop_hooks,
max_stop_hook_iterations, checkpoint, tool search, memory budget,
and the tool-transcript / auto-compact settings) into one optional
dataclass: pass Agent(..., tuning=Tuning(...)). See
Tuning fields.
ApprovalDecision is the rich return type for approval handlers.
GoalStopHook is what Agent(run_until=...) installs; StopHook /
StopHookResult let you write your own.
Workflow
from loomflow import END, START, Workflow, WorkflowResult, stepGraphs of steps you define in code. See Workflow
and the Workflow reference.
Architectures
from loomflow import Architecture, ReAct
from loomflow.architecture import ActorCritic, Blackboard, BlackboardArchitecture, BlackboardEntry, MultiAgentDebate, Plan, PlanAndExecute, PlanStep, Reflexion, ReWOO, ReWOOPlan, ReWOOStep, ReWOOStepResult, Router, RouterRoute, SelfRefine, StepResult, Supervisor, Swarm, Handoff, ThoughtNode, TreeOfThoughts, AgentSession, Dependencies, resolve_architecture
from loomflow.team import Team, run_architectureSee Architectures.
Models
from loomflow import EchoModel, ScriptedModel, ScriptedTurn, Image, count_tokens
from loomflow.model import AnthropicModel, FallbackModel, LiteLLMModel, OpenAIModel, default_fall_on
from loomflow.model.retrying import RetryingModelSee Models · Fallback chains + timeouts · Vision.
Context management
from loomflow import context_window_for, maybe_auto_compact, snip_messagesThe helpers behind Agent(snip_window=) and
Agent(auto_compact_at_tokens=), exposed for custom architectures.
See snip_window and
auto_compact_at_tokens.
Memory
from loomflow import HashEmbedder, InMemoryMemory, resolve_memory
from loomflow.memory import ChromaFactStore, ConsolidationWorker, Consolidator, FactStore, InMemoryFactStore, PostgresFactStore, RedisFactStore, SqliteFactStore
from loomflow.memory.auto_extract import AutoExtractMemory
from loomflow.memory.chroma import ChromaMemory
from loomflow.memory.embedder import CohereEmbedder, OpenAIEmbedder, VoyageEmbedder
from loomflow.memory.lazy import LazyMemory
from loomflow.memory.postgres import PostgresMemory
from loomflow.memory.redis import RedisMemory
from loomflow.memory.sqlite import SqliteMemory
from loomflow.memory.vector import VectorMemorySee Memory.
Vector stores and loaders
from loomflow.vectorstore import ChromaVectorStore, FAISSVectorStore, InMemoryVectorStore, PostgresVectorStore, SearchResult, VectorStore
from loomflow.loader import Chunk, Document, MarkdownChunker, RecursiveChunker, SentenceChunker, TokenChunker, chunk, loadTools
from loomflow import LivingPlan, LivingPlanStep, Tool, tool, web_tool
from loomflow.tools import InProcessToolHost, PathEscapeError, bash_tool, default_workdir, edit_tool, filesystem_tools, find_tool, grep_tool, ls_tool, read_tool, write_tool
from loomflow.tools import CodeExecutor, SubprocessExecutor, make_code_mode_tools
from loomflow.tools.plan import get_active_plan, make_plan_tools, make_recall_past_plans_toolSee Tools · Built-in tools · Code mode · Living plan.
Workspace
from loomflow import (
InMemoryWorkspace,
LocalDiskWorkspace,
Workspace,
WorkspaceMembership,
resolve_workspace,
)
from loomflow.workspace import (
Note,
NoteKind,
NoteMatch,
NoteSummary,
NoteVersion,
PruneResult,
make_workspace_tools,
workspace_prompt_section,
)See Workspace · Workspace lifecycle.
Skills
from loomflow.skills import Skill, SkillError, SkillMetadata, SkillRegistry, SkillSourceSee Skills.
MCP
from loomflow.mcp import MCPClient, MCPRegistry, MCPServerSpecSee MCP.
Runtime
from loomflow import InProcRuntime
from loomflow.runtime import Checkpoint, CheckpointMeta, InMemoryJournalStore, JournaledRuntime, JournalStore, PostgresJournalStore, PostgresRuntime, SqliteJournalStore, SqliteRuntime, journal_scope, resolve_runtimeSee Runtime · Checkpoints.
Security
from loomflow import AllowAll, AuditLog, FullTranscriptAuditLog, HookRegistry, InMemoryAuditLog, Mode, NoSandbox, OSSandbox, StandardPermissions
from loomflow.security import AuditProblem, AuditVerification, DictSecrets, EnvSecrets, FileAuditLog, FilesystemSandbox, PerUserPermissions, SubprocessSandbox, verify_chain, verify_signatureSee Security.
Guardrails
from loomflow.guardrails import GuardedStream, Guardrail, GuardrailOutcome, GuardrailTrigger, GuardVerdict, InjectionGuard, ModerationGuard, PIIGuard, RegexGuard, apply_guardrailsNot re-exported from the top-level package. See Guardrails.
Governance
from loomflow import BudgetConfig, NoBudget, StandardBudget, TokenBucketRateLimiter
from loomflow.governance import RateLimiter, RetryPolicy, classify_model_error, compute_backoffSee RetryPolicy + error taxonomy · Per-user budget caps · Rate limiting.
Decisions
from loomflow.decisions import Box, Choice, DecisionApprovalPolicy, DecisionGuard, DecisionModel, Decisions, JevModel, LLMDecisionModel, Noul, Question, Score, ScriptedDecisionsTyped answers with probabilities for the framework’s internal judgments (which route, is the goal met, is this call risky) without a full LLM call. See Decisions.
Observability
from loomflow import NoTelemetry
from loomflow.observability import (
InMemoryTelemetry,
ConsoleTelemetry,
FileTelemetry,
MultiTelemetry,
OTelTelemetry,
CapturedSpan,
CapturedMetric,
)
from loomflow.graph import AgentGraph, build_graph, write_graphSee OpenTelemetry · AgentGraph.
Studio
import loomflow.studio
from loomflow.studio import dataset, disable, enable, flush, is_enabled, prune, score, session
from loomflow.studio.web import create_appenable(path, project=, sample_rate=, capture_content=, redact=, keep_days=) records every run; session(project=, tags=, metadata=, enabled=) scopes it; score(result, key, value) attaches a score;
prune(days) deletes old runs; dataset(name) loads a dataset built
in Studio as an eval Dataset; create_app(path, read_only=, allowed_hosts=, agents=) is the loom studio web app (agents= are
the agents its page may run evals on). Environment:
LOOMFLOW_STUDIO, LOOMFLOW_STUDIO_PROJECT,
LOOMFLOW_STUDIO_KEEP_DAYS. See
Studio.
Evals
from loomflow.eval import Case, CaseResult, Dataset, EvalHarness, EvalReport, LLMJudgeSee Evals.
Serving and A2A
from loomflow.serve import create_app
from loomflow.a2a import A2AClient, AgentCard, serve_a2aSee Serving over HTTP · A2A protocol.
Data lineage
from loomflow.core.types import CertifiedValue
from loomflow.data import FreshnessPolicy, LineagePolicy, check_freshness, check_lineage, require_freshness, require_lineageCertifiedValue wraps a value with its source, fetch time, expiry
and lineage. The policies check it and raise FreshnessError /
LineageError (see Errors).
Core types
from loomflow import BudgetStatus, Episode, EpisodeMatch, Event, EventKind, Fact, MemoryBlock, MemoryExport, MemoryProfile, Message, PermissionDecision, Role, RunResult, ToolCall, ToolDef, ToolResult, Usage
from loomflow.core.types import AuditEntry, ModelChunk, PromptCacheConfig, Span, ToolEventPromptCacheConfig is what the Agent(prompt_caching=) kwarg
resolves to. Usage carries cached_input_tokens and RunResult
carries cached_tokens_in, plus cache_write_tokens on both. See
Prompt caching.
Protocols
from loomflow import Budget, Embedder, HookHost, Memory, Model, Permissions, Runtime, Sandbox, Secrets, Telemetry, ToolHostImplement any of these to add a new backend without forking the framework.
RunContext
from loomflow import IsolationWarning, RunContext, get_run_context, set_run_contextSee Run vs Session vs RunContext.
Errors
from loomflow import BudgetExceeded, ConfigError, LoomError, OutputValidationError, RateLimitExceeded, RunTimeout
from loomflow.core.errors import AuthenticationError, CancelledByUser, ContentFilterError, FreshnessError, InvalidRequestError, LineageError, MCPError, MemoryStoreError, ModelError, PermanentModelError, PermissionDenied, RateLimitError, RuntimeJournalError, SandboxError, ToolError, TransientModelError
from loomflow.model._effort import EffortNotSupportedError
from loomflow import LoomDeprecationWarningSee Errors.
Identity helpers
from loomflow import new_id
from loomflow.core.ids import deterministic_hashnew_id() returns a fresh ULID. deterministic_hash(obj) returns
a stable hash of any JSON-serializable object. The framework uses it
for journal keys; it is also useful in custom architectures.
Version
from loomflow import __version____version__ is the installed version string. These docs describe
loomflow 0.17.