<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: AskPaul</title>
    <description>The latest articles on Forem by AskPaul (@askpaul).</description>
    <link>https://forem.com/askpaul</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3531659%2Fc1ad14f5-969f-447b-866d-6cf979776d40.png</url>
      <title>Forem: AskPaul</title>
      <link>https://forem.com/askpaul</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/askpaul"/>
    <language>en</language>
    <item>
      <title>OSpark: The All-Round Free AI Assistant Powered by MiroMind’s Open-Source MiroFlow Framework</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Mon, 08 Dec 2025 11:47:04 +0000</pubDate>
      <link>https://forem.com/askpaul/ospark-the-all-round-free-ai-assistant-powered-by-mirominds-open-source-miroflow-framework-2ppc</link>
      <guid>https://forem.com/askpaul/ospark-the-all-round-free-ai-assistant-powered-by-mirominds-open-source-miroflow-framework-2ppc</guid>
      <description>&lt;p&gt;Today marks an exciting milestone in the world of accessible AI: the official launch of &lt;strong&gt;OSpark&lt;/strong&gt;—a free, all-in-one AI assistant designed to simplify work, creativity, and daily life. What makes this release even more noteworthy? OSpark is built on the backbone of &lt;strong&gt;MiroMind&lt;/strong&gt;’s open-source MiroFlow framework, leveraging the predictive and reasoning power of one of the world’s top AI research ecosystems to deliver a seamless, powerful user experience.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Why MiroMind’s MiroFlow Is the Engine Behind OSpark’s Excellence
&lt;/h2&gt;

&lt;p&gt;Before diving into OSpark’s features, it’s critical to highlight the role of MiroMind—the trailblazing AI project founded by visionary entrepreneur Tianqiao Chen and led by AI scientist Jifeng Dai. MiroMind has already made waves in the industry: it topped the global FutureX benchmark (a rigorous test for AI predictive capabilities) for two consecutive weeks, outperforming even closed-source commercial models by accurately forecasting complex scenarios like ATP tennis rankings and cryptocurrency price tiers.  &lt;/p&gt;

&lt;p&gt;At the core of MiroMind’s success is &lt;strong&gt;MiroFlow&lt;/strong&gt;—an open-source Agent framework built for tool-augmented reasoning, dynamic task scheduling, and long-haul research logic. MiroFlow isn’t just a “toolkit”; it’s a flexible, reproducible foundation that empowers developers to build AI agents that &lt;em&gt;think&lt;/em&gt;, &lt;em&gt;adapt&lt;/em&gt;, and &lt;em&gt;deliver results&lt;/em&gt;. On the GAIA validation set (a leading benchmark for deep research AI), MiroFlow achieved an impressive 82.4 score—surpassing many commercial APIs and setting a high bar for open-source AI performance.  &lt;/p&gt;

&lt;p&gt;For OSpark, MiroFlow’s capabilities are transformative. It’s not just about “adding AI”—it’s about integrating a framework that ensures OSpark’s features (from smart searches to real-time weather insights) are &lt;em&gt;accurate&lt;/em&gt;, &lt;em&gt;responsive&lt;/em&gt;, and &lt;em&gt;contextually relevant&lt;/em&gt;. MiroFlow’s ability to support multi-tool integration and extend any large language model (LLM) means OSpark can seamlessly tap into top-tier AI power (like ChatGPT, GPT-5, and Gemini 2.5 Flash) while remaining lightweight and user-friendly.  &lt;/p&gt;

&lt;h2&gt;
  
  
  OSpark: What You Can Do with MiroMind-Powered AI
&lt;/h2&gt;

&lt;p&gt;OSpark takes MiroFlow’s technical strength and packages it into a tool that anyone can use—no coding or AI expertise required. Let’s break down its standout features, all supercharged by MiroMind’s underlying framework:  &lt;/p&gt;

&lt;h3&gt;
  
  
  1. All-in-One AI Assistant: Smart, Efficient, and Intuitive
&lt;/h3&gt;

&lt;p&gt;Thanks to MiroFlow’s reasoning engine, OSpark turns chaotic information into clear answers. Whether you’re searching the web, summarizing long PDFs, or analyzing images, OSpark cuts through the noise:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Web/Doc Summarization&lt;/strong&gt;: Condenses hours of reading into key takeaways (rivaling tools like Monica for speed and accuracy).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image Recognition&lt;/strong&gt;: Matches the precision of OpenAI’s GPT-5 Image and Google’s Gemini 2.5 Flash Image, letting you ask questions about photos or identify details in seconds.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart Search&lt;/strong&gt;: Goes beyond basic results to deliver context-rich answers—perfect for work, study, or satisfying daily curiosity.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Real-Time Weather Guides: Predictive Insights for Your Day
&lt;/h3&gt;

&lt;p&gt;MiroMind’s predictive DNA shines here. OSpark doesn’t just show you the temperature—it uses MiroFlow’s ability to process live meteorological data and generate tailored advice:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get global weather updates in real time (e.g., 66°F and sunny in San Francisco, with 67% humidity).
&lt;/li&gt;
&lt;li&gt;Receive AI-driven tips: “Dress light, wear sunscreen, and take shade breaks—humidity will make 81°F feel warmer!”
&lt;/li&gt;
&lt;li&gt;Plan ahead with 6-day forecasts, all backed by MiroFlow’s reliable data integration and analysis.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. AI-Driven Image Generator: Turn Ideas into Visuals
&lt;/h3&gt;

&lt;p&gt;MiroFlow’s support for multi-modal AI lets OSpark’s image generator create stunning visuals in any style—from 3D Anime to Realism. Just describe what you want (e.g., “a surreal mini chef cooking inside an opened delivery box”), choose an aspect ratio (like 9:16 for social media), and hit “Generate.” No design skills needed—just your imagination, amplified by MiroMind’s creative AI power.  &lt;/p&gt;

&lt;h3&gt;
  
  
  4. AI-Powered Podcast Creation: Turn Content into On-the-Go Audio
&lt;/h3&gt;

&lt;p&gt;OSpark’s podcast tool leverages MiroFlow’s automation capabilities to convert URLs, YouTube videos, or long texts into polished audio in seconds. Here’s how it works:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste a link (e.g., a blog post or YouTube tutorial) or text.
&lt;/li&gt;
&lt;li&gt;Choose your language (English by default) and style (e.g., Single Narrator).
&lt;/li&gt;
&lt;li&gt;Let MiroFlow handle the rest—turning your favorite content into a podcast you can listen to during commutes or workouts.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Top-Tier LLMs: Unlimited Access, Totally Free
&lt;/h3&gt;

&lt;p&gt;The best part? OSpark gives you unrestricted access to popular LLMs (ChatGPT, GPT-5, Gemini 3 Pro) at no cost. MiroFlow’s framework ensures these models run seamlessly, so you can chat, create, or problem-solve without subscriptions or hidden fees. It’s like having a premium AI toolkit—for free.  &lt;/p&gt;

&lt;h2&gt;
  
  
  See OSpark in Action
&lt;/h2&gt;

&lt;p&gt;Curious what OSpark looks like? Check out these product screenshots to visualize its clean, user-friendly interface:  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flou2vqstqflrvdl5xg9k.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flou2vqstqflrvdl5xg9k.jpg" alt="Image description" width="800" height="1730"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2yoqlva9rn6l6fm8vmp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2yoqlva9rn6l6fm8vmp.jpg" alt="Image description" width="800" height="1730"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyy1nlqid5f18dqw5faun.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyy1nlqid5f18dqw5faun.jpg" alt="Image description" width="800" height="1730"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4mi9pnpopuo1bimha4o2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4mi9pnpopuo1bimha4o2.jpg" alt="Image description" width="800" height="1730"&gt;&lt;/a&gt;&lt;br&gt;
  &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqjhdo295ljvmh13w519.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqjhdo295ljvmh13w519.jpg" alt="Image description" width="800" height="1730"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get OSpark Today—Powered by MiroMind’s Open-Source Innovation
&lt;/h2&gt;

&lt;p&gt;OSpark isn’t just another AI app—it’s a testament to what happens when cutting-edge open-source technology (MiroMind’s MiroFlow) meets user-centric design. Whether you’re a student, professional, or creative, OSpark simplifies how you interact with AI—making powerful tools accessible to everyone.  &lt;/p&gt;

&lt;p&gt;Ready to experience MiroMind-powered AI for free? Download OSpark now:&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://ospark.ai/" rel="noopener noreferrer"&gt;Download OSpark&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;With OSpark and MiroMind, the future of AI isn’t just advanced—it’s &lt;em&gt;usable&lt;/em&gt;, &lt;em&gt;affordable&lt;/em&gt;, and &lt;em&gt;built for you&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>miromind</category>
      <category>ospark</category>
    </item>
    <item>
      <title>MiroThinker v1.0: Revolutionizing Open-Source Research Agents Through Interactive Scaling</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Wed, 19 Nov 2025 10:19:16 +0000</pubDate>
      <link>https://forem.com/askpaul/mirothinker-v10-revolutionizing-open-source-research-agents-through-interactive-scaling-1c79</link>
      <guid>https://forem.com/askpaul/mirothinker-v10-revolutionizing-open-source-research-agents-through-interactive-scaling-1c79</guid>
      <description>&lt;p&gt;&lt;em&gt;Breaking New Ground in AI Research Capabilities with Up to 600 Tool Calls Per Task&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Published by MiroMind Team | November 2024&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction: The Dawn of Autonomous Research Intelligence
&lt;/h2&gt;

&lt;p&gt;The landscape of artificial intelligence is witnessing a profound transformation. We're moving beyond static text generation toward dynamic, tool-augmented agents capable of conducting sophisticated research autonomously. The ability to formulate hypotheses, retrieve and verify evidence, and synthesize insights across diverse information sources represents a new frontier in AI capability—one that demands more than just linguistic fluency.&lt;/p&gt;

&lt;p&gt;Proprietary systems like ChatGPT Agent and Claude Research have demonstrated near-human proficiency in literature review, comparative analysis, and reasoning-driven knowledge discovery. However, these systems remain closed, constraining transparency, reproducibility, and community-driven innovation. The open-source community has struggled to match their performance, facing limitations in model scale, context length, and interaction depth.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"MiroThinker v1.0 introduces a third dimension of scaling—interactive scaling—that enables sustained multi-turn reasoning through up to 600 tool calls per task within a 256K context window."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Enter MiroThinker v1.0, a groundbreaking open-source research agent that fundamentally reimagines how we approach AI research capabilities. Unlike previous approaches that focused solely on scaling model size or context length, MiroThinker explores &lt;strong&gt;interaction scaling&lt;/strong&gt; as a third critical dimension of performance improvement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Innovation: The Three Dimensions of Agent Scaling
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0 represents a paradigm shift by systematically addressing three complementary scaling dimensions:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Model Size Scaling
&lt;/h3&gt;

&lt;p&gt;Built on the robust Qwen2.5 and Qwen3 foundations, MiroThinker is available in three variants to accommodate diverse computational budgets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;8B variant:&lt;/strong&gt; Optimized for efficiency while maintaining strong performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;30B variant:&lt;/strong&gt; Balanced performance-to-compute ratio for most applications&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;72B variant:&lt;/strong&gt; State-of-the-art performance approaching commercial systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Context Length Scaling
&lt;/h3&gt;

&lt;p&gt;With a 256K context window, MiroThinker can maintain extensive conversation histories, complex reasoning chains, and comprehensive tool interaction records. This extended context enables the model to synthesize information across multiple documents and maintain coherent long-horizon planning.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Interactive Scaling (The Breakthrough)
&lt;/h3&gt;

&lt;p&gt;The most revolutionary aspect of MiroThinker is its systematic training for deeper and more frequent agent-environment interactions. Unlike traditional LLM test-time scaling that operates in isolation and risks degradation with longer reasoning chains, interactive scaling leverages environment feedback and external information acquisition to correct errors and refine trajectories.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Performance Breakthrough:&lt;/strong&gt; MiroThinker-72B achieves up to 81.9% on GAIA, 37.7% on Humanity's Last Exam, 47.1% on BrowseComp, and 55.6% on BrowseComp-ZH, surpassing previous open-source agents and approaching GPT-5-high performance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Technical Deep Dive
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ReAct Workflow Architecture
&lt;/h3&gt;

&lt;p&gt;MiroThinker operates under the ReAct (Reasoning and Acting) paradigm, implementing a sophisticated iterative loop of reasoning, tool invocation, and observation. The model maintains a trajectory history and alternates between generating internal thoughts and executing structured tool calls until task completion.&lt;/p&gt;

&lt;p&gt;The core workflow follows this pattern:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Think:&lt;/strong&gt; Generate internal reasoning about the current state and next action&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Act:&lt;/strong&gt; Execute a structured tool invocation based on the reasoning&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observe:&lt;/strong&gt; Process the tool response and update internal understanding&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeat:&lt;/strong&gt; Continue until the task is resolved or termination criteria are met&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Comprehensive Tool Interface
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Execution Environment
&lt;/h4&gt;

&lt;p&gt;MiroThinker employs a Linux sandbox that provides isolated runtime for command and code execution. The agent can create sandbox instances and execute both shell commands and Python code within secure, controlled environments. This design ensures safe interaction with system-level resources while maintaining flexibility.&lt;/p&gt;

&lt;h4&gt;
  
  
  File Management
&lt;/h4&gt;

&lt;p&gt;The system implements bidirectional file transfer capabilities, supporting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upload from local systems to sandbox environments&lt;/li&gt;
&lt;li&gt;Download from sandbox to local storage&lt;/li&gt;
&lt;li&gt;Direct retrieval of remote assets from URLs&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Information Retrieval
&lt;/h4&gt;

&lt;p&gt;Two sophisticated retrieval tools power MiroThinker's research capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google Search Integration:&lt;/strong&gt; Returns structured search results for broad information gathering&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intelligent Web Scraping:&lt;/strong&gt; Uses a lightweight LLM (Qwen3-14B) to extract task-relevant information from target URLs, serving as an efficient context management mechanism&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advanced Context Management
&lt;/h3&gt;

&lt;p&gt;To maximize the efficiency of the 256K context window and enable up to 600 tool calls per task, MiroThinker implements two key strategies:&lt;/p&gt;

&lt;h4&gt;
  
  
  Recency-Based Context Retention
&lt;/h4&gt;

&lt;p&gt;Rather than retaining all tool outputs (which would quickly overwhelm the context), the system preserves only the most recent tool responses while maintaining the complete sequence of thoughts and actions. This approach leverages the empirical observation that subsequent actions depend primarily on recent observations rather than distant ones.&lt;/p&gt;

&lt;h4&gt;
  
  
  Result Truncation
&lt;/h4&gt;

&lt;p&gt;Long outputs from code execution and command tools are automatically truncated with clear indicators, preventing context overflow while preserving essential information.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The recency-based retention strategy preserves reasoning traces while focusing attention on contextually relevant observations, freeing additional context for extended reasoning and deeper tool-use trajectories."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Data Construction: Building the MiroVerse Dataset
&lt;/h3&gt;

&lt;h4&gt;
  
  
  MultiDocQA Synthesis
&lt;/h4&gt;

&lt;p&gt;The team developed an sophisticated pipeline that transforms interlinked web documents into complex, multi-hop QA pairs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Document Corpus Construction:&lt;/strong&gt; Diverse sources including Wikipedia and Common Crawl with preserved hyperlink structures&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge Graph Creation:&lt;/strong&gt; Connected subgraphs of related documents following internal hyperlinks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fact Extraction:&lt;/strong&gt; Key statements requiring cross-document reasoning&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constraint Obfuscation:&lt;/strong&gt; Systematic transformation of facts into indirect constraints requiring deeper reasoning&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Agentic Trajectory Synthesis
&lt;/h4&gt;

&lt;p&gt;High-quality trajectory data generation through multiple complementary approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agent Paradigms:&lt;/strong&gt; Both ReAct single-agent and MiroFlow multi-agent frameworks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Invocation Methods:&lt;/strong&gt; Traditional function calling and flexible Model Context Protocol (MCP)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diverse Model Integration:&lt;/strong&gt; Multiple leading LLMs including GPT-OSS and DeepSeek-V3.1&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Three-Stage Training Pipeline
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Stage 1: Agentic Supervised Fine-Tuning (SFT)
&lt;/h4&gt;

&lt;p&gt;The foundation stage establishes fundamental agentic behaviors through imitation learning on expert trajectories. The model learns to mimic complex multi-hop reasoning and tool use patterns, with rigorous filtering to ensure trajectory quality and consistency.&lt;/p&gt;

&lt;h4&gt;
  
  
  Stage 2: Agentic Preference Optimization (DPO)
&lt;/h4&gt;

&lt;p&gt;Direct Preference Optimization refines decision-making by learning from preference pairs. Crucially, the team avoided rigid structural constraints, instead focusing on answer correctness as the primary ranking criterion to prevent systematic biases.&lt;/p&gt;

&lt;h4&gt;
  
  
  Stage 3: Agentic Reinforcement Learning (GRPO)
&lt;/h4&gt;

&lt;p&gt;The final stage employs Group Relative Policy Optimization with fully online policy training. This enables creative solution discovery and adaptation to diverse real-world environments through direct interaction and exploration. The system supports thousands of concurrent agentic rollouts with sophisticated reward design balancing correctness and format compliance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benchmark Results: Setting New Standards
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0 demonstrates exceptional performance across multiple challenging benchmarks, establishing new state-of-the-art results for open-source research agents:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Standout Achievements:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GAIA Benchmark:&lt;/strong&gt; 81.9% accuracy, surpassing MiniMax-M2 by 6.2 percentage points&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Humanity's Last Exam:&lt;/strong&gt; 37.7% score, outperforming GPT-5-high by 2.5 points&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BrowseComp:&lt;/strong&gt; 47.1% accuracy, competitive with OpenAI DeepResearch&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BrowseComp-ZH:&lt;/strong&gt; 55.6% accuracy, setting new open-source records for Chinese benchmarks&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;The results demonstrate that MiroThinker not only leads among open-source alternatives but approaches and sometimes exceeds the performance of leading commercial systems while maintaining complete transparency and reproducibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interactive Scaling: The Game-Changing Discovery
&lt;/h2&gt;

&lt;p&gt;Perhaps the most significant finding from the MiroThinker research is the empirical validation of interactive scaling as a fundamental dimension of agent performance improvement. The analysis reveals that research performance improves predictably as the model engages in deeper and more frequent agent-environment interactions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Interactive scaling exhibits behaviors analogous to model size and context length scaling, establishing it as a third critical dimension for building next-generation research agents."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Key insights from the interactive scaling analysis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistent Improvement:&lt;/strong&gt; Performance gains scale predictably with interaction depth across all benchmarks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Correction:&lt;/strong&gt; Environment feedback enables trajectory refinement and error correction&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creative Exploration:&lt;/strong&gt; Reinforcement learning drives discovery of novel solution paths&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sustained Reasoning:&lt;/strong&gt; Extended interaction sequences maintain coherence and progress toward goals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reinforcement learning-trained models exhibit substantially longer and deeper interaction trajectories compared to their supervised fine-tuning counterparts, with corresponding improvements in task performance. This demonstrates that the capacity for extended, meaningful interaction with environments is not just beneficial but essential for advanced research capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implications for the Future of AI Research
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0 represents more than just another capable AI model—it establishes a new framework for thinking about agent capabilities and scaling laws. The discovery that interactive scaling constitutes a third fundamental dimension alongside model size and context length has profound implications for future research directions.&lt;/p&gt;

&lt;p&gt;This breakthrough suggests that the path to human-level research capability may not require only larger models or longer contexts, but fundamentally different training approaches that emphasize iterative interaction with environments. The open-source nature of MiroThinker ensures that these advances can be studied, reproduced, and built upon by the entire research community.&lt;/p&gt;

&lt;p&gt;The model's ability to perform sustained multi-turn reasoning through hundreds of tool calls opens new possibilities for autonomous research workflows, from literature review and hypothesis generation to experimental design and result analysis. As these capabilities mature, we may witness the emergence of AI systems that can genuinely contribute to scientific discovery and knowledge advancement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0 establishes a new paradigm for open-source research agents, demonstrating that it's possible to match and sometimes exceed the performance of proprietary systems while maintaining transparency and community accessibility. The introduction of interactive scaling as a third fundamental dimension of agent capability represents a conceptual breakthrough that will likely influence the direction of AI research for years to come.&lt;/p&gt;

&lt;p&gt;By systematically addressing model size, context length, and interaction depth, MiroThinker proves that the gap between open-source and commercial AI capabilities can be closed through thoughtful engineering and innovative training approaches. The model's exceptional performance across diverse benchmarks, combined with its comprehensive tool suite and sophisticated context management, positions it as a valuable resource for researchers, developers, and organizations seeking advanced AI research capabilities.&lt;/p&gt;




&lt;h2&gt;
  
  
  Access MiroThinker v1.0
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Online Demo:&lt;/strong&gt; &lt;a href="https://dr.miromind.ai" rel="noopener noreferrer"&gt;https://dr.miromind.ai&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Repository:&lt;/strong&gt; &lt;a href="https://github.com/MiroMindAI/MiroThinker" rel="noopener noreferrer"&gt;https://github.com/MiroMindAI/MiroThinker&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model Weights:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;72B: &lt;a href="https://huggingface.co/miromind-ai/MiroThinker-v1.0-72B" rel="noopener noreferrer"&gt;huggingface.co/miromind-ai/MiroThinker-v1.0-72B&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;30B: &lt;a href="https://huggingface.co/miromind-ai/MiroThinker-v1.0-30B" rel="noopener noreferrer"&gt;huggingface.co/miromind-ai/MiroThinker-v1.0-30B&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;8B: &lt;a href="https://huggingface.co/miromind-ai/MiroThinker-v1.0-8B" rel="noopener noreferrer"&gt;huggingface.co/miromind-ai/MiroThinker-v1.0-8B&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Dataset:&lt;/strong&gt; &lt;a href="https://huggingface.co/datasets/miromind-ai/MiroVerse-v0.1" rel="noopener noreferrer"&gt;MiroVerse v0.1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Paper:&lt;/strong&gt; &lt;a href="https://arxiv.org/abs/2511.11793" rel="noopener noreferrer"&gt;arXiv:2511.11793&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>miromind</category>
      <category>mirothinker</category>
      <category>askpaul</category>
    </item>
    <item>
      <title>🚀 MiroThinker v1.0 Launched: Pioneering a New Era of Interactive Scaling in AI Agents</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Mon, 17 Nov 2025 08:41:04 +0000</pubDate>
      <link>https://forem.com/askpaul/mirothinker-v10-launched-pioneering-a-new-era-of-interactive-scaling-in-ai-agents-4n60</link>
      <guid>https://forem.com/askpaul/mirothinker-v10-launched-pioneering-a-new-era-of-interactive-scaling-in-ai-agents-4n60</guid>
      <description>&lt;p&gt;&lt;strong&gt;November 13, 2025&lt;/strong&gt; marks an exciting milestone in AI research—the MiroMind AI team officially released &lt;strong&gt;MiroThinker v1.0&lt;/strong&gt;, an open-source research agent. This isn't just another large language model release; it represents a groundbreaking new approach to enhancing AI agent capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Revolutionary Innovation: The Third Dimension of Scaling
&lt;/h2&gt;

&lt;p&gt;Throughout AI's evolution, we've witnessed two primary dimensions of performance improvement: &lt;strong&gt;model parameter scale&lt;/strong&gt; and &lt;strong&gt;context window length&lt;/strong&gt;. MiroThinker v1.0 boldly introduces a &lt;strong&gt;third dimension—Interactive Scaling&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Interactive Scaling?
&lt;/h3&gt;

&lt;p&gt;Interactive scaling is a systematic training methodology that teaches models to engage in deeper and more frequent interactions with their environment. Through environment feedback and external information acquisition, models can proactively correct errors and refine reasoning trajectories, significantly boosting task completion capabilities.&lt;/p&gt;

&lt;p&gt;Think of it like training a researcher. It's not simply about having them memorize more knowledge (parameter scale) or read longer documents at once (context length), but rather &lt;strong&gt;teaching them how to efficiently use tools, search for information, verify facts, and continuously adjust their research strategy during exploration&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsspark.genspark.ai%2Fcfimages%3Fu1%3DpxXbUF0gkogyyr%252FZQUADNW8uFJ6luAGGjbGcXLqOV3eURbYpisIU4y7dpzgQYoTZx8gjz3D1uawlRVFutF2IZVFbeZ9UfHKzcyMhyjgav7maQN%252Burqf4jW%252FyENzjFdq0gexS1io%252FWYPxWKwkEtVIrf3eR4XGubfZ%26u2%3DvjgN5fG5NQbXrFsX%26width%3D1024" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsspark.genspark.ai%2Fcfimages%3Fu1%3DpxXbUF0gkogyyr%252FZQUADNW8uFJ6luAGGjbGcXLqOV3eURbYpisIU4y7dpzgQYoTZx8gjz3D1uawlRVFutF2IZVFbeZ9UfHKzcyMhyjgav7maQN%252Burqf4jW%252FyENzjFdq0gexS1io%252FWYPxWKwkEtVIrf3eR4XGubfZ%26u2%3DvjgN5fG5NQbXrFsX%26width%3D1024" alt="Interactive Scaling Visualization" width="1024" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The experimental data is compelling: &lt;strong&gt;RL-tuned MiroThinker v1.0-30B exhibits far longer and deeper interaction trajectories than its SFT counterpart&lt;/strong&gt;. Across all four major benchmarks, while supervised fine-tuning models terminate after just a few tool calls, the RL model performs extended multi-turn reasoning, exploration, and information verification. This behavioral shift yields &lt;strong&gt;8-10 percentage point accuracy gains&lt;/strong&gt;, clearly demonstrating the positive correlation between interaction depth and performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  💪 Impressive Technical Specifications
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0 showcases remarkable technical capabilities:&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Parameters
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context Window&lt;/strong&gt;: 256K tokens (supporting ultra-long document processing and deep analysis)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Call Capability&lt;/strong&gt;: Up to &lt;strong&gt;600 tool calls per task&lt;/strong&gt;—a substantial breakthrough among open-source research agents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Scale Release&lt;/strong&gt;: Available in 8B, 30B, and 72B parameter versions to accommodate different computational budgets and application scenarios&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model Name&lt;/th&gt;
&lt;th&gt;Base Model&lt;/th&gt;
&lt;th&gt;Max Length&lt;/th&gt;
&lt;th&gt;Max Tool Calls&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MiroThinker-v1.0-8B&lt;/td&gt;
&lt;td&gt;Qwen3-8B&lt;/td&gt;
&lt;td&gt;256K&lt;/td&gt;
&lt;td&gt;600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MiroThinker-v1.0-30B&lt;/td&gt;
&lt;td&gt;Qwen3-30B-A3B-Thinking-2507&lt;/td&gt;
&lt;td&gt;256K&lt;/td&gt;
&lt;td&gt;600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MiroThinker-v1.0-72B&lt;/td&gt;
&lt;td&gt;Qwen2.5-72B-Instruct&lt;/td&gt;
&lt;td&gt;256K&lt;/td&gt;
&lt;td&gt;600&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Why are 600 Tool Calls Important?
&lt;/h3&gt;

&lt;p&gt;For complex research tasks, agents need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search multiple information sources&lt;/li&gt;
&lt;li&gt;Cross-verify data accuracy&lt;/li&gt;
&lt;li&gt;Deep-dive into relevant literature&lt;/li&gt;
&lt;li&gt;Synthesize analysis and draw conclusions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Support for 600 tool calls&lt;/strong&gt; enables MiroThinker to conduct deep, multi-step information exploration and verification like a genuine researcher, without interruption due to call limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 Outstanding Benchmark Performance
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0 demonstrates strong performance across multiple authoritative benchmarks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HLE-Text&lt;/strong&gt; (Humanity's Last Exam - Text): &lt;strong&gt;37.7%&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BrowseComp&lt;/strong&gt;: &lt;strong&gt;47.1%&lt;/strong&gt; (approaching DeepResearch's 51.5%)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BrowseComp-ZH&lt;/strong&gt; (Chinese Browse Comprehension): &lt;strong&gt;55.6%&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GAIA-Text-103&lt;/strong&gt;: &lt;strong&gt;81.9%&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These results not only surpass previous open-source agents but, more importantly, &lt;strong&gt;significantly narrow the gap with commercial models like GPT-5-high&lt;/strong&gt;. Notably, on the HLE-Text benchmark, MiroThinker even outperforms GPT-5-high by &lt;strong&gt;2.5 percentage points&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsspark.genspark.ai%2Fcfimages%3Fu1%3DQLMRijC2Yo3cgMsxX%252BFZHJO7AAv%252BxwiFDpfIzUU858vRrEhfjBPGj0R9lJ%252BebGQsWUdDHXY1EXME%252F8ZnE9KnZ7jSsn5HwYOt6eSAkKxJHOImTsbKHD5gEtHO%252BHlRAFzFI00v9W0mfZFOQl8Ct4QvrsdNSL8WSRmaoS%252Fe0m9wPGoCKDmBzRM%253D%26u2%3Dq3IsMuCPjEqsNqhv%26width%3D1024" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsspark.genspark.ai%2Fcfimages%3Fu1%3DQLMRijC2Yo3cgMsxX%252BFZHJO7AAv%252BxwiFDpfIzUU858vRrEhfjBPGj0R9lJ%252BebGQsWUdDHXY1EXME%252F8ZnE9KnZ7jSsn5HwYOt6eSAkKxJHOImTsbKHD5gEtHO%252BHlRAFzFI00v9W0mfZFOQl8Ct4QvrsdNSL8WSRmaoS%252Fe0m9wPGoCKDmBzRM%253D%26u2%3Dq3IsMuCPjEqsNqhv%26width%3D1024" alt="Performance Comparison" width="1024" height="586"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Real-World Application Scenarios
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0's capabilities make it ideal for numerous use cases:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Academic Research Assistant
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In-depth literature reviews and information synthesis&lt;/li&gt;
&lt;li&gt;Cross-disciplinary knowledge correlation analysis&lt;/li&gt;
&lt;li&gt;Research hypothesis verification and data collection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Business Intelligence Analysis
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Market trend research and competitive analysis&lt;/li&gt;
&lt;li&gt;Multi-source information cross-verification&lt;/li&gt;
&lt;li&gt;Strategic decision support&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Technical Problem Solving
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Complex technical documentation comprehension&lt;/li&gt;
&lt;li&gt;Multi-step problem diagnosis&lt;/li&gt;
&lt;li&gt;Solution exploration and evaluation&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Content Creation Research
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Deep background investigation&lt;/li&gt;
&lt;li&gt;Fact-checking and citation verification&lt;/li&gt;
&lt;li&gt;Multi-perspective information integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🌟 The Power of Open Source
&lt;/h2&gt;

&lt;p&gt;MiroThinker v1.0 is released under the &lt;strong&gt;MIT License&lt;/strong&gt;, which means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Completely Free to Use&lt;/strong&gt;: For both commercial and non-commercial projects&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Full Code Access&lt;/strong&gt;: Learn, modify, and customize as needed&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Community-Driven Development&lt;/strong&gt;: Contributions and collaboration welcome&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Transparent and Trustworthy&lt;/strong&gt;: All technical details publicly available&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This open approach not only democratizes AI technology but also provides invaluable learning and innovation opportunities for the research community.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Quick Start
&lt;/h2&gt;

&lt;p&gt;Want to experience MiroThinker v1.0's powerful capabilities? Multiple options available:&lt;/p&gt;

&lt;h3&gt;
  
  
  Online Demo
&lt;/h3&gt;

&lt;p&gt;Visit the official demo site: &lt;a href="https://dr.miromind.ai/" rel="noopener noreferrer"&gt;https://dr.miromind.ai/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Deployment
&lt;/h3&gt;

&lt;p&gt;Access the GitHub repository for complete installation instructions:&lt;br&gt;
👉 &lt;a href="https://github.com/MiroMindAI/MiroThinker" rel="noopener noreferrer"&gt;https://github.com/MiroMindAI/MiroThinker&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Hugging Face Models
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/miromind-ai/MiroThinker-v1.0-8B" rel="noopener noreferrer"&gt;MiroThinker-v1.0-8B&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/miromind-ai/MiroThinker-v1.0-30B" rel="noopener noreferrer"&gt;MiroThinker-v1.0-30B&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/miromind-ai/MiroThinker-v1.0-72B" rel="noopener noreferrer"&gt;MiroThinker-v1.0-72B&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔮 Looking Ahead
&lt;/h2&gt;

&lt;p&gt;The release of MiroThinker v1.0 marks an important milestone in AI agent development. The introduction of interactive scaling as a third dimension of performance improvement points us toward more general and intelligent AI systems.&lt;/p&gt;

&lt;p&gt;With the synergistic optimization of model scale, context length, and interaction depth, we have every reason to believe that &lt;strong&gt;future AI agents will handle increasingly complex, open-ended tasks, truly becoming powerful assistants in human research and creation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The MiroMind AI team commits to continued R&amp;amp;D investment, continuously improving the MiroThinker series, and looks forward to collaborating with developers and researchers worldwide to advance this technology.&lt;/p&gt;

&lt;h2&gt;
  
  
  📞 Contact Information
&lt;/h2&gt;

&lt;p&gt;If you have any questions or suggestions about MiroThinker v1.0, feel free to contact the MiroMind AI team through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📧 Email: &lt;a href="mailto:service@miromind.ai"&gt;service@miromind.ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💬 GitHub: &lt;a href="https://github.com/MiroMindAI/" rel="noopener noreferrer"&gt;https://github.com/MiroMindAI/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🎮 Discord: &lt;a href="https://discord.com/invite/GPqEnkzQZd" rel="noopener noreferrer"&gt;Join the Community&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📱 WeChat: Search for MiroMind official account&lt;/li&gt;
&lt;li&gt;📝 RedNote: Follow MiroMind&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Reference Resources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/MiroMindAI/MiroThinker" rel="noopener noreferrer"&gt;MiroThinker GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/MiroMindAI/MiroThinker/blob/main/assets/MiroThinker_v1.0_Technical_Report.pdf" rel="noopener noreferrer"&gt;Technical Report PDF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/miromind-ai/MiroThinker-v1.0-72B" rel="noopener noreferrer"&gt;Hugging Face Model Page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This is not just a model release—it's a pivotal step in the evolution of AI agents. Let's witness together how interactive scaling redefines the future of AI!&lt;/em&gt; 🎉&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a Multi-Client Subscription Streaming Response System with MiroMind‘s MiroFlow</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Tue, 11 Nov 2025 12:26:41 +0000</pubDate>
      <link>https://forem.com/askpaul/building-a-multi-client-subscription-streaming-response-system-with-mirominds-miroflow-59jc</link>
      <guid>https://forem.com/askpaul/building-a-multi-client-subscription-streaming-response-system-with-mirominds-miroflow-59jc</guid>
      <description>&lt;p&gt;In the development of OSpark, a universal Agent product powered by MiroMind's open-source project MiroFlow, we encountered a critical challenge: enabling real-time, synchronized streaming responses across multiple clients while optimizing resource utilization. This article dives into the design and implementation of OSparkApi's multi-client subscription-based streaming response system, leveraging MiroFlow's flexible architecture to address the limitations of traditional single-client Server-Sent Events (SSE) solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Server-Sent Events (SSE) have become the backbone of real-time interaction in modern AI chat applications, enabling servers to push incremental updates to clients without constant polling. However, traditional SSE architectures face significant bottlenecks in two key scenarios:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-client synchronization&lt;/strong&gt;: When users access the same conversation across multiple endpoints (e.g., browser tabs, mobile apps, web interfaces), each client typically initiates a separate SSE connection, leading to redundant AI inference tasks and wasted computational resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Disconnection recovery&lt;/strong&gt;: If a user exits a conversation page while an AI task is still running, re-entering the page should resume real-time updates seamlessly—without restarting the task or losing intermediate state.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To solve these pain points, we designed a streaming response system that supports multi-client subscription, task sharing, and reliable reconnection—all built on the foundation of MiroMind's MiroFlow framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Challenges
&lt;/h2&gt;

&lt;p&gt;The design of a multi-client streaming system must address four critical requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resource reuse&lt;/strong&gt;: Eliminate redundant AI inference by allowing multiple clients to share a single running task.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Event broadcasting&lt;/strong&gt;: Ensure consistent, real-time updates across all subscribed clients for the same conversation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Connection management&lt;/strong&gt;: Gracefully handle client disconnections, reconnections, and cleanups without disrupting ongoing tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Task lifecycle management&lt;/strong&gt;: Properly create, run, cancel, and clean up tasks while accounting for subscription states.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Architecture Design
&lt;/h2&gt;

&lt;p&gt;The system is composed of two core components—&lt;code&gt;TaskManager&lt;/code&gt; and &lt;code&gt;StreamHandler&lt;/code&gt;—working in tandem to manage tasks, subscriptions, and event distribution. This architecture decouples task execution from client communication, enabling flexible scaling and robust synchronization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Components
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. TaskManager (Task Orchestrator)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;TaskManager&lt;/code&gt; serves as the central hub for managing asynchronous tasks and their subscribers. Its key responsibilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Task registry&lt;/strong&gt;: Maintaining a mapping of &lt;code&gt;thread_id&lt;/code&gt; (conversation identifier) to active AI tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Subscriber set management&lt;/strong&gt;: For each &lt;code&gt;thread_id&lt;/code&gt;, tracking a collection of subscriber queues (one per client connection).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Event broadcasting&lt;/strong&gt;: Pushing task-generated events to all subscribed client queues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Thread safety&lt;/strong&gt;: Using &lt;code&gt;asyncio.Lock&lt;/code&gt; to ensure safe concurrent access to shared data structures.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Core data structures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Task registry: &lt;code&gt;Dict[str, asyncio.Task]&lt;/code&gt; (maps &lt;code&gt;thread_id&lt;/code&gt; to running tasks)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Subscriber collection: &lt;code&gt;Dict[str, Set[asyncio.Queue]]&lt;/code&gt; (maps &lt;code&gt;thread_id&lt;/code&gt; to subscriber queues)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. StreamHandler (Connection &amp;amp; Subscription Manager)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;StreamHandler&lt;/code&gt; handles client connections, subscription logic, and event streaming. Its key functionalities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Task existence check&lt;/strong&gt;: Verifying if a task for a given &lt;code&gt;thread_id&lt;/code&gt; is already running.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Subscription mechanism&lt;/strong&gt;: Allowing new clients to subscribe to existing tasks or initiate new tasks if none exist.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Event serialization &amp;amp; distribution&lt;/strong&gt;: Converting task events to SSE-compatible format and streaming them to subscribed clients.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Workflows
&lt;/h3&gt;

&lt;p&gt;The system’s behavior adapts to three primary user scenarios, ensuring seamless multi-client interaction and recovery.&lt;/p&gt;

&lt;h4&gt;
  
  
  Scenario 1: First Client Initiates a Request
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A client sends a chat request (without an existing &lt;code&gt;thread_id&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;StreamHandler&lt;/code&gt; checks with &lt;code&gt;TaskManager&lt;/code&gt; and confirms no active task exists for the new conversation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A new background task is created to execute AI inference (powered by MiroFlow’s asynchronous processing capabilities).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The background task generates events (e.g., partial chat responses, status updates) and pushes them to an event queue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;StreamHandler&lt;/code&gt; streams events from the queue to the client in SSE format.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the first event is generated, the &lt;code&gt;thread_id&lt;/code&gt; is dynamically extracted and registered in &lt;code&gt;TaskManager&lt;/code&gt; alongside the running task.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Scenario 2: Subsequent Clients Subscribe to the Same Task
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A client sends a request with an existing &lt;code&gt;thread_id&lt;/code&gt; (e.g., from a second browser tab or mobile device).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;StreamHandler&lt;/code&gt; queries &lt;code&gt;TaskManager&lt;/code&gt; and detects an active task for the &lt;code&gt;thread_id&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The client subscribes to the existing stream via &lt;code&gt;TaskManager.subscribe_to_stream(thread_id)&lt;/code&gt;, which creates a new dedicated queue for the client.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All subsequent events from the task are broadcast to the new queue (alongside existing subscriber queues).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;StreamHandler&lt;/code&gt; streams events from the client’s queue to the new subscriber in real time.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Scenario 3: Client Disconnection &amp;amp; Reconnection
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A client disconnects (e.g., network loss, tab closure), triggering an &lt;code&gt;asyncio.CancelledError&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;code&gt;finally&lt;/code&gt; block of the streaming coroutine, &lt;code&gt;TaskManager.unsubscribe_from_stream(thread_id, queue)&lt;/code&gt; is called to remove the client’s queue from the subscriber set.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The background task continues running, and other subscribed clients are unaffected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the client reconnects with the same &lt;code&gt;thread_id&lt;/code&gt; before the task completes:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;StreamHandler&lt;/code&gt; verifies the task is still active.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A new queue is created via &lt;code&gt;subscribe_to_stream()&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The client resumes receiving events from the current point in the stream.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;When all subscribers have unsubscribed and the task completes, the &lt;code&gt;TaskManager&lt;/code&gt; cleans up the task after a short delay (to accommodate late reconnections).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key Technical Implementations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Publish-Subscribe Event Broadcasting
&lt;/h3&gt;

&lt;p&gt;At the heart of the system is a publish-subscribe (pub/sub) pattern optimized for streaming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When a task generates a new event, it is serialized into SSE format: &lt;code&gt;data: {JSON-serialized-event}\n\n&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;TaskManager&lt;/code&gt; iterates over all subscriber queues for the corresponding &lt;code&gt;thread_id&lt;/code&gt; and pushes the event to each queue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Failed queue pushes (indicating a disconnected client) trigger automatic cleanup of the stale queue, ensuring the subscriber set remains efficient.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach guarantees that all subscribed clients receive identical events in real time, while avoiding overhead from dead connections.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Asynchronous Task Management with asyncio
&lt;/h3&gt;

&lt;p&gt;Leveraging Python’s &lt;code&gt;asyncio.Task&lt;/code&gt; and MiroFlow’s async capabilities, the system manages background tasks with precision:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Task registration: When a new task is created, its &lt;code&gt;thread_id&lt;/code&gt; and &lt;code&gt;asyncio.Task&lt;/code&gt; object are stored in the task registry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Task cancellation: Users can cancel tasks from any client, with &lt;code&gt;TaskManager&lt;/code&gt; propagating the cancellation signal to the background task.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delayed cleanup: After a task completes, it remains in the registry for a configurable window (e.g., 5 minutes) to support reconnections. The task is only removed once the window expires and no subscribers exist.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Dynamic thread_id Extraction
&lt;/h3&gt;

&lt;p&gt;For new conversations, the &lt;code&gt;thread_id&lt;/code&gt; is not available upfront—it is generated within the first event from the AI task. To handle this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;StreamHandler&lt;/code&gt; monitors the initial events from the task.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upon extracting the &lt;code&gt;thread_id&lt;/code&gt; from the first event, it immediately registers the task and &lt;code&gt;thread_id&lt;/code&gt; with &lt;code&gt;TaskManager&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Subsequent events are routed through the pub/sub mechanism to all subscribers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This dynamic registration ensures seamless task tracking even when &lt;code&gt;thread_id&lt;/code&gt; is not known at request time.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Robust Reconnection Support
&lt;/h3&gt;

&lt;p&gt;The system’s reconnection feature is designed to minimize user disruption:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A dedicated reconnection API allows clients to send a request with a previously used &lt;code&gt;thread_id&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;TaskManager&lt;/code&gt; checks if the task is still active (or within the cleanup window).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If valid, a new subscriber queue is created, and the client resumes streaming from the current event sequence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the task has completed and been cleaned up, the client receives a "task completed" signal with the full conversation history.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advantages &amp;amp; Value Propositions
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resource Efficiency&lt;/strong&gt;: By sharing a single AI inference task across multiple clients, the system reduces computational overhead by up to 80% in multi-device scenarios—critical for scaling AI Agent products.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real-Time Synchronization&lt;/strong&gt;: All subscribed clients receive identical events simultaneously, ensuring consistent conversation states across devices.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhanced User Experience&lt;/strong&gt;: Supports multi-tab/multi-device usage and seamless reconnection after network interruptions, eliminating frustration from lost progress.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fault Tolerance&lt;/strong&gt;: Disconnections of individual clients do not affect ongoing tasks or other subscribers, ensuring system stability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MiroMind MiroFlow Synergy&lt;/strong&gt;: Built on MiroFlow’s flexible async framework, the system inherits MiroMind’s strengths in task orchestration and event handling, reducing development complexity.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Application Scenarios
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Device Sync&lt;/strong&gt;: Users can start a conversation on their phone and continue on their laptop, with real-time updates on both devices.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Team Collaboration&lt;/strong&gt;: Team members can jointly monitor AI tasks (e.g., report generation, data analysis) and receive live progress updates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unstable Network Environments&lt;/strong&gt;: Users in areas with spotty connectivity can reconnect and resume conversations without losing context.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Task Cancellation&lt;/strong&gt;: A user can initiate a task on one device and cancel it from another, with the cancellation propagated instantly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By combining MiroMind’s MiroFlow framework with a pub/sub-based architecture, we’ve built a streaming response system that redefines real-time multi-client interaction for AI Agent products. The decoupling of task execution (via &lt;code&gt;TaskManager&lt;/code&gt;) and client communication (via &lt;code&gt;StreamHandler&lt;/code&gt;) enables efficient resource reuse, robust synchronization, and seamless reconnection—addressing the core pain points of traditional SSE systems.&lt;/p&gt;

&lt;p&gt;This design not only enhances the user experience of OSpark but also provides a scalable foundation for future extensions, such as supporting more client types, adding event filtering, or integrating with real-time collaboration features. For teams building AI products with multi-client requirements, this architecture offers a proven, MiroMind-powered solution to deliver responsive, synchronized streaming experiences.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>performance</category>
      <category>ai</category>
      <category>backend</category>
    </item>
    <item>
      <title>OSpark: Building Event-Driven Streaming Responses with MiroMind's MiroFlow Foundation</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Fri, 31 Oct 2025 10:33:16 +0000</pubDate>
      <link>https://forem.com/askpaul/osparkapi-building-event-driven-streaming-responses-with-mirominds-miroflow-foundation-3kfc</link>
      <guid>https://forem.com/askpaul/osparkapi-building-event-driven-streaming-responses-with-mirominds-miroflow-foundation-3kfc</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;OSparkApi, a universal intelligent agent orchestration system built upon MiroMindAI's open-source MiroFlow project, centers its innovation around one critical capability: sophisticated event-driven streaming response processing. This architecture, rooted in MiroFlow's robust foundations, enables seamless handling of dynamic agent interactions while maintaining exceptional flexibility and scalability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Architectural Design
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Event System: The Event-Driven Engine
&lt;/h3&gt;

&lt;p&gt;Leveraging MiroFlow's architectural principles, OSparkApi adopts an event-driven architecture where all state changes flow through well-defined event streams, creating a loosely coupled ecosystem where components interact via standardized events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Event Type Definitions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ThreadStreamEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;ThreadCreatedEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ThreadUpdatedEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ThreadItemAddedEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; 
    &lt;span class="n"&gt;ThreadItemUpdated&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ThreadItemDoneEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ProgressUpdateEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; 
    &lt;span class="n"&gt;ErrorEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;NoticeEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;discriminator&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Asynchronous Event Streaming:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AgentContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;_events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Queue&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ThreadStreamEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Queue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ThreadStreamEvent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This event system—enhanced from MiroFlow's original design—effectively decouples producers from consumers, significantly enhancing extensibility and allowing independent evolution of system components.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Store Layer: Persistence Abstraction
&lt;/h3&gt;

&lt;p&gt;Building on MiroFlow's flexible data handling, the Store layer provides a unified storage interface with support for multiple backend implementations, ensuring adaptability in data persistence strategies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abstract Storage Interface:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Generic&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;TContext&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
    &lt;span class="nd"&gt;@abstractmethod&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;load_thread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thread_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TContext&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ThreadMetadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

    &lt;span class="nd"&gt;@abstractmethod&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_thread_item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thread_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ThreadItem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TContext&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ID Generation Strategy:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;_ID_PREFIXES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;thread&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;thr&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;msg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_call&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tc&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;workflow&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wf&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;default_generate_id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;StoreItemType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_ID_PREFIXES&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;item_type&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nb"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This design—extending MiroFlow's storage agnosticism—enables seamless switching between different storage backends without affecting core business logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Context System: Execution State Management
&lt;/h3&gt;

&lt;p&gt;AgentContext, a critical enhancement to MiroFlow's execution model, serves as the core of response processing, maintaining complete execution context for thread operations and ensuring state consistency across complex interactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Data Structure:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AgentContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ThreadMetadata&lt;/span&gt;
    &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Store&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;TContext&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;request_context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TContext&lt;/span&gt;

    &lt;span class="n"&gt;workflow_item&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;WorkflowItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;client_tool_call&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ClientToolCall&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Workflow Lifecycle Management:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;start_workflow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;workflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;workflow_item&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WorkflowItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;workflow&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="n"&gt;workflow&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;workflow&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;thread_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ThreadItemAddedEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;workflow_item&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;end_workflow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expanded&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ThreadItemDoneEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;workflow_item&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;workflow_item&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Context system—building on MiroFlow's state management capabilities—guarantees state consistency and operational atomicity throughout complex agent interactions.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Thread System: Conversation Session Management
&lt;/h3&gt;

&lt;p&gt;Threads represent the core abstraction in OSparkApi, extending MiroFlow's session handling to encapsulate complete conversational sessions and provide a structured container for interaction history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thread Data Model:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ThreadMetadata&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ThreadStatus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default_factory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ActiveStatus&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rich Item Type Hierarchy:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ThreadItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;UserMessageItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;AssistantMessageItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ClientToolCallItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; 
    &lt;span class="n"&gt;ServerToolCallItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;WidgetItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;WorkflowItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;TaskItem&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;EndOfTurnItem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;discriminator&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Thread system—enhanced from MiroFlow's conversation primitives—provides comprehensive lifecycle management for conversations, supporting diverse interaction patterns and content types.&lt;/p&gt;

&lt;h2&gt;
  
  
  Processing Flow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Streaming Response Handling
&lt;/h3&gt;

&lt;p&gt;Agent response processing follows a standardized flow—evolved from MiroFlow's execution pipeline—with clear separation of concerns between components:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Response Handler Interface:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AgentResponseHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nd"&gt;@abstractmethod&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;stream_agent_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AgentContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RunResultStreaming&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;AsyncIterator&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ThreadStreamEvent&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Core Processing Logic:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;stream_agent_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AgentContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RunResultStreaming&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream_events&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
        &lt;span class="n"&gt;thread_event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_process_stream_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;thread_event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;thread_event&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Processing Capabilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Content Streaming&lt;/strong&gt;: Real-time delivery of incremental text with annotation and formatting information&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Invocation&lt;/strong&gt;: Complete lifecycle management for both client and server tool calls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Handling&lt;/strong&gt;: Unified exception capture and structured error event generation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Orchestration&lt;/strong&gt;: Task state tracking and progress updates throughout execution&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architectural Advantages
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Design Principles
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Type Safety&lt;/strong&gt;: Comprehensive use of Pydantic—consistent with MiroFlow's design philosophy—ensures data consistency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Async-First&lt;/strong&gt;: Native asynchronous support based on asyncio for high-performance operations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-Driven&lt;/strong&gt;: Decoupled architecture enables horizontal scalability and component isolation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Abstract Layering&lt;/strong&gt;: Clear separation of responsibilities facilitates maintenance and evolution&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Extensibility Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Processor Factory&lt;/strong&gt;: Supports custom processors for different LLM providers, building on MiroFlow's flexibility&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage Plugins&lt;/strong&gt;: Easy integration with new storage backends through abstract interfaces&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event Extension&lt;/strong&gt;: New functionality can be implemented by adding event types&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Config-Driven&lt;/strong&gt;: Flexible configuration management based on OmegaConf&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Enterprise-Grade Characteristics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Observability&lt;/strong&gt;: Comprehensive event logging and tracing capabilities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Recovery&lt;/strong&gt;: Event-based checkpointing and resume functionality&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency Control&lt;/strong&gt;: Thread-level state isolation for safe parallel execution&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission Management&lt;/strong&gt;: User-based access control for secure multi-tenant operation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;OSparkApi's agent response processing architecture—built upon MiroMind's MiroFlow foundation—represents a mature evolution of modern streaming AI systems. By extending MiroFlow's robust core with a carefully crafted four-layer architecture (Event, Store, Context, and Thread), it delivers a high-performance, extensible, and type-safe response processing system.&lt;/p&gt;

&lt;p&gt;This architecture not only enhances MiroFlow's original capabilities but also provides a solid technical foundation for future AI application innovation. It demonstrates strong adaptability across real-time interactions, multimodality, and complex reasoning scenarios, positioning OSparkApi as a robust framework for the next generation of intelligent agent applications—all while honoring its MiroMind heritage.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>opensource</category>
      <category>architecture</category>
    </item>
    <item>
      <title>OSpark Orchestrator: Enabling Streaming Output for MiroMind's MiroFlow</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Fri, 17 Oct 2025 12:31:07 +0000</pubDate>
      <link>https://forem.com/askpaul/ospark-orchestrator-enabling-streaming-output-for-mirominds-miroflow-44pi</link>
      <guid>https://forem.com/askpaul/ospark-orchestrator-enabling-streaming-output-for-mirominds-miroflow-44pi</guid>
      <description>&lt;p&gt;As we embark on developing our universal Agent product OSpark, we've chosen to build upon MiroMindAI's open-source project MiroFlow. A key limitation we're addressing first is MiroFlow's lack of streaming output support. In this technical blog, we'll detail how we've enhanced MiroFlow to deliver real-time streaming capabilities through OSpark's orchestrator upgrade.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Changes in the Orchestrator
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. New Task Guidance System
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_get_task_guidance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chinese_context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Provides detailed task execution guidance with support for Chinese context&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Emphasizes comprehensive information collection and transparent reporting&lt;/li&gt;
&lt;li&gt;Offers specialized handling guidance for Chinese-language tasks&lt;/li&gt;
&lt;li&gt;Avoids premature conclusions while preserving all potential candidate answers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Streaming LLM Calling Capability
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_handle_llm_call_streaming&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Supports real-time streaming of LLM responses&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Returns real-time chunks of LLM-generated content&lt;/li&gt;
&lt;li&gt;Integrates tool call information extraction&lt;/li&gt;
&lt;li&gt;Supports streaming calls for both primary and sub-agents&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Streaming Summary Generation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_handle_summary_with_context_limit_retry_streaming&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Streaming version of summary generation with context limit retry support&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Makes the summary generation process visible in real-time&lt;/li&gt;
&lt;li&gt;Automatically handles context length exceeded issues&lt;/li&gt;
&lt;li&gt;Features an intelligent retry mechanism&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Design of the StreamingOrchestrator
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Architectural Design
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Decorator Pattern&lt;/strong&gt;: Instead of replacing the existing orchestrator, we add streaming capabilities on top of it&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-Driven&lt;/strong&gt;: Implements streaming interactions based on a complete event system&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Task Management&lt;/strong&gt;: Supports task cancellation, status queries, and lifecycle management&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Core Functionality
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute_task_streaming&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;AsyncGenerator&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;StreamEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Executes tasks and returns events in a streaming fashion&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Three Types of Real-time Interactions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LLM Response Streaming&lt;/strong&gt;: Returns LLM-generated content in real-time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Execution Transparency&lt;/strong&gt;: Displays tool call start, execution, and completion statuses&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Progress Status Real-time Updates&lt;/strong&gt;: Provides detailed execution steps and progress information&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Event System
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EventType&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Enum&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;TASK_STARTED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task_started&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;           &lt;span class="c1"&gt;# Task initiation
&lt;/span&gt;    &lt;span class="n"&gt;TASK_PROGRESS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task_progress&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;         &lt;span class="c1"&gt;# Task progress updates
&lt;/span&gt;    &lt;span class="n"&gt;LLM_RESPONSE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;           &lt;span class="c1"&gt;# LLM-generated content
&lt;/span&gt;    &lt;span class="n"&gt;TOOL_CALL_START&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_call_start&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;     &lt;span class="c1"&gt;# Tool invocation beginning
&lt;/span&gt;    &lt;span class="n"&gt;TOOL_CALL_COMPLETE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_call_complete&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;# Tool invocation finished
&lt;/span&gt;    &lt;span class="n"&gt;ERROR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;                         &lt;span class="c1"&gt;# Error occurrences
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Relationship Between the Two Components
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Collaboration Model: Decorator Pattern
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Streaming orchestrator creates an orchestrator instance internally
&lt;/span&gt;&lt;span class="n"&gt;orchestrator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Orchestrator&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Composition Relationship&lt;/strong&gt;: The streaming orchestrator contains an instance of the original orchestrator&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Function Enhancement&lt;/strong&gt;: Adds streaming capabilities on top of the original orchestrator&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interface Compatibility&lt;/strong&gt;: Maintains the original orchestrator's interface unchanged&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Responsibility Division
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibilities&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Orchestrator&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Core business logic: task execution, LLM calls, tool management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;StreamingOrchestrator&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Streaming interaction layer: event management, real-time feedback, task lifecycle&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  3. Data Flow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;API Request → StreamingOrchestrator → Create Orchestrator Instance → Execute Core Logic → Generate Streaming Events → Return in Real-time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Core Value
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. User Experience Enhancement
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transparent Execution&lt;/strong&gt;: Users can observe the AI's real-time thinking process&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant Feedback&lt;/strong&gt;: Real-time visibility of LLM responses, tool execution, and task progress&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controllability&lt;/strong&gt;: Supports task cancellation and status monitoring&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Technical Architecture Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backward Compatibility&lt;/strong&gt;: All original functionalities are preserved, enabling gradual migration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separation of Concerns&lt;/strong&gt;: Clear separation between core logic and interaction experience&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensibility&lt;/strong&gt;: Event-driven architecture supports flexible feature expansion&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Practical Applications
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-time AI Assistant&lt;/strong&gt;: Web interfaces that display the AI's thinking process in real-time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging and Monitoring&lt;/strong&gt;: Developers can monitor execution processes and performance metrics in real-time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Development&lt;/strong&gt;: Supports task cancellation, parameter adjustment, and result verification&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With the introduction of the StreamingOrchestrator, OSpark achieves a significant transformation from "black box" execution to "transparent" interaction. Using a decorator pattern design, we provide users with an improved interaction experience while maintaining backward compatibility, and offer developers enhanced observability and extensibility. This architecture not only addresses current real-time interaction needs but also lays a solid foundation for future feature expansion.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Building a Prediction Market App with MiroFlow: A Technical Deep Dive</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Wed, 08 Oct 2025 03:53:57 +0000</pubDate>
      <link>https://forem.com/askpaul/building-a-prediction-market-app-with-miroflow-a-technical-deep-dive-377e</link>
      <guid>https://forem.com/askpaul/building-a-prediction-market-app-with-miroflow-a-technical-deep-dive-377e</guid>
      <description>&lt;p&gt;As we develop &lt;a href="https://askpaul.ai" rel="noopener noreferrer"&gt;https://askpaul.ai&lt;/a&gt;, a cutting-edge prediction market application, we've integrated MiroMindAI's MiroFlow framework to power our market outcome predictions. This powerful open-source research agent framework has proven instrumental in handling the complex, multi-step internet research tasks that underpin accurate forecasting. In this technical blog post, we'll explore the architecture of MiroFlow (available at &lt;a href="https://github.com/MiroMindAI/MiroFlow" rel="noopener noreferrer"&gt;https://github.com/MiroMindAI/MiroFlow&lt;/a&gt;) and examine how its design enables robust predictive capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  MiroFlow Architecture Analysis
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Architectural Overview
&lt;/h3&gt;

&lt;p&gt;MiroFlow is a high-performance open-source research agent framework specifically engineered for executing complex multi-step internet research tasks, such as future event prediction. The project employs a modular design that supports multiple LLM providers and tool integrations, making it highly adaptable to diverse research scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Directory Structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MiroFlow/
├── src/                    # Core source code
│   ├── core/              # Core orchestration logic
│   ├── llm/               # LLM client implementations
│   ├── tool/              # Tool management
│   ├── logging/           # Logging and tracing
│   └── utils/             # Utility functions
├── config/                # Configuration files
├── data/                  # Data files
├── logs/                  # Log files
├── utils/                  # Utility scripts
└── docs/                  # Documentation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Core Architectural Components
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Core Orchestration Layer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/core/orchestrator.py&lt;/code&gt;&lt;/strong&gt;: Primary orchestrator responsible for coordinating main and sub-agents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/core/pipeline.py&lt;/code&gt;&lt;/strong&gt;: Task execution pipeline handling end-to-end task flows&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. LLM Client Layer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/llm/client.py&lt;/code&gt;&lt;/strong&gt;: LLM client factory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/llm/provider_client_base.py&lt;/code&gt;&lt;/strong&gt;: Abstract base class defining LLM client interface&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/llm/providers/&lt;/code&gt;&lt;/strong&gt;: Concrete LLM provider implementations

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;claude_anthropic_client.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gpt_openai_client.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mirothinker_sglang_client.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;qwen_sglang_client.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;And more&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Tool Management Layer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/tool/manager.py&lt;/code&gt;&lt;/strong&gt;: Tool manager with MCP protocol support&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/tool/mcp_servers/&lt;/code&gt;&lt;/strong&gt;: MCP server implementations

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;audio_mcp_server.py&lt;/code&gt;: Audio processing&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;browser_session.py&lt;/code&gt;: Browser sessions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;python_server.py&lt;/code&gt;: Python code execution&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reading_mcp_server.py&lt;/code&gt;: File reading&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reasoning_mcp_server.py&lt;/code&gt;: Reasoning tools&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;searching_mcp_server.py&lt;/code&gt;: Search tools&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vision_mcp_server.py&lt;/code&gt;: Visual processing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. Logging &amp;amp; Tracing Layer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/logging/logger.py&lt;/code&gt;&lt;/strong&gt;: Logging system&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/logging/task_tracer.py&lt;/code&gt;&lt;/strong&gt;: Task tracer recording execution steps&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  5. Configuration Management
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;config/&lt;/code&gt;&lt;/strong&gt;: Configuration file directory

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;agent_*.yaml&lt;/code&gt;: Agent configurations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;benchmark/&lt;/code&gt;: Benchmarking configurations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tool/&lt;/code&gt;: Tool configurations&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  6. Utilities Layer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;src/utils/&lt;/code&gt;&lt;/strong&gt;: Core utility functions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;utils/&lt;/code&gt;&lt;/strong&gt;: Evaluation and statistical tools&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Execution Flow Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Main Execution Flow:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Initialization Phase&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loading configuration files&lt;/li&gt;
&lt;li&gt;Initializing LLM clients&lt;/li&gt;
&lt;li&gt;Creating tool managers&lt;/li&gt;
&lt;li&gt;Setting up logging and tracing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Task Execution Phase&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Main agent receiving tasks&lt;/li&gt;
&lt;li&gt;Tool invocation and sub-agent coordination&lt;/li&gt;
&lt;li&gt;Result aggregation and formatting&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Result Output Phase&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generating final answers&lt;/li&gt;
&lt;li&gt;Saving execution logs&lt;/li&gt;
&lt;li&gt;Returning formatted results&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Multi-Agent Architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Main Agent&lt;/strong&gt;: Responsible for overall task coordination&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub Agents&lt;/strong&gt;: Execute specific subtasks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Agents&lt;/strong&gt;: Integrate various tools via MCP protocol&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. LLM Provider Support
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI GPT series&lt;/li&gt;
&lt;li&gt;Anthropic Claude series&lt;/li&gt;
&lt;li&gt;MiroThinker (proprietary model)&lt;/li&gt;
&lt;li&gt;Qwen series&lt;/li&gt;
&lt;li&gt;DeepSeek series&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Tool Ecosystem
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Search Tools&lt;/strong&gt;: Google search, web scraping&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Execution&lt;/strong&gt;: Python code running&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File Processing&lt;/strong&gt;: Document reading, audio transcription&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser Automation&lt;/strong&gt;: Playwright integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reasoning Tools&lt;/strong&gt;: Logical inference support&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Configuration-Driven Design
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Hydra configuration management&lt;/li&gt;
&lt;li&gt;Environment variable support&lt;/li&gt;
&lt;li&gt;Dynamic configuration loading&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architectural Summary
&lt;/h2&gt;

&lt;p&gt;MiroFlow represents a well-designed modular AI agent framework with the following characteristics:&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Advantages:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;High Modularity&lt;/strong&gt;: Clear separation of concerns among components, enabling easy extensibility&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-LLM Support&lt;/strong&gt;: Unified client interface supporting various large language models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rich Tool Ecosystem&lt;/strong&gt;: Integration of diverse tools through MCP protocol&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration-Driven&lt;/strong&gt;: Flexible configuration system supporting different scenarios&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comprehensive Logging&lt;/strong&gt;: Detailed execution records and error handling&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Technology Stack:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python 3.12+&lt;/strong&gt;: Leveraging modern Python features&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hydra&lt;/strong&gt;: For configuration management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP Protocol&lt;/strong&gt;: Standard for tool integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asynchronous Programming&lt;/strong&gt;: For high-performance concurrent processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pydantic&lt;/strong&gt;: For data validation and serialization&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Application Scenarios:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Future event prediction&lt;/li&gt;
&lt;li&gt;Complex research tasks&lt;/li&gt;
&lt;li&gt;Multi-step reasoning&lt;/li&gt;
&lt;li&gt;Automated information gathering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The architectural design of MiroFlow embodies best practices in modern AI agent systems, ensuring both performance and maintainability while providing excellent extensibility—qualities that make it an ideal foundation for powering the predictive capabilities of our askpaul.ai platform.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Enhancing MiroFlow: Tracking Data Sources for AskPaul App</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Thu, 02 Oct 2025 06:16:15 +0000</pubDate>
      <link>https://forem.com/askpaul/enhancing-miroflow-tracking-data-sources-for-askpaul-app-53em</link>
      <guid>https://forem.com/askpaul/enhancing-miroflow-tracking-data-sources-for-askpaul-app-53em</guid>
      <description>&lt;p&gt;When building predictive market applications askpaul.ai, transparency in data sources is crucial for user trust and informed decision-making. Our platform leverages MiroMindAI's MiroFlow for market outcome predictions, but we faced a challenge: MiroFlow didn't natively support tracking and exposing the reference data sources used in predictions.&lt;/p&gt;

&lt;p&gt;To address this, we implemented modifications to MiroFlow (available at &lt;a href="https://github.com/MiroMindAI/MiroFlow" rel="noopener noreferrer"&gt;https://github.com/MiroMindAI/MiroFlow&lt;/a&gt;) that enable comprehensive tracking of tool usage across all agents involved in the prediction process.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Modification Approach
&lt;/h2&gt;

&lt;p&gt;Our solution focused on capturing and preserving tool call data throughout the prediction process, with specific changes in two key files:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Tracking Tool Calls in &lt;code&gt;src/core/orchestrator.py&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;We needed to ensure tool usage data persisted across multiple rounds of agent interactions rather than being reset each time.&lt;/p&gt;

&lt;h4&gt;
  
  
  Sub-agent Tool Call Tracking
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Execute tool calls
# Note: Do not reinitialize tool_calls_data to accumulate data across turns
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;hasattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;_sub_agent_tool_calls_data&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_sub_agent_tool_calls_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="n"&gt;tool_calls_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_sub_agent_tool_calls_data&lt;/span&gt;
&lt;span class="n"&gt;all_tool_results_content_with_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We then added identification and logging capabilities for sub-agent activities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Store current turn's tool call data to logs
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Add sub-agent identification to each tool call
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;call_data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent_type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sub_agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="n"&gt;call_data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sub_agent_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sub_agent_name&lt;/span&gt;
    &lt;span class="c1"&gt;# Store only newly added data to avoid duplicates
&lt;/span&gt;    &lt;span class="n"&gt;current_turn_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tool_calls_data&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;task_log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;task_log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_turn_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Main Agent Tool Call Tracking
&lt;/h4&gt;

&lt;p&gt;Similar modifications were made for the main agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# 7. Execute tool calls (in sequence)
# Note: Do not reinitialize tool_calls_data to accumulate data across turns
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;hasattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;_main_agent_tool_calls_data&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_main_agent_tool_calls_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="n"&gt;tool_calls_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_main_agent_tool_calls_data&lt;/span&gt;
&lt;span class="n"&gt;all_tool_results_content_with_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With corresponding logging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Store main agent's tool call data to logs
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Add main agent identification to each tool call
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;call_data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent_type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;main_agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="c1"&gt;# Store only newly added data to avoid duplicates
&lt;/span&gt;    &lt;span class="n"&gt;current_turn_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tool_calls_data&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;call_data&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;task_log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;task_log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_turn_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Extending Logging Capabilities in &lt;code&gt;src/logging/task_tracer.py&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;To accommodate the new tracking data, we added a dedicated field in the task logging structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;step_logs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;StepRecord&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default_factory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Store detailed data for all tool calls
&lt;/span&gt;&lt;span class="n"&gt;tool_calls_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default_factory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Improvements
&lt;/h2&gt;

&lt;p&gt;These modifications delivered several critical enhancements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Persistence&lt;/strong&gt;: Tool call data is now stored in instance variables rather than temporary variables, preventing data loss between rounds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cross-turn Accumulation&lt;/strong&gt;: The system now maintains a complete history of tool usage across all interaction rounds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Agent Identification&lt;/strong&gt;: Each tool call is clearly marked as originating from either the main agent or a specific sub-agent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integrated Logging&lt;/strong&gt;: All tool usage data is systematically stored in the task log for later retrieval and display.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Duplicate Prevention&lt;/strong&gt;: A deduplication mechanism ensures each tool call is recorded only once.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These changes have transformed MiroFlow into a more transparent prediction engine, allowing applications like askpaul.ai to display comprehensive data source information to users. This not only enhances user trust but also provides valuable insights into how predictions are formulated.&lt;/p&gt;

&lt;p&gt;By making these modifications open-source, we hope to contribute to the MiroMindAI community and help other developers building transparent AI-powered applications.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Deploying MiroThinker for AI-Powered Predictions in askpaul.ai</title>
      <dc:creator>AskPaul</dc:creator>
      <pubDate>Fri, 26 Sep 2025 11:54:44 +0000</pubDate>
      <link>https://forem.com/askpaul/deploying-mirothinker-for-ai-powered-predictions-in-askpaulai-2g3k</link>
      <guid>https://forem.com/askpaul/deploying-mirothinker-for-ai-powered-predictions-in-askpaulai-2g3k</guid>
      <description>&lt;p&gt;As we develop askpaul.ai, a prediction market application requiring accurate AI-powered event outcome forecasting, we needed a reliable and high-performance model to power our prediction engine. After evaluating several options, we chose MiroMind's MiroThinker model for its exceptional predictive capabilities. This blog outlines our deployment process on a CentOS system with GPU acceleration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Infrastructure Setup
&lt;/h2&gt;

&lt;p&gt;Our deployment environment consists of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CentOS 8.3 operating system&lt;/li&gt;
&lt;li&gt;NVIDIA H20 GPU for accelerated computing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Python 3.12 Installation
&lt;/h3&gt;

&lt;p&gt;We started by installing Python 3.12, which provides the necessary runtime environment for our application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Installation commands for Python 3.12 on CentOS 8.3&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; gcc openssl-devel bzip2-devel libffi-devel
wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz
&lt;span class="nb"&gt;tar &lt;/span&gt;xzf Python-3.12.0.tgz
&lt;span class="nb"&gt;cd &lt;/span&gt;Python-3.12.0
./configure &lt;span class="nt"&gt;--enable-optimizations&lt;/span&gt;
make altinstall
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. NVCC Installation
&lt;/h3&gt;

&lt;p&gt;To leverage GPU acceleration, we installed the NVIDIA CUDA Compiler (nvcc):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install CUDA toolkit containing nvcc&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf config-manager &lt;span class="nt"&gt;--add-repo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; cuda-toolkit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note about CentOS 8.3 package management&lt;/strong&gt;: CentOS 8 and later versions use &lt;code&gt;dnf&lt;/code&gt; as the default package manager, which is an enhanced version of &lt;code&gt;yum&lt;/code&gt;. While &lt;code&gt;yum&lt;/code&gt; commands still work as aliases to &lt;code&gt;dnf&lt;/code&gt;, we recommend using &lt;code&gt;dnf&lt;/code&gt; directly for better performance and dependency resolution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Required Dependencies
&lt;/h2&gt;

&lt;p&gt;We installed the following Python packages to ensure proper functionality:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip3.12 &lt;span class="nb"&gt;install &lt;/span&gt;sglang pybase64 pydantic orjson uvicorn uvloop fastapi torch psutil zmq packaging Pillow openai partial_json_parser huggingface_hub transformers sentencepiece sgl_kernel dill compressed_tensors einops msgspec python-multipart pynvml torchao xgrammar openai_harmony
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These packages provide essential functionality including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web serving capabilities (uvicorn, fastapi)&lt;/li&gt;
&lt;li&gt;GPU-accelerated tensor operations (torch, torchao)&lt;/li&gt;
&lt;li&gt;Model management and inference (sglang, transformers, huggingface_hub)&lt;/li&gt;
&lt;li&gt;Data processing and serialization (orjson, msgspec, pybase64)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deploying MiroThinker
&lt;/h2&gt;

&lt;p&gt;With all prerequisites in place, we deployed the MiroThinker-32B-DPO-v0.2 model using sglang's server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;nohup &lt;/span&gt;python3.12 &lt;span class="nt"&gt;-m&lt;/span&gt; sglang.launch_server &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--model-path&lt;/span&gt; miromind-ai/MiroThinker-32B-DPO-v0.2 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--tp&lt;/span&gt; 1 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--dp&lt;/span&gt; 1 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--host&lt;/span&gt; 0.0.0.0 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--port&lt;/span&gt; 6666 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--trust-remote-code&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--chat-template&lt;/span&gt; qwen3_nonthinking.jinja &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; miromind.log &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts the server in the background with &lt;code&gt;nohup&lt;/code&gt;, ensuring it continues running even after logout. The model is deployed with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tensor parallelism (tp) set to 1&lt;/li&gt;
&lt;li&gt;Data parallelism (dp) set to 1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These settings are appropriate for our single GPU setup.&lt;/p&gt;

&lt;p&gt;For the nonthinking mode required by our prediction use case, we used the specialized template available at:&lt;br&gt;
&lt;a href="https://github.com/MiroMindAI/MiroThinker/blob/main/assets/qwen3_nonthinking.jinja" rel="noopener noreferrer"&gt;https://github.com/MiroMindAI/MiroThinker/blob/main/assets/qwen3_nonthinking.jinja&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Deploying MiroThinker on our CentOS 8.3 system with an H20 GPU has significantly enhanced the prediction capabilities of askpaul.ai. The model's performance meets our expectations for accuracy and response time, making it an excellent fit for our prediction market application.&lt;/p&gt;

&lt;p&gt;The sglang framework provided a straightforward deployment path, and the MiroThinker model has proven to be reliable and efficient in our production environment. We're excited to continue leveraging this powerful combination as we expand the capabilities of askpaul.ai.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
