Let's get you up and running quickly. This should take about five minutes.
First, install the dependencies:
pip install -r requirements.txtThen set up your API key. Create a .env file in the project root:
# Create .env file
echo "GEMINI_API_KEY=sk-your-key-here" > .envJust replace sk-your-key-here with your actual Gemini API key.
Start the Chainlit UI:
chainlit run frontend/chainlit_app.pyThe application will automatically open in your browser at http://localhost:8000. If it doesn't, just copy that URL into your browser.
Note: If port 8000 is already in use, you can specify a different port:
chainlit run frontend/chainlit_app.py --port 8001Chainlit provides a chat-based interface that's perfect for interacting with workflows. It supports markdown and Mermaid diagrams, so you can see workflow graphs rendered beautifully.
I've included four different workflows to show different patterns. Here's how to use each one:
This one's straightforward - it prepares something, asks for your approval, then continues based on your decision.
- Type
graph approvalto see the workflow structure - Type
execute approval {"content": "Review this document"}to run it - The workflow will execute and show you the results
The chat interface makes it easy to interact with workflows naturally.
This one's fun to watch - multiple agents work at the same time, then everything gets merged together.
- Type
graph parallelto see how it's structured - Type
execute parallel {"task": "Analyze these three topics: AI, ML, and NLP"} - Watch as three agents work simultaneously and results get merged automatically
This workflow keeps refining until it's happy with the quality. It's like having an agent that reviews its own work.
- Type
graph iterativeto see the refinement loop - Type
execute iterative {"content": "Write a blog post about LangGraph"} - It will generate, review itself, and if the quality isn't good enough, it refines and tries again until it meets the quality threshold
This one analyzes your input and routes it to the right processor based on what it finds.
- Type
graph conditionalto see the routing logic - Type
execute conditional {"input": "This is a technical document about APIs"} - The system figures out what type of input it is and routes it to the appropriate processor automatically
One of the coolest features is the workflow visualization. Type graph <workflow_name> and you'll see a Mermaid diagram rendered right in the chat showing exactly how each workflow is structured. You can see:
- How nodes are connected
- Where conditional routing happens
- Entry and exit points
- The overall flow
Chainlit renders Mermaid diagrams beautifully, so you get a visual representation of your workflows right in the interface. This is super helpful when you're trying to understand what a workflow does or debug why something isn't working.
A few things that might help:
- Commands: Use
helpto see all available commands - Input Format: JSON is preferred because it's structured, but plain text works too
- Workflow Graphs: Use
graph <workflow_name>to see any workflow's structure - Execution: Results are shown in the chat with formatted JSON output
- Multiple Workflows: You can run multiple workflows in the same session
Here are some real scenarios where these workflows come in handy:
The approval workflow is perfect when you need a human to review something before it goes live. Maybe you're publishing blog posts, deploying code, or sending out marketing emails - anything where you want a second pair of eyes.
Got multiple data sources to analyze? The parallel workflow lets you process them all at the same time instead of waiting for each one to finish. Much faster.
The iterative workflow is great when quality matters. It generates something, checks if it's good enough, and if not, it refines and tries again. Perfect for blog posts, documentation, or any content where you want it polished.
The conditional workflow acts like a smart router. It looks at incoming tasks, figures out what type they are, and sends them to the right processor. Great for customer support, content classification, or any scenario where different types of inputs need different handling.
Ran into an issue? Here are some common problems and how to fix them:
Error: "GEMINI_API_KEY environment variable is required"
- Make sure you created a
.envfile in the project root - Double-check that your API key is in there (no quotes needed)
- Restart the application after creating or editing the
.envfile
Workflow seems stuck or hanging:
- Check the "Handle Approvals" tab - it might be waiting for your input
- Look at the execution output to see what step it's on
- Check the "Execution Monitor" tab for more details
Graph visualization not showing:
- Make sure the workflows are compiled (they should be automatically)
- Try clicking the "Refresh Graph" button
- If it's still not working, check the console for any error messages
Once you've got the basics working, here's what you can do next:
- Dive into the workflow code in
backend/workflows/to see how they're built - Create your own workflows by extending the
BaseWorkflowclass - Add custom nodes by extending
BaseNodefor your specific use cases - Integrate with your own tools and agents - the system is designed to be extensible
The code is pretty well documented, so you should be able to figure out how to customize things for your needs. If you build something cool, I'd love to see it!