Skip to content

Simplified Example Workflow

Alexander Hamilton edited this page Dec 4, 2024 · 1 revision

To illustrate how the Principles Framework operates, let's walk through a practical example. This example demonstrates the process of generating specialized agents based on a singular goal and using them to process prompts effectively.

Scenario

Goal: Optimize a daily schedule to improve productivity.

Objective: Create an AI assistant that can analyze tasks, prioritize them, and suggest an optimized schedule aligned with energy levels.

Step 1: Generate Agents Based on a Singular Goal

Command

npm run generate-agents "I want to improve my productivity by optimizing my daily schedule."
# or
yarn generate-agents "I want to improve my productivity by optimizing my daily schedule."

What Happens

  1. First Principles Breakdown:

    • Time Management: Efficient allocation of time slots.
    • Task Prioritization: Identifying high-impact tasks.
    • Energy Level Assessment: Aligning tasks with peak energy periods.
  2. Agent Generation:

    • Time Management Agent: Suggests optimal time allocation.
    • Task Prioritization Agent: Ranks tasks based on importance and urgency.
    • Energy Assessment Agent: Aligns tasks with your energy levels throughout the day.
  3. Package Creation:

    • A new package directory is created under packages/ with a unique name, e.g., agent-package-1633036800000.
    • Includes all necessary configurations and code for the generated agents.

Output

You should see confirmation messages indicating the creation of agents and the package.

Created agentsConfig.ts at /path/to/principles/packages/agent-package-1633036800000/src/config/agentsConfig.ts
Created index.ts at /path/to/principles/packages/agent-package-1633036800000/src/index.ts
Copied .env to /path/to/principles/packages/agent-package-1633036800000/.env
Installing dependencies in /path/to/principles/packages/agent-package-1633036800000...
# npm install logs...

Building the package in /path/to/principles/packages/agent-package-1633036800000...
# tsc logs...

Package agent-package-1633036800000 created successfully.
Current package name saved to /path/to/principles/current_package.txt

Step 2: Use the Agents to Process Prompts

Command

Navigate to the generated package directory and run the agents with a test prompt.

cd packages/agent-package-1633036800000/
npm run run-agents "I have high energy in the mornings and tend to feel sluggish after lunch. My tasks today are writing a report, team meeting, and responding to emails. What's the best schedule for me?"
# or
yarn run-agents "I have high energy in the mornings and tend to feel sluggish after lunch. My tasks today are writing a report, team meeting, and responding to emails. What's the best schedule for me?"

What Happens

  1. Compile the Project:

    • Ensures that all generated agents are compiled and ready for execution.
  2. Run the Agents:

    • Executes each specialized agent to process the provided prompt.
    • Agents collaborate to generate a comprehensive and optimized schedule.
  3. Display Results:

    • Presents the optimized schedule along with reasoning and additional suggestions.

Expected Output

{
  "optimizedSchedule": [
    {
      "time": "9:00 AM - 11:00 AM",
      "task": "Writing the report",
      "reason": "High-priority task aligned with peak energy levels."
    },
    {
      "time": "11:30 AM - 12:30 PM",
      "task": "Team meeting",
      "reason": "Collaborative task scheduled before lunch."
    },
    {
      "time": "2:00 PM - 4:00 PM",
      "task": "Responding to emails",
      "reason": "Less demanding task scheduled during lower energy period."
    }
  ],
  "additionalSuggestions": [
    "Take a short walk after lunch to boost energy.",
    "Prioritize deep work tasks in the morning."
  ]
}

Interpreting the Output

  • Optimized Schedule: The agents have provided a structured schedule that aligns tasks with your energy levels, ensuring that high-priority tasks are addressed during peak productivity periods.
  • Reasons Provided: Each scheduling decision is accompanied by reasoning based on the fundamental components, such as energy levels and task importance.
  • Additional Suggestions: Offers practical tips to further enhance productivity and maintain energy throughout the day.

Summary

This example demonstrates how the Principles Framework efficiently generates specialized agents based on a singular goal, utilizes first principles thinking to deconstruct the goal, and collaborates to provide optimized solutions. By breaking down complex objectives into fundamental components, Principles ensures that each aspect is addressed with precision, resulting in effective and tailored AI-driven outcomes.

Clone this wiki locally