A3S Docs
A3S CodeExamples

Quick Start

Create an agent, open a session, run one turn, and read the result.

Quick Start

The smallest useful program: create an agent from an ACL file, open a session on a project directory, run one turn with send, print the reply text, and inspect the verification summary the runtime produced for that turn.

import { Agent } from '@a3s-lab/code';

// Agent.create takes a PATH to the ACL file.
const agent = await Agent.create('agent.acl');
const session = agent.session('.');

const result = await session.send('List the files in this directory.');
console.log(result.text);

// What the runtime checked while producing that turn.
console.log(session.verificationSummaryText());

await session.close();
from a3s_code import Agent

# Agent.create takes the ACL SOURCE TEXT, not a path.
agent = Agent.create(open('agent.acl').read())
session = agent.session('.')

result = session.send('List the files in this directory.')
print(result.text)

# What the runtime checked while producing that turn.
print(session.verification_summary_text())

session.close()

Note the asymmetry between the SDKs: in Node.js Agent.create takes a path to the ACL file, while in Python it takes the ACL source text (read the file yourself). Always close() the session when you are done so the runtime can flush state and release resources.

Next steps

  • Streaming — read tokens as they arrive
  • Sessions — persist and resume conversations

On this page