A multi-agent deliberation system powered by LangGraph and OpenRouter. Brain Trust simulates a panel of expert advisors who analyze your question from different perspectives, providing comprehensive insights through parallel reasoning and executive summarization.
- Parallel Advisor Execution: Multiple AI personas analyze your question simultaneously, each with their own private scratchpad for reasoning
- Diverse Perspectives: Six specialized advisor personas provide strategic, technical, critical, risk-focused, and ethical viewpoints
- Executive Summarization: A dedicated Summarizer synthesizes insights from all advisors, highlighting convergences, divergences, and actionable next steps
- Flexible Configuration: Select specific personas or use all advisors, with options for verbose output and summary control
- Rich Terminal Output: Beautifully formatted results using Rich library with color-coded panels
- Clone the repository:
git clone <repository-url>
cd brain-trust- Install dependencies:
pip install -r requirements.txtCreate a .env file in the project root with your OpenRouter API credentials:
# Copy the example file
cp .env.example .envEdit .env and set your API key:
OPENROUTER_API_KEY=your_api_key_here
OPENROUTER_API_BASE=https://openrouter.ai/api/v1
google/gemini-2.0-flash-001
TEMPERATURE=0.7
TOP_P=1.0| Variable | Required | Default | Description |
|---|---|---|---|
OPENROUTER_API_KEY |
Yes | - | Your OpenRouter API key |
OPENROUTER_API_BASE |
No | https://openrouter.ai/api/v1 |
OpenRouter API base URL |
MODEL |
No | google/gemini-2.0-flash-001 |
Model name to use |
TEMPERATURE |
No | 0.7 |
Sampling temperature (0.0-2.0) |
TOP_P |
No | 1.0 |
Nucleus sampling parameter (0.0-1.0) |
EXEMPLARS_DIR |
No | data/exemplars |
Directory containing persona exemplar JSON files |
Run with all advisors:
python -m src.cli "Should we adopt a microservices architecture?"Use only specific advisors:
python -m src.cli "What's the best approach for data migration?" --personas strategist,domain_expertOr use the short form:
python -m src.cli "How should we prioritize technical debt?" -p strategist,risk_officerShow detailed transcript including private scratchpads:
python -m src.cli "Should we invest in AI capabilities?" --verboseShow only advisor outputs without executive summary:
python -m src.cli "What's our go-to-market strategy?" --no-summaryUse a custom directory for exemplar files:
python -m src.cli "What's our go-to-market strategy?" --exemplars-dir /path/to/custom/exemplarsOr set the EXEMPLARS_DIR environment variable:
export EXEMPLARS_DIR=/path/to/custom/exemplars
python -m src.cli "What's our go-to-market strategy?"You can combine multiple options:
python -m src.cli "Should we open source our project?" -p strategist,ethicist -vBrain Trust uses exemplars—real people with proven track records—to ground each advisor's recommendations in established expertise. Each persona is associated with exemplars whose expertise aligns with that advisor's perspective.
- Simplified Format: Exemplars are stored as simple name lists in JSON files under
data/exemplars/ - Knowledge-Based Reasoning: Rather than pre-defining specific actions for each exemplar, the LLM researches each individual from its knowledge base to find novel, contextually relevant precedents
- Dynamic Citations: This approach enables more diverse and tailored recommendations, as the model can cite different actions or decisions depending on the specific question
You can customize exemplars for each persona by editing the JSON files in data/exemplars/:
{
"persona": "strategist",
"exemplars": ["Reid Hoffman", "Andy Walsh", "Brian Chesky"]
}To use a custom exemplars directory, set the EXEMPLARS_DIR environment variable or use the --exemplars-dir CLI option.
Brain Trust includes six specialized advisor personas:
| Persona | Role |
|---|---|
| Strategist | Provides high-level strategic analysis, frames problems in strategic terms, considers long-term implications and trade-offs |
| Domain Expert | Delivers deep technical and domain-specific knowledge, identifies constraints and best practices |
| Devil's Advocate | Challenges assumptions, identifies failure modes, surfaces counter-arguments and blind spots |
| Risk Officer | Identifies, assesses, and mitigates risks across technical, operational, financial, and reputational dimensions |
| Ethicist | Considers ethical implications, stakeholder impact, fairness, and potential unintended consequences |
| Summarizer | Synthesizes insights from all advisors, identifies convergences and divergences, recommends next actions |
- Question Input: You provide a question or topic for deliberation
- Parallel Analysis: Selected advisor personas analyze the question simultaneously, each with their own private scratchpad for reasoning
- Independent Reasoning: Advisors work independently without collusion, following specific guardrails
- Structured Responses: Each advisor provides a brief answer, key bullet points, and open questions
- Executive Summary: The Summarizer synthesizes all advisor responses into an executive summary with:
- Executive summary (3-5 sentences)
- Convergences (areas of agreement)
- Divergences (areas of disagreement)
- Recommended next actions
The CLI displays results in a structured, color-coded format:
- Question Panel: Your original question
- Executive Summary Panel: Synthesized insights (unless
--no-summary) - Key Disagreements Panel: Areas where advisors disagree (if any)
- Advisor Panels: Individual outputs from each advisor
- Verbose Transcript (optional): Detailed execution trace including private scratchpads
You can extend Brain Trust by adding custom personas. See PERSONAS.md for detailed instructions on creating and configuring new advisor personas.
- Python 3.10+
- OpenRouter API key
- Dependencies listed in
requirements.txt