Skip to content

j15marti/ZenDialog

Repository files navigation

ZenDialog

An AI-powered contemplative dialogue application where users engage with a Zen master powered by Google Gemini. The master presents authentic teachings from classical Zen collections, then responds to user reflections with wisdom drawn from the tradition.

Features

  • 275 Authentic Teachings: From Mumonkan, Blue Cliff Record, Book of Equanimity, and Extended Zen Teachings
  • Multi-Phase AI Reasoning: 6-phase prompting architecture for nuanced student response analysis
  • Personalized Progress: Hidden level system (1-100) based on the Five Ranks of Tozan
  • Premium Subscriptions: Stripe-powered subscriptions for Pro model access
  • Daily Meditation Emails: Optional Zen teaching emails via Resend
  • Dark/Light Theme: Full theme support with Zen-inspired design

Tech Stack

  • Frontend: React, TypeScript, Tailwind CSS, Wouter, TanStack Query
  • Backend: Express.js, Node.js
  • Database: PostgreSQL with Drizzle ORM
  • AI: Google Gemini (gemini-3-flash-preview / gemini-3-pro-preview)
  • Auth: Replit Auth (Google sign-in)
  • Payments: Stripe
  • Email: Resend

Environment Variables

To run this application, you need to set the following environment variables:

Required

Variable Description
DATABASE_URL PostgreSQL connection string
GEMINI_API_KEY Google Gemini API key from Google AI Studio
SESSION_SECRET Secret key for session encryption (any random string)

Optional (for full functionality)

Variable Description
STRIPE_SECRET_KEY Stripe secret key for payment processing
RESEND_API_KEY Resend API key for daily meditation emails
CRON_API_KEY API key for admin cron job endpoints

Getting Started

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Set up environment variables (copy from above)
  4. Push database schema:
    npm run db:push
  5. Start the development server:
    npm run dev

The application runs on port 5000.

Multi-Phase Prompting Architecture

The Zen master uses a sophisticated 6-phase reasoning system:

  1. Classification (temp 0.2, 800 tokens): Analyzes response_mode, experiential_grounding_score, attachment, avoidance
  2. Student State Update: Tracks five_ranks_orientation, primary_obstacle, confidence
  3. Safety/Boundary Check (temp 0.1): Redirects therapy/diagnosis requests appropriately
  4. Response Mode Decision: Determines whether to withhold, teach, trigger meta-reflection, or redirect
  5. Generation (temp 0.85): Creates expressive Zen master responses
  6. Dialog Summary: Periodic rolling summaries for long-context memory

License

MIT

About

ZenDialog is a contemplative space for engaging with traditional Zen teachings through dialogue with an AI-powered Zen master. Each session presents an authentic teaching and invites you to reflect on its meaning.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages