Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This an implementation of an agent that works for a condensed matter physics lab.

caidish/labAgent

Repository files navigation

Lab Agent - Multi-Agent System for Laboratory Automation

A multi-agent system for laboratory automation and research, specializing in automated research paper monitoring, device control, and AI-powered analysis for condensed matter physics labs.

πŸš€ Quick Start

1. Installation

# Clone the repository
git clone https://github.com/caidish/labAgent.git
cd labAgent

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env

2. Configuration

Edit .env file with your API keys:

# Required for ArXiv Daily Updates and MCP Tools
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-5

# Optional  
GOOGLE_API_KEY=your_google_api_key_here
GEMINI_MODEL=gemini-2.0-flash-exp
DEBUG=false
LOG_LEVEL=INFO

3. Run the System

# Web Interface (Recommended)
streamlit run lab_agent/web/app.py

# Command Line Interface
python -m lab_agent.main

✨ Features

πŸ“š ArXiv Daily Paper Recommendations (Ready)

  • Automated Scraping: Fetches latest papers from arXiv cond-mat/new
  • AI-Powered Scoring: GPT-4 rates paper relevance (1-3 priority levels)
  • Smart Filtering: Focuses on 2D materials, graphene, TMDs, quantum devices
  • Beautiful Reports: Generates HTML reports with priority sections
  • Web Interface: Manual trigger, report viewing, and management
  • No Database: Simple file-based storage

Usage: Navigate to "πŸ“š ArXiv Daily" tab β†’ Click "Generate Daily Report"

πŸ”¬ Planned Features

  • MCP Server for Microscope Control: Nikon glovebox microscope automation
  • Deep Learning Tool Integration: Automated flake analysis and scoring
  • Multi-Agent Coordination: OpenAI and Google Gemini integration
  • Real-time Communication: WebSocket support for agent coordination

πŸ“ Project Structure

labAgent/
β”œβ”€β”€ lab_agent/                     # Main package
β”‚   β”œβ”€β”€ agents/                    # Agent implementations
β”‚   β”‚   β”œβ”€β”€ base_agent.py         # Abstract base class
β”‚   β”‚   └── arxiv_daily_agent.py  # ArXiv monitoring agent
β”‚   β”œβ”€β”€ tools/                    # Agent capabilities
β”‚   β”‚   β”œβ”€β”€ arxiv_daily_scraper.py # Web scraping for ArXiv
β”‚   β”‚   β”œβ”€β”€ paper_scorer.py       # GPT-4 paper scoring
β”‚   β”‚   β”œβ”€β”€ daily_report_generator.py # HTML/JSON reports
β”‚   β”‚   β”œβ”€β”€ web_scraper.py        # General web scraping
β”‚   β”‚   └── arxiv_parser.py       # ArXiv API integration
β”‚   β”œβ”€β”€ utils/                    # Utilities
β”‚   β”‚   β”œβ”€β”€ config.py             # Environment configuration
β”‚   β”‚   └── logger.py             # Logging setup
β”‚   β”œβ”€β”€ config/                   # Configuration files
β”‚   β”‚   β”œβ”€β”€ interestKeywords.txt  # Research interest keywords
β”‚   β”‚   └── promptArxivRecommender.txt # GPT scoring prompts
β”‚   └── web/                      # Streamlit interface
β”‚       └── app.py                # Main web application
β”œβ”€β”€ requirements.txt              # Python dependencies
β”œβ”€β”€ setup.py                     # Package configuration
β”œβ”€β”€ .env.example                 # Environment template
β”œβ”€β”€ CLAUDE.md                    # Project context for Claude Code
β”œβ”€β”€ TESTING_GUIDE.md            # Comprehensive testing protocol
└── README.md                   # This file

πŸ§ͺ Testing

Follow the comprehensive testing guide in TESTING_GUIDE.md:

# Quick test - verify system works
streamlit run lab_agent/web/app.py
# β†’ Go to ArXiv Daily tab β†’ Generate Daily Report

# Full testing protocol
cat TESTING_GUIDE.md

πŸ”§ Configuration

Research Interest Keywords

Edit lab_agent/config/interestKeywords.txt to customize paper filtering:

# 2D Materials & Graphene
2D materials
graphene
monolayer graphene
transition metal dichalcogenides
van der Waals heterostructures
# ... add your research areas

AI Scoring Prompts

Modify lab_agent/config/promptArxivRecommender.txt for different evaluation criteria.

πŸ“Š Usage Examples

Generate Daily ArXiv Report

from lab_agent.agents.arxiv_daily_agent import ArxivDailyAgent
import asyncio

# Initialize agent
agent = ArxivDailyAgent({'reports_dir': './reports'})
await agent.initialize()

# Generate report
task = {
    'type': 'generate_daily_report',
    'url': 'https://arxiv.org/list/cond-mat/new'
}
result = await agent.process_task(task)
print(f"Generated report with {result['total_papers']} papers")

Use Web Interface

  1. Start Application: streamlit run lab_agent/web/app.py
  2. Navigate: Go to "πŸ“š ArXiv Daily" tab
  3. Generate: Click "πŸ”„ Generate Daily Report"
  4. View: Expand report section to see results
  5. Manage: Use "πŸ—‘οΈ Clear All Reports" to cleanup

πŸ› οΈ Development

Install in Development Mode

pip install -e .

# Use console entry points
lab-agent        # CLI version
lab-agent-web    # Web version

Architecture

  • Async-first: All agents built on asyncio
  • Modular Design: Separate agents, tools, and utilities
  • Configuration-driven: Environment-based settings
  • Tool-based: Agents use composable tools for capabilities

πŸ” Troubleshooting

Common Issues

"ArXiv agent not available"

  • Check OpenAI API key in .env file
  • Verify API key is valid and has credits

"No papers found"

  • Check internet connection
  • Verify ArXiv website is accessible

Slow GPT scoring

  • Normal for 20+ papers (includes rate limiting)
  • Consider upgrading to higher tier OpenAI plan

Permission errors

  • Ensure write permissions in project directory
  • Check ./reports/ directory can be created

Debug Mode

Enable detailed logging:

# In .env file
DEBUG=true
LOG_LEVEL=DEBUG

πŸ—ΊοΈ Roadmap

Phase 1: Test (Current)

  • βœ… Milestone 0: ArXiv Daily Update System
  • 🚧 Milestone 1: MCP Server for Nikon Microscope
  • βœ… Milestone 2: Deep Learning Tool Integration
  • πŸ“‹ Milestone 3: Multi-Agent SDK Wiring

Phase 2: Framework

  • General scaling framework and best practices

Phase 3: AI-Ready Lab

  • Advanced automation capabilities

πŸ“„ License

MIT License - see LICENSE file for details

🀝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“ž Support

  • Issues: GitHub Issues
  • Documentation: See CLAUDE.md for detailed project context
  • Testing: Follow TESTING_GUIDE.md for validation

Built for condensed matter physics research labs πŸ”¬βš›οΈ

About

This an implementation of an agent that works for a condensed matter physics lab.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages