Tycono AI Company Builder
Tycono is an open-source, local-first framework for building and orchestrating multi-agent AI organizations, conceptualized as 'Company-as-Code'. It allows users to define AI agents, roles, and company hierarchies using declarative YAML and Markdown configurations, then watch them autonomously plan, execute, and learn from complex tasks. The system features a terminal-native user interface (TUI) for real-time supervision and manages persistent knowledge across sessions. The client library, `tycono`, is currently at version 0.3.44 and is under active development with frequent minor releases. Its companion, `tycono-server`, reached its first production-ready stable release at v0.1.0, providing a headless API backend. Key differentiators include its cost-efficiency features like 'Auto-Amend' for reducing LLM usage, and its ability to simulate and run entire AI companies for autonomous research and development.
Common errors
-
Error: Tycono server not running or unreachable at http://localhost:PORT
cause The 'tycono' client cannot connect to the 'tycono-server' instance.fixStart the `tycono-server` in a separate terminal (`npm install -g tycono-server && tycono-server start`) or ensure the `TYCONO_SERVER_URL` environment variable points to the correct address if it's not local. -
Error: Missing required environment variable ANTHROPIC_API_KEY
cause The LLM (e.g., Claude) API key is not provided, preventing agents from functioning.fixSet the `ANTHROPIC_API_KEY` environment variable with your valid Anthropic API key before running Tycono. For other LLMs, consult the specific documentation. -
TypeError: Cannot read properties of undefined (reading 'name') in agent configuration.
cause A YAML or Markdown agent/role definition file is malformed or missing a critical field like 'name'.fixInspect your agent/role configuration files for syntax errors or missing mandatory properties. Ensure all required fields, such as `id`, `name`, `level`, `model`, etc., are present and correctly formatted. -
Error: The Tycono TUI requires a terminal that supports 256 colors.
cause The terminal environment does not meet the minimum requirements for the rich TUI experience.fixUse a modern terminal emulator (e.g., iTerm2, Kitty, Alacritty, VS Code integrated terminal) that supports 256 colors. Ensure your `TERM` environment variable is correctly set (e.g., `xterm-256color`).
Warnings
- breaking Version 0.2.0 introduced significant changes to the core interaction model, making the TUI the default interface and adding 'Multi-Wave Resume' and 'Dual Mode' functionalities. Older CLI commands or programmatic integrations expecting pre-0.2.0 behavior may break.
- breaking The internal session management was refactored with a 'Session-Centric migration', explicitly removing 'Job' from the core. This indicates a potential breaking change for any programmatic interfaces or configurations that directly referenced 'Job' entities.
- gotcha Tycono relies heavily on an LLM provider (e.g., Anthropic Claude) and the `tycono-server` backend for full functionality. Users might configure the `tycono` client without realizing the separate server component and API keys are critical for execution.
- gotcha The 'Company-as-Code' approach uses YAML and Markdown files for defining agents and organizational structure. Incorrect formatting, missing required fields, or logical errors in these declarative files can lead to unexpected agent behavior or runtime errors.
Install
-
npm install tycono -
yarn add tycono -
pnpm add tycono
Imports
- runTyconoTUI
import { runTyconoTUI } from 'tycono/cli'; - defineCompany
const defineCompany = require('tycono').defineCompany;import { defineCompany } from 'tycono/config'; - executeTask
const executeTask = require('tycono').executeTask;import { executeTask } from 'tycono/api';
Quickstart
import { defineCompany, executeTask } from 'tycono/api';
import { HumanAgent, ClaudeAgent, Role } from 'tycono/agents'; // Assuming agent types
const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY ?? '';
if (!ANTHROPIC_API_KEY) {
console.error('ANTHROPIC_API_KEY environment variable not set.');
process.exit(1);
}
// Define roles within the company
const ceoRole = new Role('CEO', 'Oversees overall company strategy and delegates tasks.');
const engineerRole = new Role('Engineer', 'Implements technical solutions and writes code.');
const qaRole = new Role('QA', 'Tests and validates implemented solutions.');
// Define agents and assign them roles
const ceoAgent = new ClaudeAgent('Alice', 'claude-3-opus-20240229', ceoRole, ANTHROPIC_API_KEY);
const engineerAgent = new ClaudeAgent('Bob', 'claude-3-sonnet-20240229', engineerRole, ANTHROPIC_API_KEY);
const qaAgent = new ClaudeAgent('Charlie', 'claude-3-haiku-20240229', qaRole, ANTHROPIC_API_KEY);
// Define the company structure
const myAICorp = defineCompany({
name: 'Innovation Inc.',
description: 'An AI company focused on rapid prototyping and development.',
roles: [ceoRole, engineerRole, qaRole],
agents: [ceoAgent, engineerAgent, qaAgent],
reportingStructure: [
{ from: engineerAgent, to: ceoAgent }, // Engineer reports to CEO
{ from: qaAgent, to: ceoAgent } // QA reports to CEO
] // Simplified reporting for example
});
async function runAICompanyTask() {
console.log(`Starting task for ${myAICorp.name}...`);
try {
const result = await executeTask(myAICorp, 'Develop a simple web-based calculator application.', {
// Optional parameters for task execution, e.g., output directory, max steps
outputDirectory: './projects/calculator-app',
verbose: true
});
console.log('Task completed. Final output:', result.finalReport);
} catch (error) {
console.error('Error executing task:', error);
}
}
runAICompanyTask();