Skip to content

Jokasan/Agentic_Workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langchain Databricks Python

Agentic Workflows in Databricks

This repository contains two examples of agentic workflows implemented in Databricks using Langchain. The first example demonstrates a single agent with a tool workflow, while the second showcases a multi-agent workflow, with a supervisor and a SQL agent.

Prerequisites

  • Understanding of Langchain & Databricks
  • Experience with Genie & Genie Spaces in Databricks

Single agent workflow

This example demonstrates a single agent that interacts with a tool to retrieve and process data. The agent is designed to retreive data from a table in a unity catalog schema, using a function:

This is a lightweight example that can be extended to include more complex logic and additional tools, however it has some limitations and is often prone to hallucinations. Below are some pros and cons to this approach:

Pros Cons
Simple design ✅ Can hallucinate easily ❌
Can mix and match tools ✅ Capabilities limited to the tools available ❌
Fast inference time ✅ Can reach context window limits fast depending on output of tools ❌

Multi-agent workflow

This example demonstrates a multi-agent workflow where a supervisor agent coordinates the work of a SQL agent. The SQL agent is Databricks' specialised agent for SQL queries, called Genie. The supervisor agent is responsible for managing the workflow, including the SQL agent's tasks and the overall workflow logic, whilst the SQL agent is more focused on SQL query development. This approach allows for more complex queries and better management of the workflow, below are some pros and cons:

Pros Cons
Able to develop complex queries ✅ Requries knowledge of Geni & Genie API ❌
Can handle multiple tables ✅ inference time, might be higher (in relative terms) ❌
Allows for domain specific agents ✅ Langchain can become complex ❌

In reality to solve business problems, we often require a combination of different experts. The multi-agent workflow allows us to create a more robust and flexible solution by combining the strengths of different agents, mimicking how you would bring together subject matter experts to solve a problem in the real world.

In any case, this repo should serve as inspiration for what is possible when developing compound agentic systems!

About

Multi agent system with Genie in Databricks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published