TXP CLI - Parallel test-time compute using multiple LLM reasoning agents with AWS Bedrock
Project description
TXP CLI - Team of eXPerts
A CLI tool that implements parallel test-time compute using multiple LLM reasoning agents. TXP spawns N independent reasoning agents to tackle complex queries, then synthesizes their outputs through a coordinator agent into a coherent, high-confidence answer.
Features
- Parallel Reasoning: Spawn 2-32 independent reasoning agents for diverse perspectives
- Intelligent Synthesis: Coordinator agent analyzes agreements, contradictions, and synthesizes the best answer
- Confidence Levels: Get Low/Medium/High confidence ratings with your answers
- Streaming Output: Real-time streaming of coordinator synthesis
- Session Logging: Automatic markdown logs with token counts and cost estimates
- Flexible Input: Query via arguments, flags, or stdin piping
- Configurable: Persistent configuration with CLI, environment, and file-based settings
Installation
Using uvx (recommended)
uvx txp "Your complex question here"
Using pipx
pipx install team-of-experts
txp "Your complex question here"
Using pip
pip install team-of-experts
Prerequisites
- Python 3.10+
- AWS credentials configured with Bedrock access
- Claude model access in your AWS region (us-east-1 by default)
Quick Start
# Basic usage - ask a complex question
txp "Solve: x^2 + 5x + 6 = 0"
# Pipe input from stdin
echo "Explain the implications of Gödel's incompleteness theorems" | txp
# Use explicit query flag
txp --query "What are the trade-offs between microservices and monolithic architectures?"
# Verbose output with agent details
txp -v "Analyze the time complexity of quicksort"
# Quiet mode - only show final answer
txp --quiet "What is 2 + 2?"
# Save output to file
txp --output answer.txt "Explain quantum entanglement"
# Skip session logging for this query
txp --no-log "Quick question"
Usage Examples
Mathematical Problems
# Algebra
txp "Solve the system of equations: 2x + 3y = 7, x - y = 1"
# Calculus
txp "Find the derivative of f(x) = x^3 * sin(x)"
# Probability
txp "What is the probability of getting exactly 3 heads in 5 coin flips?"
Programming Questions
# Algorithm analysis
txp "Explain the difference between BFS and DFS, and when to use each"
# Code review
cat code.py | txp "Review this code for potential bugs and improvements"
# Architecture decisions
txp "Compare REST vs GraphQL for a mobile app backend"
Complex Reasoning
# Multi-step reasoning
txp "If all roses are flowers, and some flowers fade quickly, can we conclude that some roses fade quickly?"
# Analysis
txp "Analyze the economic implications of universal basic income"
# Synthesis
txp "Compare and contrast the philosophies of Kant and Nietzsche on morality"
Using with Other Tools
# Pipe from clipboard (macOS)
pbpaste | txp
# Pipe from file
cat question.txt | txp
# Save to file and view
txp "Explain quantum computing" --output answer.md && cat answer.md
# Use with fewer agents for faster response
txp --num-agents 4 "Quick question about Python"
# Use with more agents for complex problems
txp --num-agents 24 "Prove the Pythagorean theorem using three different methods"
Configuration
TXP stores configuration at ~/.txp/config.json. Manage it via CLI commands:
# View all configuration
txp config show
# Get a specific value
txp config get model
# Set a value
txp config set num-agents 24
txp config set aws-profile my-profile
txp config set temperature 0.85
# Reset to defaults
txp config reset
# Show config file path
txp config path
Configuration Reference
| Key | Default | Range/Values | Description |
|---|---|---|---|
provider |
bedrock |
bedrock |
LLM provider (currently only Bedrock supported) |
aws-profile |
default |
Any valid AWS profile | AWS profile for credentials |
region |
us-east-1 |
Any AWS region | AWS region for Bedrock API calls |
model |
us.anthropic.claude-sonnet-4-5-20250929-v1:0 |
Valid Bedrock model ID | Model ID for reasoning and coordination |
num-agents |
16 |
2-32 |
Number of parallel reasoning agents |
temperature |
0.9 |
0.0-1.0 |
Sampling temperature for reasoning agents (higher = more diverse) |
coordinator-temperature |
0.7 |
0.0-1.0 |
Sampling temperature for coordinator (lower = more focused) |
max-tokens |
8192 |
1-100000 |
Maximum tokens per agent response |
log-enabled |
true |
true/false |
Enable/disable session logging |
log-retention-days |
30 |
1-365 |
Days to retain session logs before auto-cleanup |
Environment Variables
| Variable | Description |
|---|---|
TXP_AWS_PROFILE |
Override AWS profile (takes precedence over config file) |
TXP_REGION |
Override AWS region |
TXP_NUM_AGENTS |
Override number of agents |
TXP_TEMPERATURE |
Override temperature |
TXP_LOG_ENABLED |
Override log enabled setting |
Configuration Precedence
Configuration values are resolved in this order (highest to lowest priority):
- CLI arguments (e.g.,
--num-agents 8) - Environment variables (e.g.,
TXP_AWS_PROFILE) - Config file (
~/.txp/config.json) - Default values
CLI Reference
Usage: txp [OPTIONS] [QUERY]
Arguments:
QUERY Query string to process (positional)
Options:
-q, --query TEXT Query string (alternative to positional argument)
-n, --num-agents INT Number of parallel reasoning agents (2-32)
-t, --temperature FLOAT
Sampling temperature (0.0-1.0)
-m, --model TEXT Model ID to use
--aws-profile TEXT AWS profile name
--region TEXT AWS region
-o, --output FILE Write final answer to file
--no-log Skip session logging for this execution
-v, --verbose Show detailed debug information and stack traces
--quiet Only show final answer (no progress or status)
--version Show version and exit
--help Show this message and exit
Config Commands:
txp config show Show all configuration values
txp config get KEY Get a configuration value
txp config set KEY VALUE
Set a configuration value
txp config reset Reset configuration to defaults
txp config path Show configuration file path
How It Works
- Query Input - Your question is sent to N independent reasoning agents
- Parallel Reasoning - Each agent processes the query with chain-of-thought reasoning using high temperature (0.9) for diverse perspectives
- Validation - At least 50% of agents must succeed for synthesis to proceed
- Synthesis - A coordinator agent analyzes all responses:
- Identifies agreements and contradictions
- Critiques logical errors and weak reasoning
- Ranks solutions by correctness and rigor
- Synthesizes the best answer
- Output - Final answer with confidence level (Low/Medium/High) is displayed
Architecture
┌─────────────────────────────────────────────────────────────┐
│ User Query │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Orchestrator │
│ - Spawns N agents concurrently with rate limiting │
│ - Validates success rate (≥50%) │
└─────────────────────────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Agent 1 │ │ Agent 2 │ ... │ Agent N │
│ (T=0.9) │ │ (T=0.9) │ │ (T=0.9) │
└─────────┘ └─────────┘ └─────────┘
│ │ │
└───────────────┼───────────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ Coordinator Agent │
│ - Analyzes agreements/contradictions │
│ - Critiques reasoning │
│ - Synthesizes final answer with confidence │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Final Answer │
│ - Synthesized response │
│ - Confidence level (Low/Medium/High) │
└─────────────────────────────────────────────────────────────┘
Session Logs
When logging is enabled, sessions are saved to ~/.txp/logs/sessions/ in markdown format:
~/.txp/logs/sessions/2024-12-31_143022_abc12345.md
Each log includes:
- Original query
- Final synthesized answer with confidence level
- Agent response summary (success/failure counts, token usage)
- Metadata (timestamps, model versions, cost estimates)
Example Log Structure
# TXP Session Log
**Query ID:** abc12345
**Timestamp:** 2024-12-31T14:30:22
**Model:** us.anthropic.claude-sonnet-4-5-20250929-v1:0
**Agents:** 14/16 successful
## Query
[Your original question]
## Final Answer
**Confidence:** High
[Synthesized answer]
## Agent Summary
| Agent | Status | Tokens | Duration |
|-------|--------|--------|----------|
| 0 | ✓ | 2,341 | 3.2s |
| 1 | ✓ | 2,156 | 2.8s |
...
## Metadata
- **Total Tokens:** 45,234
- **Estimated Cost:** $0.41
- **Total Duration:** 12.5s
Troubleshooting
AWS Credentials Not Found
Error: AWS credentials not found or Unable to locate credentials
Solutions:
-
Configure AWS credentials using AWS CLI:
aws configure --profile your-profile
-
Set the profile in TXP:
txp config set aws-profile your-profile # Or use environment variable export TXP_AWS_PROFILE=your-profile
-
Verify credentials are working:
aws sts get-caller-identity --profile your-profile
Model Not Available
Error: Model not found: <model-id> in region <region>
Solutions:
-
Check available models in your region:
aws bedrock list-foundation-models --region us-east-1 \ --query "modelSummaries[?contains(modelId, 'claude')]"
-
Ensure you have model access enabled in AWS Bedrock console
-
Try a different region:
txp config set region us-west-2
-
Use a different model:
txp config set model anthropic.claude-3-sonnet-20240229-v1:0
Rate Limiting / Throttling
Error: Rate limit exceeded or ThrottlingException
Solutions:
-
Reduce number of agents:
txp config set num-agents 8 # Or for a single query txp --num-agents 4 "Your question"
-
Wait a few minutes before retrying
-
Check your AWS Bedrock quota limits in the AWS console
-
Request a quota increase if needed
Insufficient Agents Error
Error: Insufficient agents succeeded: X/Y
This means fewer than 50% of agents completed successfully.
Solutions:
-
Check for rate limiting (see above)
-
Reduce number of agents:
txp config set num-agents 8
-
Check your network connectivity
-
Run with verbose mode to see agent errors:
txp -v "Your question"
Network / Connectivity Issues
Error: Network error or Connection timeout
Solutions:
-
Check your internet connection
-
Verify AWS services are accessible:
aws bedrock list-foundation-models --region us-east-1
-
Check proxy/firewall settings
-
Try again in a few moments
Timeout Errors
Error: Operation timed out
Solutions:
-
Try with fewer agents for faster response:
txp --num-agents 4 "Your question"
-
Simplify your query
-
Check if AWS Bedrock is experiencing issues
Configuration Issues
Error: Invalid configuration value
Solutions:
-
Reset to defaults:
txp config reset
-
Check valid ranges:
num-agents: 2-32temperature: 0.0-1.0log-retention-days: 1-365
-
View current configuration:
txp config show
Debug Mode
For detailed debugging information, use verbose mode:
txp -v "Your question"
This will show:
- Configuration being used
- Agent execution progress
- Detailed error messages with stack traces
Performance Tips
- Faster responses: Use fewer agents (4-8) for simpler questions
- Better quality: Use more agents (16-24) for complex reasoning
- Cost optimization: Lower
num-agentsreduces API costs - Diverse perspectives: Higher temperature (0.9) gives more varied agent responses
- Focused synthesis: Lower coordinator temperature (0.7) gives more consistent final answers
Development
Setup
# Clone the repository
git clone https://github.com/team-of-experts/txp-cli.git
cd txp-cli
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
Running Tests
# Run all tests
pytest
# Run with verbose output
pytest -v
# Run a specific test file
pytest tests/test_config.py
# Run with coverage
pytest --cov=txp
Code Quality
# Format code
black txp tests
# Lint
ruff check txp tests
# Type check
mypy txp
Testing Changes
After making code changes, they take effect immediately (editable install). Test manually:
txp "your test query"
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file team_of_experts-0.1.0.tar.gz.
File metadata
- Download URL: team_of_experts-0.1.0.tar.gz
- Upload date:
- Size: 59.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bcebaa0f04adfb67451509ee758b24bf92de71e511ce980786efae7fd9ac327
|
|
| MD5 |
4062ca8f868a3fc560fa920aa5747a83
|
|
| BLAKE2b-256 |
53fc9f297d27fd8ad8ec439aa34d0fd25e027c27b456f9f634b8b2f78894d420
|
Provenance
The following attestation bundles were made for team_of_experts-0.1.0.tar.gz:
Publisher:
publish.yml on raghuvaran/team-of-experts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
team_of_experts-0.1.0.tar.gz -
Subject digest:
2bcebaa0f04adfb67451509ee758b24bf92de71e511ce980786efae7fd9ac327 - Sigstore transparency entry: 786738763
- Sigstore integration time:
-
Permalink:
raghuvaran/team-of-experts@de05db5c104434042524d91b52b36e9c29974fc0 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/raghuvaran
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@de05db5c104434042524d91b52b36e9c29974fc0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file team_of_experts-0.1.0-py3-none-any.whl.
File metadata
- Download URL: team_of_experts-0.1.0-py3-none-any.whl
- Upload date:
- Size: 48.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c49e3a3b060e83f6b1ea5b55fb7e406ab628e997fc83738a6e85099173baac39
|
|
| MD5 |
e3bc7a1f5fac96a2084302b0f3470326
|
|
| BLAKE2b-256 |
5c8db9a19740fc67b7ef70af6393ddfedd262f56abd571f8297ab72c83c29a1c
|
Provenance
The following attestation bundles were made for team_of_experts-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on raghuvaran/team-of-experts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
team_of_experts-0.1.0-py3-none-any.whl -
Subject digest:
c49e3a3b060e83f6b1ea5b55fb7e406ab628e997fc83738a6e85099173baac39 - Sigstore transparency entry: 786738764
- Sigstore integration time:
-
Permalink:
raghuvaran/team-of-experts@de05db5c104434042524d91b52b36e9c29974fc0 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/raghuvaran
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@de05db5c104434042524d91b52b36e9c29974fc0 -
Trigger Event:
release
-
Statement type: