Creating Your First Workflow
This tutorial walks you through building a simple RAG (Retrieval-Augmented Generation) workflow from scratch using the Generative Workflow Engine (GWE). By the end, you will have a working AI Employee that searches uploaded documents and answers questions with source citations.
Sample file used in this tutorial: GDPR Document (PDF)
Step 1: Access the AI Employee Tab
Navigate to the AI Employee section in the Ema App. Scroll down to the "Create an AI Employee" area and click the Create button on the first tile. For this tutorial, select the Chat AI Employee option.
Step 2: Name Your AI Employee
Provide a distinctive name (for example, "Compliance Analyst") to identify your new AI Employee.
Step 3: Launch the GWE Canvas
After creation, you will be directed to the GWE canvas. The initial view displays shared configurations and resources accessible to all agents within the workflow.
Step 4: Connect Applications and Resources
Link the necessary apps so that every agent in your workflow has access to required resources.
This feature is currently disabled for beta access users.
Add data sources by creating folders. These sources will be available to agents that require specific data. You can create two types of folders:
- File upload folders -- Upload files from your local system or from linked file storage apps. Linking your file storage app will not make it available to other users in your workspace. Files and folders uploaded from linked apps refresh nearly real time (up to 10-minute delay).
- Web scraping folders -- Web link scraping can take a few minutes to complete. Ema clicks on all links on the page and scrapes the downstream pages as well, up to two children depth from the main link you provide. Ema also downloads any documents such as PDFs encountered during the scraping. Ema does not re-scrape these files after the first time. For detailed web scraping configuration, see Scraping Web Links.
Supported file formats: Ema can currently ingest and understand DOCX, PDF, TXT, PPT, XLSX, HTML, and common image files.
Step 5: Configure Default Settings
Set up the default EmaFusion™ configuration that applies to all agents. This setting can later be overridden at the individual agent level.
Step 6: Add a Basic Respond Agent
Click Save to return to your blank workflow canvas. Navigate to the "Frequently Used Agents" section in the agent library and select Respond to a Query. You can also use the search bar to find this agent.
Step 7: Establish Agent Connections
Input the query that a user might provide by clicking on the Query input in the Respond to a Query agent. This query will be processed by the LLM agent. Clicking on an input with a dropdown symbol shows you all eligible values on the canvas that can be connected.
Alternatively, click on an output from an agent and use the plus icon to explore eligible agents for connection. If there are none, use the Connect a New Agent option to view and add agents capable of utilizing the output.
Step 8: Adjust Agent Placement and Inputs
Drag agents onto the canvas and click on their inputs to review available outputs for connection. Ensure the data flow is logical.
Step 9: Configure Agent Instructions
Click on an agent to open its configuration panel on the right-hand side. Provide specific instructions as needed, for example:
- Set the language tone to professional
- Request bullet-point formatting
- Define the response length
Step 10: Incorporate Data Search Functionality
To update the LLM's knowledge with current data, add a File Search agent that queries the data sources you have set up. Use the same query as the user's input and assign your data sources to this agent in its configuration drawer.
Step 11: Update and Replace Agents if Necessary
Remove any temporary agents that are no longer needed, such as the Respond to a Query agent. Add a new agent to process and respond using the search results from the File Search agent.
Step 12: Finalize the Workflow Output
Assign the query to the new agent to process the search results. Select the final LLM response as the output to be published.
Eligible outputs will have the option to publish as workflow output. Certain outputs such as Search Results cannot be published directly to the user.
Step 13: Publish and Save the Workflow
Publish the workflow output and save your changes to complete the AI Employee setup.
Step 14: Enable Your AI Employee
Return to the AI Employee configuration page and toggle the switch to enable the AI Employee. Your AI Employee is now ready for use in chat.
Step 15: Test the AI Employee
Interact with your AI Employee by asking questions (for example, "What is a DPO?"). The AI Employee will search through connected files and links and provide an answer, including precise source citations such as page numbers and paragraphs.
Click Show Work to review the detailed steps and source references generated by the AI Employee.
Read Next
Now that you have created a simple RAG workflow on GWE, you can move on to improve the accuracy of such a workflow. The following tutorials cover intent classification, workflow branching, and other techniques:
- Adding Workflow Branches -- Use intent classifiers to route queries dynamically.
- Writing Effective Instructions -- Principles for writing clear agent instructions.
- Improving Chat Performance -- Build embeddable chatbots with conversation context.