mentor_start_up_agent
No description available
Ask AI about mentor_start_up_agent
Powered by Claude Β· Grounded in docs
I know everything about mentor_start_up_agent. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Luc's AI Agent - CrewAI Digital Twin
A comprehensive CrewAI-powered system that simulates Luc's learning process through collaborative AI agents. Features both a NANDA-based HTTP API server and a modular MCP (Model Context Protocol) package for flexible deployment.
π Features
- Dual-Agent System: Research agent + Content mentor agent
- Multiple Deployment Options: NANDA HTTP API + MCP server package
- Topic-Driven Processing: Send a topic string; get back a clear summary
- Sequential Processing: Agents work together in a structured workflow
- Beginner-Friendly Output: Complex topics explained in simple terms
- Environment Configuration: Uses
.envfor keys and domain config - Modular Architecture: Clean package structure with proper dependencies
π Project Structure
AI Agent/
βββ Assignment_1/
β βββ main.py # NANDA-based HTTP API server
β βββ mentor_mcp/ # MCP server package
β β βββ __init__.py # Package initialization
β β βββ main.py # MCP server implementation
β β βββ __main__.py # Module entry point
β βββ pyproject.toml # Package configuration
β βββ requirements.txt # Python dependencies
β βββ .gitignore # Git ignore patterns
β βββ simclr_explained.md # Example output file
β βββ ai_agent_explained.md # Example output file
β βββ test_local.py # Local testing script
β βββ run_adapter.py # NANDA adapter runner
β βββ README.md
π οΈ Setup
Prerequisites
- Python 3.8 or higher
- Anthropic API key (used by the NANDA wrapper)
Installation
-
Navigate to the project directory:
cd "/Users/lucchen/Desktop/AI Agent" -
Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate -
Install dependencies and package:
cd Assignment_1 pip install -r requirements.txt pip install -e . # Install mentor_mcp package in development mode -
Set up environment variables:
Create a
.envfile in theAssignment_1directory with at least your Anthropic key. Optionally set a domain if you have one:cd Assignment_1 echo "ANTHROPIC_API_KEY=your-anthropic-key-here" > .env echo "DOMAIN_NAME=your-domain.example" >> .env # optionalOr set them as environment variables in your shell:
export ANTHROPIC_API_KEY="your-anthropic-key-here" export DOMAIN_NAME="your-domain.example" # optional
π― Usage
Option 1: NANDA HTTP API Server
-
Start the NANDA server:
python main.py -
Send a message (topic) to the server:
- Provide any technical topic string (e.g., "Machine Learning", "Neural Networks", "SimCLR").
- If an empty message is provided, the default topic is "SimCLR".
- The server returns the final explanation text generated by the crew.
-
Server details:
- The NANDA adapter starts an HTTP API and handles routing
- Check the terminal logs for the exposed URL and usage details
Option 2: MCP Server Package
-
Run as a module:
python -m mentor_mcp -
Run using the CLI command:
mentor_mcp -
Use in your code:
from mentor_mcp import crew_agent_logic result = crew_agent_logic("Machine Learning") print(result)
Example Flow
# NANDA Server
$ python main.py
# NANDA starts and prints server information / public URL (if configured)
# Use that endpoint to POST a message containing your topic string
# MCP Server
$ python -m mentor_mcp
# MCP server starts and listens for stdio transport
Output
The server returns a text response with:
- Clear definitions
- Key concepts explained simply
- How things work (step-by-step)
- Real-world examples
- Why it's important
π§ Configuration
Customizing Agents
You can modify the agents in either main.py (NANDA version) or mentor_mcp/main.py (MCP version):
- Research Agent: Change the role, goal, or backstory
- Mentor Agent: Adjust the simplification approach
- LLM Settings: Specify different models or temperature settings
Example customization:
def create_student_agent():
return Agent(
role="Harvard Data Science Student",
goal="Summarize technical concepts clearly and accurately",
backstory="""You are Luc, a Harvard Data Science student...""",
verbose=True,
allow_delegation=False,
model="gpt-4o-mini", # Specify model
temperature=0.2 # Control randomness
)
Package Development
To modify the MCP package:
- Edit the package code in
mentor_mcp/ - Reinstall in development mode:
pip install -e . - Test changes using any of the run methods above
π Troubleshooting
Common Issues
-
"No module named 'crewai'"
- Make sure you're in the virtual environment
- Run
pip install -r requirements.txt
-
API Key Error
- Verify
ANTHROPIC_API_KEYis set correctly in your.envor shell - Check that you have sufficient API credits
- Ensure the
.envfile is in theAssignment_1directory
- Verify
-
Server Not Reachable
- Confirm the server is running in the terminal
- If using a custom
DOMAIN_NAME, verify DNS/routing is correctly configured - Check local firewall or network restrictions
-
Import Errors
- Make sure all dependencies are installed
- Check that you're running from the correct directory
Performance Tips
- Use
gpt-4o-minifor faster, cheaper runs - Set
temperature=0.2for more consistent outputs - Add specific output length requirements in task descriptions
- Use virtual environments to avoid dependency conflicts
π Dependencies
Core Dependencies
crewai: Multi-agent orchestration frameworkpython-dotenv: Environment variable managementnanda-adapter: Wrapper that exposes Crew logic via an HTTP APIrequests: Utility HTTP client for integrations/tests
Package Dependencies (pyproject.toml)
crewai>=0.30.0: Multi-agent orchestration frameworkmcp>=1.0.0: Model Context Protocol server frameworkrequests: HTTP client librarynanda-adapter: NANDA integration adapter
π How It Works
NANDA HTTP API Flow
- Research Agent: Acts as a Harvard Data Science student, researching and summarizing technical topics
- Mentor Agent: Takes the research and rewrites it in beginner-friendly language
- Sequential Process: Agents work one after another, with the mentor building on the research
- HTTP Response: The final explanation is returned as text via the NANDA server API
MCP Server Flow
- Same Agent Logic: Uses identical CrewAI agents and workflow
- MCP Protocol: Exposes the functionality via Model Context Protocol
- Tool Interface: Provides
explain_topictool for MCP clients - Stdio Transport: Communicates via standard input/output for MCP integration
π€ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
π License
This project is part of the MIT AI Studio - CrewAI Tech Track.
π Support
If you encounter issues:
- Check the troubleshooting section above
- Verify your API keys and dependencies
- Ensure you're running from the correct directory
- Check the CrewAI documentation for advanced configuration
π Example Output
When you send a topic like "SimCLR" to either server, the response contains a clear explanation with:
- Definition: What the concept is
- Key Concepts: Core ideas explained simply
- How It Works: Step-by-step breakdown
- Example Applications: Real-world use cases
- Why It Matters: Importance and relevance
π§ͺ Testing
Local Testing
Use the included test_local.py script to test the CrewAI logic directly:
python test_local.py
NANDA Adapter Testing
Use run_adapter.py for testing the NANDA integration:
python run_adapter.py
π Deployment Options
- NANDA HTTP API: Perfect for web applications and external integrations
- MCP Server: Ideal for AI tool integrations and MCP-compatible clients
- Direct Import: Use
crew_agent_logicfunction in your own Python applications
Happy Learning with Luc's AI Agents! πβ¨
