What Is the Agent Layer in AI Berkshire and How Does It Facilitate Research?
The Agent Layer in AI Berkshire is the middle tier of a three-layer architecture that activates team-type skills to orchestrate four independent master-perspective agents, enabling parallel research execution, cross-validation of findings, and synthesis into a final investment report under a Team Lead.
AI Berkshire implements a three-layer design (Skill → Agent → Tool) that cleanly separates "what to do" from "who does it" and "how it’s done." The Agent Layer sits at the center of this stack, transforming simple skill invocations into rigorous, multi-agent research workflows. When you trigger a team-type skill such as /investment-team, this layer activates a Team Lead that manages four autonomous agents working in parallel to eliminate single-point bias and produce validated investment analysis.
The Three-Layer Architecture: Where the Agent Layer Fits
The repository’s architecture is defined in README_EN.md, which establishes a strict separation of concerns across three distinct layers. This design ensures that simple operations remain fast while complex research tasks benefit from multi-agent rigor.
Skill Layer: The Entry Point
The Skill Layer defines "what" needs to be done. Skills are invoked via commands like /investment-team or /earnings-team. According to the architecture documentation in README_EN.md, these entries act as routers that determine whether a task requires the full Agent Layer or can bypass it for direct tool execution.
Agent Layer: The Orchestration Engine
The Agent Layer implements the "who." When a team-type skill is invoked, this layer instantiates a Team Lead and four independent master-perspective agents. As documented in skills/investment-team.md and skills/earnings-team.md, the Team Lead manages these agents through a four-stage workflow: parallel launch, independent judgment, challenge and cross-validation, and final synthesis.
Tool Layer: The Execution Backend
The Tool Layer handles "how" tasks are executed. Agents call specific tools like financial_rigor.py for calculations or web search utilities for data gathering. Lightweight skills bypass the Agent Layer entirely and call this layer directly, ensuring optimal performance for simple queries.
How the Agent Layer Facilitates Research
The Agent Layer facilitates research by mimicking the structure of a real investment team. It replaces single-threaded analysis with a redundant, adversarial process that surfaces contradictions and validates evidence before any conclusion is finalized.
Parallel Execution by Four Master-Perspective Agents
When the Team Lead initializes a research task, it launches four independent agents simultaneously. Each agent executes a complete research loop—including web searches, data pulls, and calculations—as if it were a separate analyst. This parallel execution is defined in the team skill documentation, where each agent operates with its own "master-perspective" on the investment thesis.
Independent Judgment and Bias Reduction
Each of the four agents arrives at its own conclusions without seeing the other agents' outputs. This isolation guarantees diverse perspectives and prevents groupthink. According to the skills/investment-team.md specification, this independence ensures that initial biases are not amplified across the team, preserving the analytical rigor of the final output.
Cross-Validation and Challenge Mechanisms
After forming independent judgments, agents enter a challenge phase where they can query each other, identify contradictions, and surface supporting evidence. This cross-validation step, detailed in the architecture overview, allows agents to flag weak assumptions or conflicting data points before the synthesis stage begins.
Synthesis by the Team Lead
The Team Lead gathers the four completed research reports and reconciles conflicts to produce a single, coherent document. As implemented in the earnings-team workflow (skills/earnings-team.md), the Team Lead performs the final synthesis, weighing the evidence from each perspective to generate the "final report" that is returned to the user.
Triggering the Agent Layer: Team-Type Skills
The Agent Layer is not activated for every operation. It is specifically triggered by team-type skills that require multi-agent coordination.
Team Skills That Activate the Layer
Skills prefixed with team commands invoke the full three-layer stack:
/investment-team– Activates four agents to analyze a stock's intrinsic value and investment thesis/earnings-team– Deploys the agent team for earnings analysis and report synthesis
These skills are defined in skills/investment-team.md and skills/earnings-team.md, which specify the Team Lead orchestration and the four-agent structure.
Lightweight Skills That Bypass the Layer
Simple data lookups skip the Agent Layer for performance. For example, a direct call to retrieve financial data executes immediately against the Tool Layer without spawning the four-agent team. This bypass mechanism ensures that the system remains responsive for straightforward queries while reserving the heavy agent orchestration for complex research tasks.
Implementation Details from the Source Code
The Agent Layer behavior is codified across several key files in the repository:
README_EN.md– Contains the high-level architecture description (lines 158-162) defining the three-layer model and the Agent Layer's role as the orchestration tierskills/investment-team.md– Documents the/investment-teamskill that spins up the four agents under a Team Lead (referenced in README_EN.md lines 171-173)skills/earnings-team.md– Details the Team Lead synthesis steps for earnings analysis (lines 165-172)codex-skills/investment-team/SKILL.md– Generated Codex version mirroring the source skill definitionstools/financial_rigor.py– Example Tool Layer utility that agents invoke for precise financial calculations
The assets/team-core.svg file provides a visual diagram illustrating the Team Lead orchestrating the four parallel agents, which corresponds to the implementation in the skill definitions.
Code Examples: Interacting with the Agent Layer
The following examples demonstrate how to invoke the Agent Layer through team-type skills and how to interact with its components programmatically. These assume the repository is installed as a Python package with the standard run_skill entry point.
Invoking the Full Investment Team
Trigger the Agent Layer by calling a team-type skill. This automatically spawns the four agents and Team Lead:
from ai_berkshire import run_skill
# Activates the Agent Layer with four parallel master-perspective agents
result = run_skill("/investment-team", ticker="AAPL")
print(result["final_report"])
Bypassing the Agent Layer for Lightweight Tasks
For simple data retrieval, call skills that interface directly with the Tool Layer, skipping agent orchestration:
from ai_berkshire import run_skill
# Executes immediately against the Tool Layer without Agent Layer overhead
valuation = run_skill("/financial-data", ticker="TSLA")
print(f"Intrinsic value: {valuation['fair_value']}")
Manual Orchestration of Agents
For advanced use cases, you can instantiate the Team Lead and agents directly to customize the research workflow:
from ai_berkshire.agents import TeamLead, MasterAgent
# Initialize four independent master-perspective agents
agents = [MasterAgent(perspective=i) for i in range(4)]
lead = TeamLead(agents)
# Execute parallel research and synthesis
research_outputs = lead.run_parallel(ticker="GOOGL")
final_report = lead.synthesize(research_outputs)
print(final_report)
Summary
- The Agent Layer in AI Berkshire sits between the Skill Layer and Tool Layer, implementing the "who" of the three-layer architecture.
- It is activated exclusively by team-type skills such as
/investment-teamand/earnings-team, which trigger a Team Lead to manage four parallel agents. - Each agent conducts independent full research loops without cross-communication until the challenge phase, ensuring diverse perspectives.
- The layer facilitates cross-validation where agents challenge contradictions and surface evidence before synthesis.
- Lightweight skills bypass the Agent Layer entirely, calling the Tool Layer directly for optimal performance on simple queries.
- Implementation files include
README_EN.mdfor architecture,skills/investment-team.mdfor team definitions, andtools/financial_rigor.pyfor agent utilities.
Frequently Asked Questions
What is the difference between team-type skills and lightweight skills in AI Berkshire?
Team-type skills such as /investment-team and /earnings-team activate the full Agent Layer, spawning four master-perspective agents under a Team Lead to conduct parallel research and synthesis. Lightweight skills bypass this layer entirely and call the Tool Layer directly for immediate data retrieval or simple calculations. The distinction allows the system to balance analytical depth with execution speed based on task complexity.
How does the Agent Layer prevent bias in investment research?
The Agent Layer prevents bias through isolated parallel execution. Each of the four agents forms independent judgments without access to the other agents' outputs, preventing confirmation bias and groupthink. During the challenge phase, agents actively query each other and identify contradictions, surfacing conflicting evidence that must be resolved before the Team Lead generates the final synthesis.
Can I customize the number of agents in the Agent Layer?
The source code in skills/investment-team.md and skills/earnings-team.md specifies a fixed architecture of four master-perspective agents orchestrated by a single Team Lead. While the core team skills implement this four-agent structure, the underlying classes such as TeamLead and MasterAgent could theoretically be instantiated with custom configurations, though the standard repository implementation optimizes for four independent perspectives to balance thoroughness with computational efficiency.
What source files define the Agent Layer behavior?
The Agent Layer is defined across several files: README_EN.md (lines 158-162) describes the three-layer architecture and the Agent Layer's orchestration role; skills/investment-team.md and skills/earnings-team.md specify the Team Lead workflow and four-agent execution model; and codex-skills/investment-team/SKILL.md provides the generated Codex implementation. Tool integrations used by agents are implemented in files such as tools/financial_rigor.py.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →