Federation over Text (FoT) is a federated-learning-like paradigm for multi-agent reasoning.
Instead of sharing gradients or model weights, agents share reasoning traces distilled from completed tasks. A central aggregation process then organizes and compresses those traces into reusable insights that can help future agents solve related problems more effectively.
There are strong connections between FL and FoT. In FL, clients may adopt different optimization methods to solve local subproblems. Analogously, in FoT, each agent may use distinct local reasoning strategies and prompt designs to generate traces.
Inspired by techniques from distributed and federated learning, FoT opens an interesting design space for improving the efficiency and effectiveness of multi-agent collaborative reasoning.
FoT is an orchestration framework for Federation over Text (FoT) built on top of openclaw.
It lets you run multiple OpenClaw agents in parallel, recover their reasoning traces after execution, and aggregate those traces into a persistent shared insight library. The result is a practical testbed for studying how agents can improve collectively through text-based reasoning exchange rather than parameter sharing.
⚡ Run multiple OpenClaw agents concurrently under FoT supervision.🧠 Recover transcripts from finished or broken runs.📝 Convert transcripts into structured local reasoning traces.🔗 Aggregate traces into a persistent shared insight library.📚 Inject the current insight library into new agent workspaces automatically.🛠️ Subclass the local and global FoT reasoning interfaces to plug in custom trace extraction and aggregation algorithms.The repository is split into two layers:
src/fot/
The FoT algorithm layer. This contains the local reasoning pipeline and the global aggregation pipeline.src/fotclaw/
The orchestration layer. This contains the CLI, state management, OpenClaw integration, supervision, and persistence.At a high level:
src/fotclaw hosts and manages agents.fot defines how local reasoning traces are extracted and how global insights are aggregated.3.11+openclaw, or configured through OPENCLAW_PATHsetting.yamlconda create -n fot python=3.12 -y
conda activate fot
python -m pip install --upgrade pip
python -m pip install -e .
Development extras:
python -m pip install -e ".[dev]"
Start a background agent:
fot agent --message "Solve the task in the current workspace."
Create or reuse a stable named agent shell:
fot agent --name math
Run work on a named agent:
fot agent --name math --message "Work on the math task."
Inspect agent state:
fot show agent --name math
List all FoT-managed agents:
fot list
Start aggregation:
fot aggregate
Inspect the aggregation worker and the shared insight library:
fot show agent --name aggregate
For detailed command usage:
fot --help
fot agent --help
fot show agent --help
FoT provides these main commands:
fot agentfot listfot show agentfot stopfot delete agentfot aggregatefot cleanThe root CLI help now describes how each command is used, and command-specific help is available for the major subcommands.
When an agent finishes or breaks, FoT separates execution from FoT postprocessing:
At the project level, FoT exposes two algorithm hooks:
Every new FoT run copies the current shared library into the agent workspace as both INSIGHTS.md and insight.md, then prefixes the prompt so the agent is instructed to read and use it.
One of the main changes in the current codebase is that the FoT algorithm layer is now explicitly exposed through abstract interfaces.
Conceptually, users can think about FoT as having:
local step interface for per-task reasoning and insight extractionserver step interface for cross-task aggregationInternally, the default implementation breaks each interface into staged abstract methods, but users do not need to think in terms of "step 1, step 2, step 3" when understanding the project at a high level.
The abstract base class is:
fot.fot_client.LocalReasoningClientUsers can replace the default local FoT pipeline by subclassing this abstract local reasoning client.
The default implementation is:
fot.fot_client.OpenClawFoTClientThe abstract base class is:
fot.fot_server.GlobalReasoningServerUsers can replace the default global FoT aggregation pipeline by subclassing this abstract server-side reasoning interface.
The default implementation is:
fot.fot_server.OpenClawFoTServerThe local reasoning interface and the server-side aggregation interface should each behave like a complete wrapper over their own algorithm.
Each abstract method should return a Python dict, but users should think in terms of:
FoT handles the orchestration around these interfaces; users only need to implement the algorithmic behavior for local reasoning and aggregation.
FoT loads the local and global algorithm classes from editable settings in the project root setting.yaml:
local_reasoning_classglobal_reasoning_classDefault values:
fot.fot_client:OpenClawFoTClientfot.fot_server:OpenClawFoTServerSet custom implementations by editing:
local_reasoning_class: mypkg.reasoning:MyLocalReasoner
global_reasoning_class: mypkg.reasoning:MyGlobalReasoner
Your module must be importable from the Python environment that runs fot.
from typing import Any
from fot.fot_client import LocalReasoningClient
from fot.fot_server import GlobalReasoningServer
class MyLocalReasoner(LocalReasoningClient):
def local_step_1(
self,
problem: str,
*,
custom_solution_instruction: str | None = None,
insights_section: str | None = None,
) -> dict[str, Any]:
return {"response": f"custom step 1 for {problem}", "usage": {}}
def local_step_2(self, problem: str, step1_result: dict[str, Any]) -> dict[str, Any]:
return {"response": "custom local reflection", "usage": {}}
def local_step_3(
self,
problem: str,
step1_result: dict[str, Any],
step2_result: dict[str, Any],
) -> dict[str, Any]:
return {
"valid_skills": {
"insight_custom_local": "A custom local reasoning trace."
},
"usage": {},
}
class MyGlobalReasoner(GlobalReasoningServer):
def global_step_1(self, json_files: list[str] | None = None) -> dict[str, Any]:
return {"insight_store": {"trace_000001": "custom trace"}}
def global_step_2(self, collection_result: dict[str, Any]) -> dict[str, Any]:
return {"profiling": {"clusters": [], "relationships": []}, "usage": {}}
def global_step_3(
self,
collection_result: dict[str, Any],
profiling_result: dict[str, Any],
existing_encyclopedia: dict[str, str] | None = None,
) -> dict[str, Any]:
return {
"encyclopedia_dict": {
"insight_custom_global": "A custom aggregated insight."
},
"usage": {},
}
FoT stores runtime state under project-local .fot/ by default. Override this with FOT_HOME.
User-editable settings live in the project root setting.yaml:
default_modelaggregation_modelopenclaw_pathlocal_reasoning_classglobal_reasoning_classauto_aggregate_enabledauto_aggregate_trace_thresholdauto_aggregate_min_interval_secondsEdit setting.yaml directly to change these values.
Runtime aggregation metadata is stored separately in ./.fot/config.json by default.
By default FoT stores:
./setting.yaml./.fot/agents/<agent_id>/./.fot/reasoning_traces/problem_XXXXXX.json./.fot/aggregate/./.fot/insight.json and ./.fot/insight.mdEach agent directory contains its record, logs, workspace, and any recovered transcript path.
fot clean removes FoT-managed per-agent state, transient traces, and aggregation scratch files while preserving the persistent shared insight library.
src/fot/
FoT algorithm packagesrc/fot/fot_client.py
local reasoning interfaces and default implementationsrc/fot/fot_server.py
global aggregation interfaces and default implementationsrc/fotclaw/
FoT host, CLI, supervisor, configuration, and OpenClaw integrationagents add races; actual task execution still runs in parallel.fotaggregation.openclaw is missing, FoT fails fast with an explicit error.An intuitive way to think about FoT is:
insight.md is the shared lab notebook that future researchers can reuseIt is worth continuing to explore the design space of FoT, including personalization strategies, evaluation methodology, handling distribution drift across agents, and optimizing communication efficiency between agents and the server.
@misc{yao2026federationtextinsightsharing,
title={Federation over Text: Insight Sharing for Multi-Agent Reasoning},
author={Dixi Yao and Tahseen Rabbani and Tian Li},
year={2026},
eprint={2604.16778},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2604.16778},
}