windlass.api¶
api
¶
The Windlass facade — one entry point for the whole framework.
Everything starts here::
from windlass import Windlass
rag = Windlass.rag() # a RAG pipeline builder
agent = Windlass.agent() # an agent builder
llm = Windlass.llm("openai") # a single component
Windlass.list("chunker") # what is available
The class is a namespace of static factories, not something you instantiate. Its job is discoverability: one import, and your editor's autocomplete shows you the entire framework.
Windlass
¶
Factory namespace for every Windlass component and builder.
Example
from windlass import Windlass rag = Windlass.rag() rag.ingest_text("Windlass unifies the AI ecosystem behind one API.") 1 "Windlass" in str(rag.ask("What does Windlass do?").contexts[0].content) True
Source code in src\windlass\api.py
rag
staticmethod
¶
Start building a RAG pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
container
|
Container | None
|
Dependency container. Defaults to a child of the process root, so application-wide bindings are inherited. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Example
from windlass import Windlass rag = (Windlass.rag() ... .chunker("recursive", chunk_size=800) ... .retriever("hybrid") ... .top_k(8)) rag.ingest_text("Vector databases store embeddings.") 1
Source code in src\windlass\api.py
agent
staticmethod
¶
Start building an agent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
container
|
Container | None
|
Dependency container. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
Any
|
class: |
Example
from windlass import Windlass agent = Windlass.agent().llm("fake", responses=["Hello!"]) agent.run("Say hello").output 'Hello!'
Source code in src\windlass\api.py
supervisor
staticmethod
¶
supervisor(
agents: dict[str, Any],
*,
llm: Any = None,
descriptions: dict[str, str] | None = None,
**config: Any
) -> Any
Build a multi-agent supervisor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agents
|
dict[str, Any]
|
Specialists keyed by the name the supervisor will use. |
required |
llm
|
Any
|
The coordinating model. Defaults to the configured provider. |
None
|
descriptions
|
dict[str, str] | None
|
What each specialist is for. The supervisor routes on this text, so it is worth writing carefully. |
None
|
**config
|
Any
|
Forwarded to :class: |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Example
from windlass import Windlass boss = Windlass.supervisor( ... {"writer": Windlass.agent().llm("fake", responses=["Drafted."])}, ... llm=Windlass.llm("fake", responses=["Done."]), ... ) boss.broadcast("write something")["writer"].output 'Drafted.'
Source code in src\windlass\api.py
llm
staticmethod
¶
Construct a language model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Registry name, or a bare model id like |
None
|
**config
|
Any
|
Provider options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
Any
|
class: |
Raises:
| Type | Description |
|---|---|
ComponentNotFoundError
|
For an unknown provider. |
MissingDependencyError
|
When the provider's extra is not installed. |
Example
from windlass import Windlass Windlass.llm("fake", responses=["hi"]).complete("x").content 'hi'
Source code in src\windlass\api.py
embedding
staticmethod
¶
Construct an embedding model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Registry name. Defaults to the configured provider. |
None
|
**config
|
Any
|
Provider options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
Any
|
class: |
Source code in src\windlass\api.py
vectordb
staticmethod
¶
Construct a vector store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Registry name. Defaults to the configured store. |
None
|
**config
|
Any
|
Store options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Source code in src\windlass\api.py
chunker
staticmethod
¶
Construct a chunker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Registry name. Defaults to the configured strategy. |
None
|
**config
|
Any
|
Strategy options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Example
from windlass import Windlass len(Windlass.chunker("recursive", chunk_size=20).split_text("a " * 40)) > 1 True
Source code in src\windlass\api.py
retriever
staticmethod
¶
Construct a retriever.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Registry name. Defaults to the configured strategy. |
None
|
**config
|
Any
|
Strategy options. Dense strategies need |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Source code in src\windlass\api.py
loader
staticmethod
¶
Construct a document loader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Registry name. Omit it for automatic format detection. |
None
|
**config
|
Any
|
Loader options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Source code in src\windlass\api.py
preprocessor
staticmethod
¶
Construct a preprocessor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name. |
'clean'
|
**config
|
Any
|
Preprocessor options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Source code in src\windlass\api.py
memory
staticmethod
¶
Construct a memory backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name. |
'window'
|
**config
|
Any
|
Memory options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Source code in src\windlass\api.py
guardrail
staticmethod
¶
Construct a guardrail.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name. |
'rules'
|
**config
|
Any
|
Policy options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Example
from windlass import Windlass Windlass.guardrail(on_violation="redact").validate("mail a@b.com") 'mail [EMAIL]'
Source code in src\windlass\api.py
evaluator
staticmethod
¶
Construct an evaluator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name — |
'builtin'
|
**config
|
Any
|
Evaluator options, including |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
Any
|
class: |
Source code in src\windlass\api.py
tracer
staticmethod
¶
Construct a tracer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name. |
'console'
|
**config
|
Any
|
Tracer options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Source code in src\windlass\api.py
mcp
staticmethod
¶
Construct an MCP client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name. |
'fastmcp'
|
**config
|
Any
|
Transport options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
Any
|
class: |
Source code in src\windlass\api.py
checkpointer
staticmethod
¶
Construct a checkpointer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name — |
'memory'
|
**config
|
Any
|
Checkpointer options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Any
|
class: |
Source code in src\windlass\api.py
create
staticmethod
¶
Construct any registered component, including custom kinds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
Component kind. |
required |
name
|
str
|
Registry name. |
required |
**config
|
Any
|
Constructor options. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
The component. |
Source code in src\windlass\api.py
list
staticmethod
¶
List what is registered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str | None
|
A component kind, or |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
Sorted names for one kind, or a |
Example
from windlass import Windlass "recursive" in Windlass.list("chunker") True "llm" in Windlass.list() True
Source code in src\windlass\api.py
catalog
staticmethod
¶
Return full registry entries, including descriptions and extras.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str | None
|
A component kind, or |
None
|
Returns:
| Type | Description |
|---|---|
list[ComponentSpec]
|
The matching :class: |
Source code in src\windlass\api.py
kinds
staticmethod
¶
configure
staticmethod
¶
Update process-wide settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**overrides
|
Any
|
Any field of
:class: |
{}
|
Returns:
| Type | Description |
|---|---|
WindlassSettings
|
The new settings. |
Example
from windlass import Windlass Windlass.configure(temperature=0.0).temperature 0.0
Source code in src\windlass\api.py
settings
staticmethod
¶
container
staticmethod
¶
Return the process-wide root dependency container.
Bindings placed here are inherited by every builder created afterwards, which makes it the right place for application-wide wiring::
Windlass.container().bind_instance("tracer", MyTracer())
Returns:
| Type | Description |
|---|---|
Container
|
The root :class: |
Source code in src\windlass\api.py
plugins
staticmethod
¶
Discover entry-point plugins.
Runs automatically on first registry lookup; call it explicitly to see
what loaded, or with strict=True to surface plugin errors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strict
|
bool
|
Raise on the first plugin that fails. |
False
|
Returns:
| Type | Description |
|---|---|
list[str]
|
The names that loaded successfully. |
Source code in src\windlass\api.py
tools
staticmethod
¶
Wrap plain functions as tools.
A convenience for binding several existing functions at once.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*functions
|
Any
|
Functions to wrap. |
()
|
Returns:
| Type | Description |
|---|---|
Sequence[Any]
|
The resulting tools. |
Example
from windlass import Windlass def ping() -> str: ... '''Return pong.''' ... return "pong" [t.name for t in Windlass.tools(ping)]['ping']