Skip to content

How Monk Works

Monk is a multi-agent system that adjusts its behavior based on the context of your project and your prompts, most of its work is done in the background, however, the system always follows the workflow described below.

Monk operates in three main phases: Build, Run and Manage. Monk intelligently decides which phase is appropriate based on context and your prompts.

Build Phase

This is typically the first phase Monk will enter when you open a new project. Monk:

  • Analyzes your project’s source code
  • Containerizes components that need to be containerized (writes and tests Dockerfiles)
  • Writes deployment configuration
  • Fetches and configures runtime dependencies (like databases)

After the build phase completes, you’ll see new files in your workspace:

  • MANIFEST file: Lists created files and Monk metadata
  • YAML file: Contains deployment configuration, see MonkScript for more details
  • Dockerfiles: For containerized components

While you can edit these files manually or with Copilot’s help, they’re primarily meant to be managed by Monk, which does an excellent job configuring them.

If something goes wrong, you can always ask Monk to rebuild the project.

Run Phase

This is typically the second phase after the project has been built during the build phase. Monk invokes its underlying engine to:

  • Start the project locally on your machine (similar to docker-compose)
  • Deploy it to cloud or serverless providers to make it live

Manage Phase

Monk uses its underlying engine to track your project and all of its components at runtime. It can:

  • Restart your project if it crashes
  • Read and analyze logs to provide you with insights
  • Check the status and health of your project and its components
  • Automatically update your project if there are new versions of its components

Monk’s Principles

Monk adheres to these core principles:

  • Do as much as possible autonomously while ensuring correct output
  • Ask only when necessary
  • Explain key details succinctly
  • Validate all actions and output using a non-AI ruleset
  • Never expose or generate secrets using the LLM

For more detailed technical information, see our Technical FAQ.