EchoStash
Docs

Introduction

What is Echo PDK

What is Echo PDK?

Echo PDK (@goreal-ai/echo-pdk) is a domain-specific language for creating dynamic AI prompts. It goes beyond simple variable substitution — it's a complete prompt engineering toolkit.

Key Capabilities

  • Variables — with defaults, nested access, typed values
  • Conditionals — if/else logic to include only relevant context
  • Roles & Messages — Structure prompts as multi-turn conversations with [#ROLE system], [#ROLE user], [#ROLE assistant]
  • Tool Definitions — Define function-calling tools inline with [#TOOL] blocks
  • Schema — Define JSON Schema for structured output with [#SCHEMA] blocks
  • Meta Templates — Dynamic model config (provider, model, temperature) that changes based on variables
  • Sections & Includes — Reusable prompt components
  • AI Gate — LLM-powered conditional logic
  • 3 LLM Providers — OpenAI, Anthropic, Google with unified interface
  • Embeddings — Vector similarity with OpenAI and Voyage AI

Why Use Echo PDK?

  • Token Reduction — Up to 75% cost savings by sending only relevant context
  • Better Accuracy — Less noise for the LLM means better responses
  • Maintainability — Modular prompts that scale with your team
  • Deterministic Logic — Business rules in code, not AI interpretation

Example: Support Agent with Roles, Conditionals, and Tools

support-agent.echo
[#ROLE system]
You are a customer support agent for {{company}}.
You help customers resolve issues quickly and professionally.

[#IF {{customer.tier}} #equals(Premium)]
This is a Premium customer. Prioritize their request and offer proactive solutions.
[END IF]
[END ROLE]

[#TOOL lookup_order]
description: Look up order details by order ID
parameters:
  order_id:
    type: string
    description: The order ID to look up
    required: true
[END TOOL]

[#IF {{customer.tier}} #equals(Premium)]
[#TOOL escalate_to_manager]
description: Escalate the issue to a support manager
parameters:
  reason:
    type: string
    description: Reason for escalation
    required: true
[END TOOL]
[END IF]

[#ROLE user]
My name is {{customer.name}} and I need help with: {{issue}}
[END ROLE]