Skip to main content
Choose a recipe below. Each page includes installation commands, an environment template, complete JavaScript, the run command, and expected output. The examples use Node.js 22 or newer and cognitio-agent-sdk@2.0.1 from npm.

Start with a complete application

You can follow any recipe in a new directory without cloning the repository. Each linked GitHub project is also independently copyable and includes its own package manifest, npm lockfile, environment template, and README.

Run a downloaded project

After copying one of the linked project directories, open a terminal in that directory:
Copy .env.example to .env, then replace the API-key placeholder. In a Unix shell:
On PowerShell:
The default configuration uses openai/gpt-4.1-mini and OPENAI_API_KEY. Model access depends on your provider account. Keep .env out of Git. After setting the key, run:
The programs make real model requests and can incur provider charges. They reject unsuccessful results and close the runtimes they own. Their estimated cost limits are not provider billing caps. Each recipe explains its output and what to change next.

Explore more features

These focused source examples show individual SDK features. Pair them with the linked guide when adding the feature to your own application; they use shared helpers from the feature examples directory.