Downcity
SDK Examples

Example: Minimal Local Agent

A minimal runnable local Agent SDK example

Example: Minimal Local Agent

import { Agent } from "@downcity/agent";

const agent = new Agent({
  id: "repo-helper",
  path: "/path/to/project",
  tools: {},
});

Then:

const session = await agent.session();
await session.set({ model });
const turn = await session.prompt({ query: "Continue" });
await turn.finished;

This minimal example is useful for validating three things first:

  • whether Agent can be constructed successfully
  • whether Session can be created successfully
  • whether the model can execute successfully