subconscious_ajaya
subconscious-getting-started
Let's get you up and running your first Val with Subconscious.
Public
Like1
subconscious-getting-started
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v11View latest version
Learn how to use the Subconscious AI agent API on Val Town.
- Get an API key from the Subconscious dashboard
- Add it as an environment variable in this val's settings:
SUBCONSCIOUS_API_KEY
Each file demonstrates a different way to use the Subconscious SDK:
| File | Type | Description |
|---|---|---|
01_script.ts | Script | Simplest example β run a one-shot agent query |
02_http.ts | HTTP | Expose an AI search agent as an HTTP API endpoint |
03_cron.ts | Cron | Run a scheduled agent task on an interval |
04_email.ts | Process incoming emails with an AI agent |
| Engine | Description |
|---|---|
tim-edge | Fast & efficient, tuned for search tools |
tim-gpt | Recommended for most use cases (GPT-4.1 backed) |
tim-gpt-heavy | Maximum capability for complex tasks (GPT-5.2 backed) |
Tools extend what the agent can do. Three types:
- Platform tools β hosted by Subconscious (e.g.
fast_search,deep_search) - Function tools β your own HTTP endpoints the agent can call
- MCP tools β connect to any MCP server
Use answerFormat with a Zod schema + zodToJsonSchema() to get typed JSON responses.