Local developement with AgentifyMe allows you to work on your project locally without any dependencies or in a self-contained docker environment. Working locally has sever advantages, such as:

  • Faster development: You can make changes and see results instantly without waiting for remote deployment
  • Easy debugging: You can easily debug your code and workflows without the need to setup a cloud environment
  • Logging and monitoring: If your account is connected to a cloud environment, you can easily monitor and log your workflows and executions in the cloud console

Prerequisites

Before you begin, ensure you have:

  • Python installed (Mac or Linux systems only)
  • Docker (optional, for containerized development)
  • AgentifyMe CLI installed

Getting Started

Installing the CLI

Install the AgentifyMe CLI to begin local development:

bash
curl -LsSf https://agentifyme.ai/cli.sh | bash

Connecting to Cloud Environment (Optional)

To enable logging and monitoring, connect your local environment to the cloud:

bash
agentifyme login

You can follow the instructions here to connect your account to a cloud environment.

Start local development

We only support local development for Python projects on Mac and Linux systems. Support for other languages and operating systems will be added soon.

To get started with local development, you need to install the AgentifyMe CLI. You can find the installation instructions here. Once you have installed the CLI, connect your account to a cloud environment to monitor your workflows and executions. You can follow the instructions here to connect your account to a cloud environment.

Using the CLI

The simplest way to start local development is using the CLI directly:

bash
agentifyme dev
output
16:00:48 INF 1 dev/run.go:55 > callerfunc="dev.Run" Loaded .env file 16:00:48 INF 1 dev/run.go:58 > callerfunc="dev.Run" Run dev.. 16:00:48 INF 1 dev/run.go:86 > callerfunc="dev.Run" Registering reflection 16:00:48 INF 23 dev/run.go:101 > callerfunc="dev.Run.func1" Server listening at [::]:63418 16:00:48 INF 24 dev/run.go:194 > callerfunc="dev.startHTTPGateway" port=63419 HTTP gateway started Started Python process with PID: 59210 2025-01-21 16:00:49.606 | INFO | agentifyme.worker.entrypoint:run:56 - Loading environment variables 2025-01-21 16:00:49.607 | INFO | agentifyme.worker.entrypoint:get_package_version:162 - agentifyme version: 0.1.25

The development server provides;

  • gRPC Gateway on port 63418
  • HTTP Gateway on port 63419
  • Automatic code reloading
  • Local debugging support

Using Docker

For containerized development, we use recommend using Docker Desktop and Docker Compose. This is useful if you want to use a specific version of Python or if you want to use a specific version of AgentifyMe.

You need to install the AgentifyMe CLI in the container to run the development server. You can do this by adding the following to your Dockerfile:

dockerfile
RUN curl -LsSf https://agentifyme.ai/install.sh | bash ENV PATH="${PATH}:/root/.agentifyme/bin"

Use the following docker-compose.yml file to start the development server:

docker-compose.yml
services: app: build: . entrypoint: ["sh", "-c"] command: ["agentifyme dev"] ports: - 63420:63418 # gRPC Gateway - 63421:63419 # HTTP Gateway develop: watch: - action: sync+restart path: ./src target: /app/src ignore: - .venv/

Start the environment with:

bash
docker compose up

Invoke workflows locally

For both the CLI and docker approach, you can invoke workflows locally either using the REST API or the client SDK. Please use the HTTP Gateway port (63421) to invoke workflows locally.

Using the REST API

Run the workflow using the following command:

bash
curl --location 'http://localhost:63421/v1/workflows/run' \ --header 'Content-Type: application/json' \ --data '{ "name": "<name-of-your-workflow>", "parameters": { "param_a": "value_a", "param_b": "value_b" }, "metadata": {} }'

Client SDK

To run workflow using the Python SDK, you can use the following code:

python
from agentifyme import Client try: # Initialize local client client = Client(local_mode=True) # Run workflow response = client.run_workflow( name="example-workflow", parameters={ "param_a": "value_a", "param_b": "value_b" } ) except Exception as e: print(f"Workflow execution failed: {e}")

Python SDK supports both Sync and Async clients. For configuration andmore information on the client SDK, please refer to the client SDK documentation.

Troubleshooting

Common issues and solutions:

  1. Port Conflicts

    • Check if ports 63418/63419 are available
    • Use different ports in Docker Compose if needed
  2. Connection Errors

  • Verify the development server is running
  • Check your firewall settings
  • Ensure correct local URLs are used
  1. Code Reload Issues
  • Verify the code is being reloaded
  • Check for syntax errors or missing imports
  • Use the --watch flag to see what files are being watched

Getting Help

  • Support: support@agentifyme.ai