Close Menu
  • AI
  • Content Creation
  • Tech
  • Robotics
AI-trends.todayAI-trends.today
  • AI
  • Content Creation
  • Tech
  • Robotics
Trending
  • Lean and Mathlib Communities Certify Claude-Assisted Riemann Proof – Unite.AI
  • AWS Routes HyperPod Inference Throughout Areas From One Endpoint – Unite.AI
  • DailyAI Briefing: A Lean-checked Riemann proof, plus 4 extra
  • Anthropic Shares Drop 8.5% in Second Session Throughout AI Selloff – Unite.AI
  • OpenAI Ships GPT-Stay-1.1 for Voice Brokers, Cuts Idle Value to $0.02/Min
  • Copywriting: The Full Information | Copyblogger
  • AI Governance in 2027: Accountability Strikes Into the Workflow – Unite.AI
  • Reply Engine Optimization (AEO): The Full Information
AI-trends.todayAI-trends.today
Home»Tech»A Guide for Designing Intelligent Parallel Workflows with Parsl to Execute Multi-Tool Agents

A Guide for Designing Intelligent Parallel Workflows with Parsl to Execute Multi-Tool Agents

Tech By Gavin Wallace15/08/20256 Mins Read
Facebook Twitter LinkedIn Email
Samsung Researchers Introduced ANSE (Active Noise Selection for Generation): A
Samsung Researchers Introduced ANSE (Active Noise Selection for Generation): A
Share
Facebook Twitter LinkedIn Email

We will implement a pipeline of AI agents using this tutorial. ParslIts parallel execution capability allows multiple tasks to be run as separate Python applications. Configuring a ThreadPoolExecutor locally for concurrency allows us to define tools like Fibonacci calculation, prime counting and keyword extraction. We then coordinate these tasks through a lightweight plan that maps user goals into task calls. To produce a coherent and human-readable summation, the outputs of all tasks are compiled together. They’re then sent through Hugging Face to generate text. See the FULL CODES here.

Parse transformers can be installed faster by installing!pip -q.


Random, time, math and json are all included in the import.
Import List, Dict or Any
import parsl
Import Config from Parsl.config
ThreadPoolExecutor can be imported from parsl.executors
From parsl, import python_app


parsl.load(Config(executors=[ThreadPoolExecutor(label="local", max_threads=8)]))

We begin by installing the required libraries & importing all necessary modules for our workflow. Parsl can be configured to use a ThreadPoolExecutor for parallel execution of tasks. This configuration is then loaded so that we can run our Python programs in parallel. Visit the FULL CODES here.

@python_app
def calc_fibonacci(n: int) -> Dict[str, Any]:
   def fib(k):
 a = 0, b = 1
 If _ is in the range(k), then a and b are equal to a plus b.
 The return of aReturn
   t0 = time.time(); val = fib(n); dt = time.time() - t0
   return {"task": "fibonacci", "n": n, "value": val, "secs": round(dt, 4)}


@python_app
def extract_keywords(text: str, k: int = 8) -> Dict[str, Any]:
 Import re: Collections
   words = [w.lower() for w in re.findall(r"[a-zA-Z][a-zA-Z0-9-]+", text)]
 Set stop to ("the a an and or to of is are was were be been in on for with as by from at this that it its if then else not no".split())
  [w for w in words if w not in stop and len(w) > 3]
   freq = collections.Counter(cand)
 Score = sort(freq.items)Return(), key=lambda x: (x[1], len(x[0])), reverse=True)[:k]
   return {"task":"keywords","keywords":[w for w,_ in scored]}


@python_app
Def simul_tool (name: str; payload: DictReturn[str, Any]) -> Dict[str, Any]:
   time.sleep(0.3 + random.random()*0.5)
   return {"task": name, "payload": payload, "status": "ok", "timestamp": time.time()}

Four Parsl @python_apps are defined and run as part of the agent’s work flow. The Fibonacci Calculator, the Prime-Counting Routine, the Keyword Extractor for Text Processing, and an simulated tool which mimics API calls externally with random delays are all created. The modular apps allow us to perform multiple computations simultaneously, which is the basis for building our AI multi-tool agent. See the FULL CODES here.

def tiny_llm_summary(bullets: List[str]) -> str:
 Import pipeline for transformers
   gen = pipeline("text-generation", model="sshleifer/tiny-gpt2")
   prompt = "Summarize these agent results clearly:n- " + "n- ".join(bullets) + "nConclusion:"
 Out = gen(prompt; max_length=160; do_sample=False);[0]["generated_text"]
 Return out.split ("Conclusion:", 1)[-1].strip()

This function uses Hugging Face with the lightweight model sshleifer/tinygpt2 to create concise summaries for our agent. It formats collected task outputs into bullet points and appends an “Conclusion:” The cue software extracts just the conclusion generated by it, leaving a clean and readable summary. Take a look at the FULL CODES here.

def plan(user_goal: str) -> List[Dict[str, Any]]:
 Intents = []
 If you want to know more about if "fibonacci" in user_goal.lower():
       intents.append({"tool":"calc_fibonacci", "args":{"n":35}})
 If you want to know more about if "primes" in user_goal.lower():
       intents.append({"tool":"count_primes", "args":{"limit":100_000}})
 Intents = [
       {"tool":"simulate_tool", "args":{"name":"vector_db_search","payload":{"q":user_goal}}},
       {"tool":"simulate_tool", "args":{"name":"metrics_fetch","payload":{"kpi":"latency_ms"}}},
       {"tool":"extract_keywords", "args":{"text":user_goal}}
   ]
 Return intents

The plan function maps a user’s goal to a list of structured tool calls. It looks for key words in the goal text. “fibonacci” The following are some examples of how to use “primes” Check out the AI Agent’s execution blueprint. It includes default actions like simulated API requests, metrics retrieval and keyword extraction. Visit the FULL CODES here.

def run_agent(user_goal: str) -> Dict[str, Any]:
   tasks = plan(user_goal)
 Futures = []
 For t, see tasks
 If you t["tool"]=="calc_fibonacci": futures.append(calc_fibonacci(**t["args"]))
 The elif is a["tool"]=="count_primes": futures.append(count_primes(**t["args"]))
 Elif T["tool"]=="extract_keywords": futures.append(extract_keywords(**t["args"]))
 The elif is a["tool"]=="simulate_tool": futures.append(simulate_tool(**t["args"]))
   raw = [f.result() for f in futures]


 Bullets = []
 Raw:
 If r["task"]=="fibonacci":
           bullets.append(f"Fibonacci({r['n']}) = {r['value']} computed in {r['secs']}s.")
 The elif R["task"]=="count_primes":
           bullets.append(f"{r['count']} primes found ≤ {r['limit']}.")
 The elif RReturn["task"]=="keywords":
           bullets.append("Top keywords: " + ", ".join(r["keywords"]))
       else:
           bullets.append(f"Tool {r['task']} responded with status={r['status']}.")


   narrative = tiny_llm_summary(bullets)
   return {"goal": user_goal, "bullets": bullets, "summary": narrative, "raw": raw}

We execute the complete agent workflow in the run_agent command by generating an action plan using the user’s goals, before dispatching the tools as Parsl apps to be run simultaneously. After all futures have been completed, their results are converted into bullet points. These then go to the tiny_llm_summary to produce a short narrative. This function creates a dictionary that contains the goal of the tool, bullet points with detailed information, the LLM summary and raw outputs. You can check out the FULL CODES here.

If the __name__ equals "__main__":
 () = goal"Analyze fibonacci(35) performance, count primes under 100k, "
           "and prepare a concise executive summary highlighting insights for planning.")
   result = run_agent(goal)
   print("n=== Agent Bullets ===")
 The result of a is b["bullets"]: print("•", b)
   print("n=== LLM Summary ===n"The result["summary"])
   print("n=== Raw JSON ===n", json.dumps(result["raw"], indent=2)[:800], "...")

We create a simple goal in the main execution that includes numeric computations, prime counts, and summary creation. This goal is then run by the agent, which prints the generated bullets, displays the LLM-crafted summaries, and shows the JSON-raw output in order to check both human-readable results and structured ones.

The implementation demonstrates that Parsl’s app model, which orchestrates multiple workloads simultaneously, can be used to enable an AI agent, for example, to integrate numerical analysis, text-processing, and simulations of external services into a pipeline. We transform the structured output into natural language by integrating a LLM in the final step. This illustrates how AI and parallel computing can be used to build agents that are flexible, responsive, and able to handle large or real-time tasks.


Click here to find out more FULL CODES here. Check out our GitHub Page for Tutorials, Codes and Notebooks. Also, feel free to follow us on Twitter Don’t forget about our 100k+ ML SubReddit Subscribe Now our Newsletter.


Asif Razzaq, CEO of Marktechpost Media Inc. is a visionary engineer and entrepreneur who is dedicated to harnessing Artificial Intelligence’s potential for the social good. Marktechpost is his latest venture, a media platform that focuses on Artificial Intelligence. It is known for providing in-depth news coverage about machine learning, deep learning, and other topics. The content is technically accurate and easy to understand by an audience of all backgrounds. Over 2 million views per month are a testament to the platform’s popularity.

_ in scored w for w
Share. Facebook Twitter LinkedIn Email
Avatar
Gavin Wallace

Related Posts

OpenAI Ships GPT-Stay-1.1 for Voice Brokers, Cuts Idle Value to $0.02/Min

21/11/2026

Meet Pondering Machines Inkling 2 Mini: 26B Looped MoE Runs on a 32GB Mac

21/11/2026

Baseten Releases Bison-1 and Groundhog-1, Topping Choice Mannequin Index

21/11/2026

RadixArk Ships DaisyRose-27B, a 27B Agentic Coding Mannequin Skilled With Reinforcement Studying Solely

20/11/2026
Top News

Meta Accused of Torrenting Porn to Advance Its Goal of AI ‘Superintelligence’

Former top Google Researchers have made a new type of AI agent

AI’s Subsequent Trick? Talking Dolphin

Nvidia’s Deal With Meta signals a new era in computing power

The Humanoid Company, backed by Eric Trump, is preparing its robots for war

Load More
AI-Trends.Today

Your daily source of AI news and trends. Stay up to date with everything AI and automation!

X (Twitter) Instagram
Top Insights

OpenAI Child Exploitation reports increased sharply this year

22/12/2025

Tokenization is the process of converting text into tokens. How AI Turns Text Into Tokens – Unite.AI

13/09/2026
Latest News

Lean and Mathlib Communities Certify Claude-Assisted Riemann Proof – Unite.AI

21/11/2026

AWS Routes HyperPod Inference Throughout Areas From One Endpoint – Unite.AI

21/11/2026
X (Twitter) Instagram
  • Privacy Policy
  • Contact Us
  • Terms and Conditions
© 2026 AI-Trends.Today

Type above and press Enter to search. Press Esc to cancel.