Sign inSign up

kmarrrahul/dataweave-ai-playground

By kmarrrahul

β€’Updated 2 months ago

Use your favorite AI subscription to generate DataWeave code directly in your browser.

Image
Machine learning & AI
Developer tools
0

799

kmarrrahul/dataweave-ai-playground repository overview

⁠DataWeave AI Playground πŸš€

If you found this project useful, please give it a ⭐️ to show your support!

DataWeave AI Playground Interface

DataWeave AI Playground is a self-hosted, vendor-agnostic AI Playground template designed to autonomously generate, explain, and debug DataWeave 2.0 transformation scripts. It gives you a unified, web-based chat interface to orchestrate your local or remote workflows through various popular AI pair programmer SDKs available today: GitHub Copilot SDK, Google Antigravity, Cursor SDK, Claude Agent SDK, and Codex SDK.

DataWeave AI Playground is built around your existing subscriptions. If you have a GitHub Copilot license, you can connect the Github Copilot SDK. If you subscribe to Google AI Studio, you can use Antigravity. If you are a Cursor Pro user, connect the Cursor SDK. Have AWS Bedrock access or an Anthropic account? Connect Claude Agent directly. Already using a ChatGPT subscription, OpenAI, AWS Bedrock Mantle or Ollama? Connect Codex. Use what you already pay for!

By wrapping best-in-class agentic SDKs into a single backend, this template lets you seamlessly switch between AI providers without vendor lock-in. You bring your own credentials (BYOK), and the agent securely runs terminal commands, utilizes extensible Agent Skills, reads files, and writes code on your behalf in an ephemeral, isolated environment.


⁠🌟 Why DataWeave AI Playground?

You can use your existing AI subscription to generate Dataweave scripts using just your browser just by sending prompts in natural language.

  • 🌟 FLAGSHIP: Generate Transform from Expected Output (Agentic Auto-Recover): Provide a sample input payload and the desired output payload. The AI agent will reason through the schema differences to generate a DataWeave script. But it doesn't stop thereβ€”the agent autonomously executes the script in the background, compares the actual output with your expected output, and loops to fix its own errors up to 3 times before returning the final working script!
  • Generate Transform from Prompt: Have an input payload and a set of business rules? Describe your transformation in plain text, and the agent will build the script.
  • Reverse Engineering (Generate Input): Have a complex DataWeave script and its expected output, but lost the original input data? The agent can reverse-engineer the required input payload structure.
  • Agent Auto-Recover Control: You have full control. Toggle the agent's autonomous retry loop on or off directly from the UI to save context or execution time when working with massive payloads.
  • Provider Agnostic: Securely connect to your preferred AI provider (Google Antigravity, Claude Agent SDK, OpenAI Codex, GitHub Copilot) bringing your own keys (BYOK) directly in the browser session.

β πŸ› οΈ Core Capabilities

This application is built around a robust 3-pane interface that mirrors professional integration development environments, enhanced with agentic reasoning:

⁠🧩 Tabbed Multi-Input Intelligent Editor
  • Input / Identifiers: The source data schema payloads, supporting multiple tabs for arbitrary DataWeave identifiers (like payload, vars, and attributes) with format selection (JSON, XML, CSV, TXT).
  • DataWeave Script: The transformation logic, auto-populated by the AI.
  • Output / Expected: The resulting data or the target shape the AI uses to guide its generation, with selectable output formats.
β πŸ”Œ Extensible Agent Skills

The backend natively supports expanding the agent's capabilities via Agent Skills. The agent can be equipped with custom verification skills to run the generated DataWeave scripts locally, ensuring syntax correctness and validating the output before presenting it to the user.

⁠🧠 Deep Reasoning Integration

Unlike standard chat interfaces, the DataWeave AI Playground exposes the underlying "thinking steps" and reasoning process of the agent. You can observe the AI analyzing your schemas, mapping fields, and identifying syntax patterns in real-time.

AI Reasoning Sidebar


β πŸ”Œ Bruno API Collections

A Bruno⁠ collection is provided in the bruno-collection/ directory to help you test backend endpoints (/api/run, /api/followup, etc.) locally. Simply import the collection and configure your environment variables to start testing.


β πŸ›£οΈ API Routes

MethodPathDescription
GET/Main UI (Jinja2 rendered)
GET/api/healthService health check
GET/api/modelsLive list of available models for the selected provider
POST/api/dataweave/transformExecutes a DataWeave script against an input payload
POST/api/runStarts an agentic DataWeave generation task - returns an SSE stream
POST/api/followupContinues an agentic session with a follow-up prompt - returns an SSE stream

β πŸš€ Quick Start (Local Development)

⚠️ Prerequisite: You must have the DataWeave CLI⁠ installed and available in your system's PATH to execute DataWeave scripts locally.

git clone https://github.com/kmarrrahul/dataweave-ai-playground.git
cd dataweave-ai-playground
pip install -r requirements.txt

# (Optional) Export your GitHub OAuth App credentials to enable GitHub OAuth login for Githb Copilot SDK
export GITHUB_OAUTH_CLIENT_ID="your_client_id"
export GITHUB_OAUTH_CLIENT_SECRET="your_client_secret"
export GITHUB_OAUTH_REDIRECT_URI="http://localhost:8080/api/oauth/callback"

# Run the Uvicorn server
python -m uvicorn app.main:app --port 8080 --reload

⁠🐳 Docker Deployment

⁠Build
docker build -t dataweave-ai-playground:latest .
⁠Run

To start the container locally (pass GitHub OAuth credentials via -e to enable GHCP SDK Github Oauth login):

docker run -it --name dataweave-playground \
  -p 127.0.0.1:8080:8080 -p "[::1]:8080:8080" \
  -e GITHUB_OAUTH_CLIENT_ID="your_client_id" \
  -e GITHUB_OAUTH_CLIENT_SECRET="your_client_secret" \
  -e GITHUB_OAUTH_REDIRECT_URI="http://localhost:8080/api/oauth/callback" \
  dataweave-ai-playground:latest

⁠☸️ Kubernetes Deployment

DataWeave AI Playground is fully prepared for multi-tenant production deployments on Kubernetes.

kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yaml

Once deployed, the app will be accessible at your cluster's ingress URL.


⁠🀝 Contributing

We'd love your help in making this project even better! Please read our Contributing Guidelines⁠ to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes locally.


β βš–οΈ Disclaimer

MuleSoft and DataWeave are trademarks of MuleSoft, Inc., a Salesforce company. This project is an independent community tool and is not officially endorsed or sponsored by MuleSoft.

Tag summary

Content type

Image

Digest

sha256:d85ec9083…

Size

296.9 MB

Last updated

2 months ago

docker pull kmarrrahul/dataweave-ai-playground:codex-enabled-v1.0.0