Learn how to use the Subconscious AI agent API on Val Town.
SUBCONSCIOUS_API_KEYEach 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 |
tim-gpt-heavy | Maximum capability for complex tasks |
Tools extend what the agent can do. Three types:
fast_search,
deep_search)Use answerFormat with a Zod schema +
zodToJsonSchema() to get typed JSON responses.