AGENTS
Agents
Ockam Agents are intelligent autonomous actors.
Ockam Agents are intelligent autonomous actors powered by large language models. They understand natural language, engage in conversations, and perform complex tasks. Each agent:
- Maintains a unique identity and long-running conversations
- Accepts customization with specific knowledge and capabilities
- Runs securely in an isolated environment
- Communicates with other agents and systems using Ockam’s secure messaging protocols
There are three key files that define an agent. First is the ockam.yaml
file:
ockam.yaml
The ockam.yaml
file above defines:
name: example001
- A unique name for this deployment zonepods
- A list of pods to run in the zonename: main-pod
- The name of the podpublic: true
- Makes the pod accessible from the internetcontainers
- The containers to run in the podname: main
- Container nameimage: main
- References the image built from theDockerfile
located atimages/<value>/Dockerfile
This minimal configuration creates a deployment that runs our agent code.
Next is the Dockerfile
file:
images/main/Dockerfile
The Dockerfile
above:
- Uses the official Ockam Python base image which includes the Ockam SDK
- Copies the agent code (main.py and other files) into the container
- Sets the entrypoint to run main.py when the container starts
Finally is the main.py
file:
images/main/main.py
The main.py
file above:
- Imports the Ockam SDK
- Defines an async main function that starts an agent with a specific prompt
- Starts the node and agent
Ensure you have Docker installed and running on your workstation before running the
ockam
command.When you run ockam
it will:
- Build the image from the Dockerfile
- Deploy the container to the Ockam serverless runtime
- Expose a public HTTP endpoint to the agent
- Create two local (i.e., on your workstation) portals to the agent’s HTTP endpoint and log output.
Logs
You can see the logs of your running python app on http://localhost:3000/logs/explorer
.