Inspiration

I noticed that most prompt engineering happens in isolated notebooks — prototypes that rarely make it into production. Teams juggle fragmented scripts, custom API wrappers, and brittle pipelines. I wanted a visual, unified canvas where you can experiment, iterate, and ship AI-driven workflows without drowning in infra. Perplexity’s Sonar API, with its live web search and citation features, felt like the perfect backbone for a truly end-to-end prompt platform.

What I Learned

  1. Visual Flow Design
    • Translating linear prompts into node-based graphs
    • Maintaining state and context across connected nodes
  2. Perplexity Sonar Integration
    • Orchestrating chat completions and real-time web queries
    • How important grounded AI is, even for the simplest of queries.
  3. Developer UX at Scale
    • Balancing configurability (temperature, token limits) with simplicity
    • Building reusable prompt templates for common tasks
    • Onboarding of new users (what do they do first? Do they understand what's going on?)

Technology Stack

  1. Frontend & Flow Editor
    • NextJS, shadcn/ui, ReactFlow
  2. API & Orchestration
    • Perplexity Sonar API as the core chat/search engine
  3. Data & Persistence
    • Supabase (PostgreSQL) to store user flows, templates, and execution logs
    • Kinde Auth for secure, enterprise-grade authentication
  4. Programmatic Access
    • RESTful API (/api/chat/completions) so developers can trigger flows from any service

Challenges & Solutions

  • Context chaining broke during re-execution (solved by implementing a lightweight DAG traversal system that rehydrates outputs into the correct subsequent inputs.)
  • Difficult to debug failed nodes visually (added per-node logging panels and a "step-through" execution mode for interactive debugging)
  • Timeouts are a challenge, especially when the workflows get complex. Possible solutions include AWS Fargate to queue the job.

Future work

  • Shared flows could be pretty cool
  • Add custom knowledge base connectors
  • Introduce a dashboard for API usage and analytics
  • Add third-party integrations (such as Notion)

I’m proud of how Loage turns ad-hoc prompts into reliable, production-ready workflows—and excited about what’s next!

Built With

  • nextjs
  • perplexity
  • shadcn
  • supabase
  • vercel
Share this project:

Updates