Skip to content
Konstera
Docs · Get started
Konstera documentation.

Getting started, SDK quickstart, manifest reference, kernel MCP services, deploy guide and FAQ — everything you need to build and run agents on Konstera.

Interactive walkthrough — build your first agent

Twelve numbered steps from zero to a deployed agent handling real invocations. Pick a language at step 1 and follow through — each step builds on the previous.

What you'll have at the end
A deployed agent handling real invocations, with ctx.state persisting a counter across calls and a full trace for every invocation.
Time
~30 min
Level
Beginner
You need
Python 3.11+ OR .NET 10 SDK OR Node 20+DockerA text editorInternet access (first-time) for package downloads
FlowThe twelve steps in four stages — verify after each step Interactive — click a block

Step 1 — Pick a language + make a folder#

Choose the SDK matching your team's primary language:

LanguageRecommended forWhy
PythonTeams new to KonsteraMost mature, best coding-agent support
TypeScriptTeams already using NodeErgonomic HTTP server, dual ESM/CJS
.NET / C#Microsoft stackStrong typing, full LINQ

Then:

Terminal
mkdir my-first-agent
cd my-first-agent

Step 2 — Install the SDK#

Pick the install command for your language:

Terminal
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install konstera-sdk

Step 3 — Write the minimum agent#

The simplest agent: echo whatever's in req.input. Create one file — main.py (Python), main.ts (TypeScript) or Program.cs (.NET):

Python
from konstera_sdk import Agent, AgentContext, AgentRequest, AgentResponse, run


class HelloAgent(Agent):
    async def handle(
        self, req: AgentRequest, ctx: AgentContext
    ) -> AgentResponse:
        name = req.input.strip() or "world"
        await ctx.log.info(f"Hello, {name}!", echo_of=name)
        return AgentResponse(content=f"Hello, {name}!")


if __name__ == "__main__":
    run(HelloAgent())

Step 4 — Run it locally in direct-run mode#

The SDK's run() detects an unset KONSTERA_KERNEL_MCP_URL and boots in direct-run mode. The HTTP server comes up either way.

Kind of ctx callDirect-run mode (KONSTERA_KERNEL_MCP_URL unset)Live kernel
Kernel-callback services like ctx.log.infoSilently no-opRecorded
Services that return data (e.g. ctx.state)RaiseWork
Terminal
python -m main

If it fails to start, re-check step 2 — probably a missing dependency. See Error catalog for the common first-run exceptions.

Step 5 — Hit /invoke#

In another terminal:

Terminal
curl -X POST http://localhost:8080/invoke \
  -H content-type:application/json \
  -d '{"invocationId":"test-1","input":"Alice","config":{}}'

Expected response:

JSON
{"content":"Hello, Alice!","structured":null,"toolCalls":[]}

Try /health + /describe too:

Terminal
curl http://localhost:8080/health
curl http://localhost:8080/describe

Step 6 — Write the manifest#

Agents are OCI containers that ship with a manifest. Create manifest.json:

JSON
{
  "$schema": "https://schemas.konstera.ai/agent-manifest.v3.json",
  "id": "io.konstera.hello-world",
  "version": "0.1.0",
  "name": "Hello World",
  "description": "Echoes a greeting with the input name.",
  "icon": "👋",
  "autonomy": "autonomous",
  "runtime": {
    "kind": "container",
    "image": "ghcr.io/your-org/hello-world:0.1.0",
    "port": 8080,
    "healthPath": "/health",
    "timeoutSeconds": 30,
    "memoryMi": 256,
    "cpuMillis": 250
  },
  "input": {
    "type": "object",
    "properties": {
      "input": { "type": "string", "description": "Name to greet" }
    }
  },
  "capabilities": { "needs": [] }
}

See Manifest schema (full) for every field.

Step 7 — Write the Dockerfile#

The agent ships as a container. Pick the Dockerfile for your language. Create Dockerfile:

Dockerfile
FROM python:3.13-slim
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir konstera-sdk
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s \
  CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health', timeout=2)"
ENTRYPOINT ["python", "-u", "main.py"]

Step 8 — Run the container#

Terminal
docker run --rm -p 8080:8080 hello-world:0.1.0

In another terminal, repeat the /invoke test from step 5.

Step 9 — Add a kernel-service call#

Now exercise a kernel service with real behaviour. Modify handle() to also look up some state (which only works against a live kernel — in direct-run mode it'll raise RuntimeError).

SequenceWhy step 9 fails locally and step 11 succeeds
Your handlerSDKKernel1ctx.state.get("greetings_sent")direct-run (no kernel URL) → RuntimeError2live kernel: MCP tool state_get3stored count

Python — update main.py's handle method:

Python
async def handle(self, req, ctx):
    count = (await ctx.state.get("greetings_sent")) or 0
    count += 1
    await ctx.state.set("greetings_sent", count)
    name = req.input.strip() or "world"
    await ctx.log.info(f"Hello, {name}!", count=count)
    return AgentResponse(
        content=f"Hello, {name}! (greeting #{count})",
        structured={"count": count},
    )
  • TypeScript — equivalent ctx.state.get<number> + ctx.state.set.
  • .NET — equivalent ctx.State.GetAsync<int> + ctx.State.SetAsync.

Step 10 — Deploy to a Konstera instance (Cloud or self-hosted)#

Two paths:

Managed Cloud
  1. Sign up at konstera.ai/sign-up (private beta)
  2. Pair the CLI: konstera login --scopes devx.metadata.read,devx.manifest.validate,devx.agent.deploy_dev
  3. Build, push and publish: konstera deploy --image ghcr.io/your-org/my-first-agent:0.1.0 (a public image)
Self-hosted (local dev)
  1. Follow the Deploy guide — docker compose up -d runs the full stack (API + Portal + Postgres + Temporal)
  2. Push to the local registry: docker tag hello-world:0.1.0 localhost:4505/hello-world:0.1.0 && docker push localhost:4505/...
  3. Upload the manifest in the portal → Agents → Upload
Portal → Agents → Deploy Agent: pick the package and version, name the instance — the right-hand panel lists what the manifest asks to be bound · example data

Step 11 — Invoke it in production#

In the portal → Agents → Hello World → Test invoke:

Agent → Developers: the test console sends a payload to the live agent; every run is also recorded in Runs · example data
  1. Enter the input
    Input: Alice
  2. Click Invoke
    Click Invoke.

Step 12 — Observe + debug#

Click the invocation in the Invocations tab. You see:

Trace sectionWhat it shows
RequestinvocationId, input, payload, config
Kernel callsthe two ctx.state.* calls with latency + args
Log entriesyour ctx.log.info call with structured fields
Responsethe final body served to the caller

What you've learned#

  • How the SDK's run() works (direct-run mode vs. live kernel)
  • The handle() contract (req, ctx, return AgentResponse)
  • Kernel services: ctx.log (fire-and-forget) vs ctx.state (data, requires kernel)
  • The three-file deployment unit: code + manifest + Dockerfile
  • How to observe + debug an invocation in the portal
ArchitectureThe three-file deployment unit you just built Interactive — click a block

Next steps#

When something goes wrong#

SymptomWhere to go
Agent fails to bootError catalog — Python SDK errors
Manifest upload failsError catalog — Manifest validation
Invocation fails on live kernelOpen the trace → see Debugging
General questionsFAQ
StuckBook a call — we read every message