Executing
Executing Tasks in DigitalFate
DigitalFate revolves around task execution every interaction is centered around achieving a specific objective. Whether you're calling a single LLM or running a multi-step autonomous agent, execution is streamlined, modular, and production-ready.
🧠 Core Concept: Tasks
In DigitalFate, a Task
is a structured goal. It can be as simple as a one-shot LLM call, or as complex as a multi-agent recursive breakdown of subtasks. Tasks are defined by descriptions, enhanced by tools, and executed by agents.
pythonCopyEditfrom digitalfate import Task
task1 = Task(description="Summarize the latest news about AI")
Tasks can also include tools (like Search, PDFReader, etc.) and metadata.
👤 Agent Execution
Agents are configured with a job title, memory preferences, knowledge base, and more. Once defined, agents execute tasks intelligently based on their role and toolset.
pythonCopyEditfrom digitalfate import digitalfateClient, AgentConfiguration
from digitalfate.client.tools import Search
client = digitalfateClient("localserver")
client.set_config("OPENAI_API_KEY", "your_key")
task = Task(description="Find recent updates from OpenAI", tools=[Search])
agent = AgentConfiguration(
job_title="AI Research Assistant",
company_url="https://digitalfate.ai",
company_objective="Help users automate complex knowledge work"
)
client.agent(agent, task)
print(task.response)
🧩 Task Composition & Subtasking
High-level tasks are automatically broken down into subtasks depending on complexity and agent version. For example:
textCopyEdit"Research LLM trends"
⮕ ["Search for recent LLM news", "Read OpenAI blog", "Summarize findings"]
These subtasks are handled either sequentially or in parallel by the agent's logic and memory.
⚡ Direct LLM Call (For Simplicity)
When you don’t need full agent orchestration, you can call the LLM directly for speed and lower cost:
pythonCopyEditclient.call(task)
print(task.response)
Use this for:
Basic Q&A
Summarization
Quick data formatting
🧰 Using Tools in Execution
Tools add superpowers to agents. You can include tools in a task like so:
pythonCopyEditfrom digitalfate.client.tools import Search, PDFReader
task = Task(
description="Extract insights from recent AI whitepapers",
tools=[Search, PDFReader]
)
Built-in tools include:
Search
: Web resultsBrowser
: Page scrapingPDFReader
: Document ingestionCSVTool
: Tabular parsingCodeInterpreter
: Execute and explain codeCustom tools (1-line integration)
🧠 Memory-Based Agents
Enable memory in AgentConfiguration
to persist context across executions:
pythonCopyEditagent = AgentConfiguration(
agent_id="pm_agent_v2",
job_title="Product Manager",
memory=True
)
Useful for:
Long-term planning
Multi-session work
Personalized agents
📚 Knowledge Base
Feed agents PDFs, URLs, or other documents to increase accuracy:
pythonCopyEditfrom digitalfate import KnowledgeBase
kb = KnowledgeBase(files=["strategy.pdf", "research_notes.pdf"])
agent.knowledge_base = kb
The agent now has context-aware understanding.
💥 Multi-Agent + Parallel Execution (Advanced)
With MCP (Multi-Client Processing), you can orchestrate parallel agents for large workloads or SaaS applications.
pythonCopyEditclient.parallel_agents([agent1, agent2], [task1, task2])
MCP enables true concurrent task execution especially useful in high-throughput environments like customer support, market analysis, or product pipelines.
🖥️ Computer Use (Human-like UI Control)
Enable agents to simulate real human interaction on a digital interface:
pythonCopyEdittask = Task(description="Log into Google and search 'DigitalFate framework'")
agent.enable_computer_use = True
client.agent(agent, task)
Backed by Anthropic's Computer Use API, this allows agents to:
Click
Type
Navigate UI
Fill out forms
🌐 Endpoint Deployment (For SaaS)
DigitalFate agents and task flows can be triggered via API endpoints, making them perfect for SaaS use cases.
Example:
Call an agent via HTTP
Automate PDF summarization
Trigger research agents from a web form
🧪 Sample Output Structure
pythonCopyEditfor item in task.response.news_list:
print("Title:", item.title)
print("Body:", item.body)
print("URL:", item.url)
print("Tags:", item.tags)
You get structured, typed responses via ObjectResponse
no messy JSON parsing needed.
🔁 Recap Workflow
Define a
Task
Configure an
Agent
Execute with
.agent()
or.call()
Optionally enable memory, tools, or knowledge
Get structured results and act on them
DigitalFate turns LLMs into agents, and agents into business logic.
Last updated