agi-cos
Getting started

Running in about five minutes.

You need Node 20 or newer, and either Docker or a PostgreSQL 16 instance you can point at. The interface runs with nothing but a migrated database; the worker is a separate command because it needs model access, and failing on a first run would be a poor introduction.

1 · Install and migrate

$ git clone github.com/BrightLabs-Infrasoft-Solutions-Pvt-Ltd/agi-cos
$ cd agi-cos
$ cp .env.example .env
# set POSTGRES_PORT if 5432 is taken — a local PostgreSQL usually has it
$ npm install
$ npm run db:up
$ npm run migrate

npm run migrate is the only way migrations are applied — they are deliberately not mounted into the container’s init directory. Applied files are recorded with a checksum, and editing one that has already run is refused. Add a new migration instead.

2 · Start the interface

$ npm run dev # http://localhost:3000

This works against nothing but a migrated database. You can create a company, look at the floor plan and read every screen before spending a single token.

3 · Provision a company

From the interface, or directly:

insert into companies (name, mission, currency)
  values ('Acme', 'Ship a task tracker', 'USD')
  returning id;
 
select provision_company_from_template('<that id>');

That staffs fourteen roles across executive, engineering, platform, client services, people and finance — each a real employee with a manager, an employment status and a budget. A company that already exists can pick up newly added roles with hire_missing_roles(), which never touches an employee it did not create.

4 · Give it model access

Which provider each employee uses is a versioned column you set on the employee page, not a global setting. What goes in .env is only the credentials those choices need — more than one may be set at once.

AdapterProviderWhat you supply
apianthropicANTHROPIC_API_KEY
apiopenaiOPENAI_API_KEY
apigoogleGOOGLE_API_KEY
apicompatibleCOMPATIBLE_API_KEY plus a base URL on the employee
clianthropic · openai · googleNo key. Sign in to claude, codex or gemini once

The model field is free text, so anything a provider serves can be named — including one released this morning. A model with no published rate still runs; its usage records as pending with the tokens kept.

5 · Run the company

$ docker build -f docker/runner/Dockerfile -t agi-cos/runner:dev .
# the throwaway container agent code executes in: non-root, no network,
# read-only root filesystem, only the worktree mounted
 
$ npm run seed:brief
$ npm run worker

The worker needs COMPANY_ID and PROJECT_REPO_PATH in addition to a credential. npm run dev:all runs the interface and the worker together once both are set.

RUNNER_MODE=local exists so a first run does not require Docker. It warns, and it refuses any instruction it cannot honour — it runs commands on your machine with your privileges and no sandbox, so use it only against repositories you already trust.

See it refuse bad work

The demo is two acts against a real database, a real git repository and the real container. In the first, a model implements a function and QA’s scripted check passes. In the second, a defect is injected and committed as real evidence with the claim that everything works — the same check runs, fails, and the task does not complete.

$ npm run demo

Act two is the milestone. Act one exists so that act two failing means something.

Running the tests

$ npm test -- --maxWorkers=1

Tests run against a real PostgreSQL instance, created on demand. There is no in-memory substitute, because most of what is being tested is the behaviour of the database itself. --maxWorkers=1 is worth passing on a smaller machine — the default pool is more than most laptops can feed.