import { AgentOS, Agent } from 'praisonai';const agent = new Agent({ instructions: 'You are a helpful assistant'});const app = new AgentOS({ agents: [agent] });await app.serve();
Copy
import { AgentOS, Agent } from 'praisonai';const researcher = new Agent({ name: 'researcher', instructions: 'Research topics'});const writer = new Agent({ name: 'writer', instructions: 'Write content'});const app = new AgentOS({ agents: [researcher, writer], name: 'content-team'});await app.serve();
Copy
import { AgentOS, Agent, AgentTeam } from 'praisonai';const agent = new Agent({ instructions: 'You are a helpful assistant'});const team = new AgentTeam({ agents: [agent], process: 'sequential'});const app = new AgentOS({ agents: [agent], teams: [team]});await app.serve();
Copy
const app = new AgentOS({ agents: [agent], config: { apiPrefix: '/v1' }});// Endpoints now at /v1/chat, /v1/agents, etc.
AgentApp works as a silent alias with no deprecation warnings.
Copy
// Both are equivalentimport { AgentOS, AgentApp } from 'praisonai';const app1 = new AgentOS({ agents: [agent] });const app2 = new AgentApp({ agents: [agent] });// They are the same classconsole.log(AgentOS === AgentApp); // true