daydreamsai/daydreams

Daydreams is a set of tools for building agents for commerce

What it solves

Daydreams addresses the common pitfalls of AI agent development, such as context switching breaking functionality, nightmare state management, and lack of persistent memory across sessions. It prevents agents from becoming a "tangled mess of prompts and logic" as they scale in complexity.

How it works

The framework uses a Composable Context Architecture. Instead of a monolithic design, it creates isolated, stateful workspaces (contexts) that can be combined using a .use() method. This allows developers to build complex behaviors by composing modular components.

Key architectural components include:

  • Context System: Isolated workspaces for different conversation types with their own schemas and instructions.
  • Memory System: A dual-tier storage system consisting of Working Memory (temporary execution state) and Context Memory (persistent data).
  • Action System: Type-safe functions with schema validation that can access and modify context memory.
  • Dreams Router: A universal AI gateway providing a single API to access multiple models (OpenAI, Anthropic, Google, etc.) with built-in USDC micropayments.
  • MCP Integration: Native support for the Model Context Protocol, allowing agents to connect to external tools like databases, file systems, and web services.

Who it’s for

TypeScript developers building production-ready AI agents that require persistent memory, complex state management, and the ability to integrate with various LLM providers and external tools.

Highlights

  • Composable Contexts: Build complex agents by combining reusable, isolated contexts.
  • Native MCP Support: Instant access to a wide ecosystem of external tools and services.
  • Persistent Memory: True stateful agents that remember information across restarts.
  • Universal AI Gateway: Access multiple LLM providers through one API with pay-per-use micropayments.
  • TypeScript-first: Full type safety and excellent developer experience.
  • Universal Runtime: Compatible with Node.js, browsers, Deno, Bun, and edge functions.

Related

  • Project
  • Project
  • Project
  • Project