Core Concept: Tasks
A Task represents one concrete user request.
from nucleusiq.agents.task import Task
task = Task(
id="task-1",
objective="Summarize this report",
metadata={"priority": "high"},
)
Task fields
id: unique task identifierobjective: concrete user instructioncontext: optional auxiliary facts. Rendered (v0.7.14) as a bounded## Task Contextblock immediately before the objective. Previously accepted and silently dropped.resources: optional list of documents / files / records this task must cover (v0.7.14)metadata: optional tags / structured metadataattachments: optional multimodal inputs
Grounded resources (v0.7.14)
When the job is about a known set of documents, declare them on the task — do not paste the same list into objective. The Decomposer, coverage follow-up, and Critic all use this list.
from nucleusiq.agents.task import Task
task = Task(
id="inv-1",
objective="Extract vendor and total from every invoice.",
resources=["invoices/acme.pdf", "invoices/globex.pdf"],
context={"currency": "EUR", "customer": "ACME"},
)
task.effective_resources() returns a de-duplicated list. context["resources"] is accepted as a fallback; the typed resources field wins when both are present.
In Autonomous mode:
- The Decomposer grounds Gate 4 on the list (same sources / one record → SIMPLE).
- Every COMPLEX child must claim a slice.
- After execution,
unprocessed = resources − touchedlands inresult.metadata["coverage"]andresult.diagnostics.coverage. - One bounded follow-up runs on the gap (
coverage_followup=True, default). evidence_gate_enforce=Trueturns a residual gap intostatus=ABSTAINED/abstention_code="coverage_incomplete".
Without resources, coverage reconciliation is a no-op.
MessageBuilder emits one bounded ## Task Context / ## Resources (N) user message. Resources beyond 60 are summarised as a count. Tasks without context / resources produce the same messages as before v0.7.14.
Do not paste the same facts into objective unless you want the classifier, Critic, and validator to see them twice.
Attachment example
from nucleusiq.agents.attachments import Attachment, AttachmentType
from nucleusiq.agents.task import Task
task = Task(
id="task-2",
objective="Extract key points from this PDF",
attachments=[
Attachment(type=AttachmentType.PDF, data=pdf_bytes, name="report.pdf"),
],
)
See also
- Autonomous mode — why
resourcesexists and how coverage works - Autonomous workflow — invoice extraction with
resources - Execution modes — coverage and Critic/Refiner
- v0.7.14 release notes