This project demonstrates how specialized AI agents can collaborate to solve complex, multi-step tasks within the Cursor IDE.
The primary goal is to showcase the orchestration capability of Cursor's agentic framework. By defining a high-level "Trip Planner" agent that coordinates with specialized "Flight" and "Hotel" researchers, we illustrate a modular and scalable approach to automated problem-solving.
- Multi-Agent Collaboration: Transparent delegation of sub-tasks from a primary agent to specialized sub-agents.
- Skill-Based Execution: Integration of custom "Agent Skills" that execute shell scripts to perform specific actions (e.g., searching data).
- @trip-planner: Orchestrates the entire trip planning process by delegating tasks to specialized agents.
- @flight-researcher: Researches flight options based on origin and destination.
- @hotel-researcher: Researches hotel accommodations at the destination.
- @research-flight: Executes flight search scripts to retrieve travel options.
- @research-hotel: Executes hotel search scripts to retrieve accommodation details.
graph TD
TripPlanner[Trip Planner Agent] --> FlightResearcher[Flight Researcher Agent]
TripPlanner --> HotelResearcher[Hotel Researcher Agent]
FlightResearcher --> ResearchFlight[Research Flight Skill]
HotelResearcher --> ResearchHotel[Research Hotel Skill]
To run the demonstration:
-
Open the Cursor IDE in this repository.
-
Open the Chat panel (
Cmd+LorCtrl+L). -
Use the
@trip-planneragent by typing its name or using the/trip-plannerslash command (if configured). -
Provide a prompt such as:
I want to go to San Francisco from NYC. Please write a trip report in @reports/plan_to_san_francisco/trip_plan.md and logs in @reports/plan_to_san_francisco/task_logs.md. -
Observe how Cursor orchestrates the sub-agents and generates the requested files.
.cursor/agents/: Contains agent definitions (YAML-frontmatter Markdown) defining their roles and capabilities..cursor/skills/: Defines custom skills that agents can use, including the scripts they execute.reports/: The output directory for generated trip plans and task logs.docs/: Project documentation and assets, including screenshots.
The orchestration follows a hierarchical pattern:
- Agent Definition: Each agent is defined in
.cursor/agents/. For example,trip-planner.mddefines its ability to collaborate withflight-researcherandhotel-researcher. - Skill Integration: Agents use skills defined in
.cursor/skills/. Each skill maps to a specific action, such as executing a shell script. - Simulation Scripts: For this demo, flight and hotel searches are simulated using Bash scripts (
research_flight.shandresearch_hotel.sh) that return randomized results to illustrate the data flow. - Mermaid Generation: The
trip-planneris instructed to generate a Mermaid diagram in the task logs to visualize the actual execution path taken during the task.
I submit the following prompt to Cursor IDE:
/trip-planner I want to go to San Francisco from NYC.
Please write a trip report in @reports/plan_to_san_francisco/trip_plan.md .
You have to comprehensively and precisely leave logs what and how you address the tasks with a diagram in Mermaid in @reports/plan_to_san_francisco/task_logs.md .
You have to show a diagram of what you address the task in the plan.
