Skip to content

Daydreams

Daydreams is a set of tools for building agents for commerce

Install

$npm install @daydreamsai/core @ai-sdk/openai zod

Install command taken from the project's README or registry entry. Always review code before running it.

Daydreams - AI Agent Framework

Notice: This agent framework is no longer the core focus as features are already obsolete.

The Daydreams core focus is on Agentic Commerce and not the agent harness.

Check out the lucid-agents repo: https://github.com/daydreamsai/lucid-agents

We recommend the Pi agent harness for building agents and incorporating lucid-agents in it.

Finally, TypeScript agents that scale and compose

🌐 Website • ⚡ Quick Start • 📖 Documentation • 💬 Discord

🎯 The Problem Every AI Developer Faces

You build an AI agent. It works great in testing. Then you need to add more features and...

❌ Context switching breaks existing functionality
❌ State management becomes a nightmare
❌ Memory doesn't persist across sessions
❌ Code becomes a tangled mess of prompts and logic

Sound familiar? You're not alone. This is why most AI agents never make it to production.

⚡ The Solution: Composable Context Architecture

Daydreams is the first AI framework with composable contexts - isolated workspaces that combine for complex behaviors. Build agents that remember, learn, and scale with true memory, MCP integration, and TypeScript-first design.

🌐 Dreams Router - Universal AI Gateway

Access any AI model through one API with built-in authentication and payments:

import { dreamsRouter } from "@daydreamsai/ai-sdk-provider";

// Use any model from any provider
const models = [
  dreamsRouter("openai/gpt-4o"),
  dreamsRouter("anthropic/claude-3-5-sonnet-20241022"),
  dreamsRouter("google-vertex/gemini-2.5-flash"),
  dreamsRouter("groq/llama-3.1-405b-reasoning"),
];

// Pay-per-use with USDC micropayments (no subscriptions)
const { dreamsRouter } = await createDreamsRouterAuth(account, {
  payments: { amount: "100000", network: "base-sepolia" }, // $0.10 per request
});

Features:

  • Universal Access - OpenAI, Anthropic, Google, Groq, xAI, and more
  • x402 Payments - Pay-per-use with USDC micropayments
  • OpenAI Compatible - Works with existing OpenAI SDK clients
  • Automatic Fallbacks - Built-in provider redundancy

🌐 Live Service: router.daydreams.systems • 📖 Router Docs • ⚡ Router Quickstart

🌟 The Power of Context Composition

Unlike other frameworks, Daydreams lets you compose contexts using .use() - creating powerful agents from modular components:

import { createDreams, context, action } from "@daydreamsai/core";
import { openai } from "@ai-sdk/openai";

// Base analytics context - tracks user behavior
const analyticsContext = context({
  type: "analytics",
  create: () => ({ events: [], sessions: 0 }),
}).setActions([
  action({
    name: "trackEvent",
    schema: { event: z.string() },
    handler: async ({ event }, ctx) => {
      ctx.memory.events.push({ event, timestamp: Date.now() });
      return { tracked: true };
    },
  }),
]);

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io