A comprehensive offline testing framework for multi-domain biomarker analysis using agentic workflows. This system provides mock LLM clients and demo agents to test the complete workflow without making actual API calls.
- Multi-Domain Support: Methylation, Metagenomics, Proteomics, Transcriptomics, Whole Exome, and Whole Genome analysis
- Agentic Workflow: Analysis, Summary, and Recommendation agents for each domain
- Offline Testing: Complete testing suite using mock LLM clients
- Comprehensive Logging: Detailed logs for each agent and domain
- Test Data: Realistic test data for all domains
- Prompt Management: Centralized prompt management system
biomarker-agentic-qna/
├── agents/ # Agent implementations
│ ├── common/ # Common agent types
│ ├── methylation/ # Methylation domain agents
│ ├── metagenomics/ # Metagenomics domain agents
│ ├── proteomics/ # Proteomics domain agents
│ ├── transcriptomics/ # Transcriptomics domain agents
│ ├── whole_exome/ # Whole exome domain agents
│ ├── whole_genome/ # Whole genome domain agents
│ └── demo_agent.py # Demo agent for testing
├── utils/ # Utility modules
│ ├── prompt_manager.py # Prompt management system
│ ├── mock_llm_client.py # Mock LLM client for offline testing
│ └── ...
├── user_data/ # Test data for each domain
│ ├── methylation/
│ ├── metagenomics/
│ ├── proteomics/
│ ├── transcriptomics/
│ ├── whole_exome/
│ └── whole_genome/
├── testing_logs/ # Test execution logs and reports
├── test_agentic_workflow.py # Comprehensive testing script
├── test_simple_demo.py # Simple demo test script
└── README.md # This file
-
Clone the repository:
git clone <your-repo-url> cd biomarker-agentic-qna
-
Install dependencies (if any):
pip install -r requirements.txt
-
Run the tests:
# Quick test python3 test_simple_demo.py # Full comprehensive test python3 test_agentic_workflow.py
Run a simple test to verify the system works:
python3 test_simple_demo.pyRun the full test suite that tests all agents and domains:
python3 test_agentic_workflow.pyAfter running tests, check the results in:
- Terminal output: Real-time test results
testing_logs/: Detailed logs and reportstest_execution.log: Main test execution logtest_report.json: Machine-readable test results- Domain-specific logs:
testing_logs/<domain>/<agent>_agent.log
- File:
utils/mock_llm_client.py - Purpose: Simulates LLM responses without making actual API calls
- Features: Domain-specific response templates, realistic response generation
- File:
agents/demo_agent.py - Purpose: Tests the complete agentic workflow
- Features: Prompt formatting, user data loading, comprehensive logging
- File:
utils/prompt_manager.py - Purpose: Manages prompts for all domains and agents
- Features: Dynamic prompt loading, template formatting
| Domain | Description | Agents |
|---|---|---|
| Methylation | DNA methylation and epigenetic analysis | Analysis, Summary, Recommendation |
| Metagenomics | Gut microbiome analysis | Analysis, Summary, Recommendation |
| Proteomics | Protein expression analysis | Analysis, Summary, Recommendation |
| Transcriptomics | Gene expression analysis | Analysis, Summary, Recommendation |
| Whole Exome | Whole exome sequencing analysis | Analysis, Summary, Recommendation |
| Whole Genome | Whole genome analysis | Analysis, Summary, Recommendation |
Each domain has its own log directory with agent-specific logs:
testing_logs/
├── methylation/
│ ├── analysis_agent.log
│ ├── summary_agent.log
│ └── recommendation_agent.log
├── metagenomics/
│ └── ...
└── ...
- INFO: Successful operations, processing times, response details
- ERROR: Failed operations, missing data, formatting errors
- WARNING: Non-critical issues, fallback to mock data
- Success Rate: Overall test success percentage
- Processing Times: Time taken for each agent
- Response Lengths: Size of generated responses
- Error Details: Specific error messages and causes
from agents.demo_agent import DemoAgent
# Test methylation analysis
agent = DemoAgent(domain="methylation", agent_type="analysis", user_id="test_user_001")
result = agent.process()
print(f"Success: {result['success']}")
print(f"Response: {result['response'][:200]}...")domains = ["methylation", "metagenomics", "proteomics"]
for domain in domains:
agent = DemoAgent(domain=domain, agent_type="analysis", user_id="test_user_001")
result = agent.process()
print(f"{domain}: {'✓' if result['success'] else '✗'}")- Create domain directory in
agents/ - Add
prompts.jsonwith agent templates - Create test data in
user_data/<domain>/ - Update domain mapping in
demo_agent.py
Edit files in user_data/<domain>/<user_id>_report.txt to customize test scenarios.
Modify utils/mock_llm_client.py to change response templates and behavior.
The system tracks:
- Processing Time: Time taken for each agent
- Success Rate: Percentage of successful tests
- Response Quality: Length and content of responses
- Error Analysis: Detailed error tracking and categorization
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
[Add your license information here]
For issues and questions:
- Check the logs in
testing_logs/ - Review the test reports
- Open an issue with detailed error information
Note: This is an offline testing system designed for development and validation. For production use, replace the mock LLM client with actual LLM API clients.