Start Here
Deploy your first agent
Create an account
Sign up for an account with Ockam AI to create your new Cluster.
Install
Install ockam
command by running the following in your terminal.
Deploy your first agent
Ensure you have Docker installed and running on your workstation before running the ockam
command.
After that, create an empty directory and run ockam
command to enroll your workstation as an administrator of your newly created Cluster in Ockam AI.
This will generate an Ockam Identity for your workstation and store its secret keys in a file system based Ockam Vault. It will then ask you to authenticate with Ockam Orchestrator to make your workstation’s new Ockam Identity an administrator of your Cluster.
Finally, the above command will download the code for a template hello
app and create a production-ready deployment Zone in your Cluster on our serverless Runtime. Withing seconds, it will put your first AI Agent into production and you can immediately start interacting with it.
Chat with your agent
The hello
app includes an interactive REPL for interacting with your agent:
This agent is running on Ockam’s serverless runtime.
The REPL you access on your local machine runs in the cloud, and you connect to it over a secure & private connection using Ockam’s messaging protocols.
Ask the agent something
Type your instructions and press [ENTER]
to interact with the agent:
The generated code
Within the hello
directory, ockam
has created the following three files:
- The
ockam.yaml
configuration file defines how to deploy a Zone in your Cluster in Ockam AI. - The
images
directory contains the source code of docker images that will be used to run containers in your Zone.- Inside
images
, there is a directory for themain
image.Dockerfile
describe how the main image will be compiled.main.py
is the Python program that is run by the main image.
- Inside
Let’s examine each file:
The ockam.yaml
configuration file defines how to deploy your Zone:
- Create a Zone named
01
. - Create a Pod named
main-pod
inside the01
Zone. - Make the HTTP server, in the
main
container in this pod, public. - Run a
main
container using themain
image. - Set up a portal outlet that will allow you to reach
localhost:9000
in this pod.
The Dockerfile
bases the main
image on the ockam-python
image which already contains the ockam
python package. The Dockerfile
then copies the contents of the images/main
directory into the image and sets main.py
as the program to run when the container is started.
The main.py
file:
- Turns your Python app into an Ockam Node. An Ockam Node in your Cluster can connect with and deliver messages to any other Ockam Node in your Cluster that is running in Ockam AI.
- After the Node is initialized, it invokes the
main
function defined in yourmain.py
file. Themain
function starts an agent with specific instructions (“You are Jack Sparrow”). - It then starts a REPL (interactive shell) server for that agent.
When you run ockam
:
- It builds the code in
images/main
into a container image and pushes that image to a container registry available to your Zone. It then deploys the Zone into your Cluster, in Ockam AI, based on configuration that is specified above inockam.yaml
. - Next, it opens a portal inlet on your workstation that connects to the outlet in the
main-pod
. This creates a portal to the REPL server in yourmain
container and makes that server available on a local port on your workstation. - Finally, it connects a REPL client to the REPL server through this secure portal.