Quickstart
Run your first Modus app in a few minutes
Your first Modus app
In this quickstart, you’ll learn to build your first Modus app with a single function that demonstrates how to integrate external APIs with AI models. We’ll start with this stateless function, and later you can learn about building stateful agents that maintain memory and coordinate complex operations.
Our examples use Go, which we recommend for new projects. You can also choose AssemblyScript if you prefer. For AssemblyScript usage, refer to the AssemblyScript SDK overview.
Prerequisites
- Node.js - v22 or higher
- Text editor - we recommend VS Code
- Terminal - access Modus through a command-line interface (CLI)
Building your first Modus app
Install the Modus CLI
Install the Modus CLI to manage your Modus applications.
Create a new app
Create your first Modus app.
Choose between Go and AssemblyScript. Both compile to WebAssembly for fast performance.
Run your app locally
Start your local development server:
This starts your app and provides a URL to access the API.
Add external connections
To connect to external services, add this to your modus.json
:
Add an AI model
Add an AI model to your manifest:
Set up model access
Install and authenticate with the Hyp CLI to access Hypermode-hosted models:
Authenticate with your Hypermode account:
This connects your local development environment to Hypermode’s model infrastructure.
Create your first function
Create a function that fetches data from an external API and uses AI for analysis:
Create intelligence.go
:
Test your function
Restart your development server:
Modus automatically generates a GraphQL API from your functions.
Since your function is named GatherIntelligence()
, it becomes a GraphQL query field called gatherIntelligence
.
Open the Modus API Explorer at http://localhost:8686/explorer
to test your function.
The explorer is fully GraphQL-compatible, so you can issue this query:
You’ll receive a response like:
Your function now:
- Fetches data from external APIs
- Uses AI models for analysis
- Provides intelligent responses
- Handles errors gracefully
Monitor AI calls
When running locally, Modus records every AI model call for monitoring and debugging. You can see this in the Modus explorer.
Local inference tracking is supported on Linux and macOS. Windows support is incoming.
You can monitor:
- Requests sent to AI models
- Response times and token usage
- Model performance metrics
- Error rates and debugging info
What’s next?
You’ve successfully built your first Modus function. But this is just the beginning. Real agents maintain memory, coordinate complex operations, and never lose their context.
Ready to upgrade from simple functions to stateful agents? Check out What’s an Agent? to learn how to build persistent, memory-enabled agents that remember every interaction and can coordinate sophisticated multi-step operations.
For more mission templates and advanced operations, explore the Modus recipes.