Documentation
Docs
Getting Started

Deploying Your First Agent

Transform a simple Python script into a production-grade KAgent in minutes.

The Agent-Native Edge

In Consonant, an "Agent" is more than just a model call. It is a Managed Service. When you deploy an agent, Consonant automatically handles:

  • Health Monitoring: Restarts your agent if it hangs or loops.
  • Resource Capping: Ensures a runaway agent doesn't kill your cluster.
  • Identity: Assigns an mTLS certificate for secure communication.

Step 1: Write Your Logic

You can use any framework (LangGraph, CrewAI, AutoGen) or just raw Python. The only requirement is to wrap your agent in the Consonant library to expose its "Tools" to the Control Plane.

python
# agent.py
from consonant.agent import Agent

# Define your agent's identity
agent = Agent(name="market-analyzer")

@agent.tool
def get_stock_price(symbol: str) -> float:
    """Returns the current mock price of a stock"""
    return 150.0 # Your real logic here

if __name__ == "__main__":
    # This starts the agent execution loop inside the container
    agent.run()

Step 2: The Agent Manifest

This is the most important part. The manifest defines the **Production Envelope** for your agent.

yaml
# consonant.yaml
apiVersion: consonant/v1
kind: Agent
metadata:
  name: market-analyzer
spec:
  image: harbor.internal/agents/analyzer:v1.0.2
  resources:
    cpu: "250m"      # Hard CPU limit
    memory: "512Mi"  # Hard RAM limit
  scaling:
    minReplicas: 1
    maxReplicas: 5   # Automatic horizontal scaling

Step 3: Apply & Scale

Unlike a manual Docker run, cons apply registers your agent with the Control Plane's Service Registry, making it immediately available for any complex "Goal" workflows.

bash
# Push your image to your registry
docker build -t harbor.internal/agents/analyzer:v1.0.2 .
docker push harbor.internal/agents/analyzer:v1.0.2

# Deploy to the cluster
cons apply -f consonant.yaml

Success: Agent registered. It is now isolated and managed.