Skip to content

Conversation

@wjsutton
Copy link
Contributor

@wjsutton wjsutton commented Apr 3, 2025

Overview

PR Title: Search datasources tool
Author: Will Sutton
Date of Review: April 3rd 2025

Summary

Added tools for LangGraph Agent to search datasources and switch it's default datasource_luid to one found from search

Functionality & Implementation

Adds two tools available for the agent use: datasource_search, datasource_switch contained within experimental\tools\search_datasource.py

Integration

  • A new agent was created under experimental\agents\demos\search building on the superstore agent
  • With a new agent utils file search_agent_utils.py to display the current datasource luid
  • shared_state.py in experimental\agents helps manage and update the datasource_luid for datasource_qa.py tool
  • a local vector database is created by default using chromadb and extracts details of all named datasources on the tableau site
  • datasource_search will query the vector db and return a datasource luid
  • datasource_switch will take this datasource luid and initiate analyze_datasource

Notable changes to existing code

  • experimental\tools\datasource_qa.py and similar functions now run using the shared_state.py to receive dashboard luid rather than referring to environment variables, note on the initial run of main.py the dashboard luid is set to the environment variable luid.
  • main.py now runs from using the search agent rather than superstore.
  • enviroment.yml now includes chromadb

@stelloprint
Copy link
Contributor

Yo @wjsutton this looks excellent. I will review this as soon as possible so its ready for TC'25

@stelloprint stelloprint self-assigned this Apr 10, 2025
@stelloprint stelloprint added the enhancement New feature or request label Apr 10, 2025
@stelloprint stelloprint moved this to In progress in tableau_langchain Apr 10, 2025
@joeconstantino
Copy link
Contributor

Looks safe to me because of this line:
'datasource_luid': datasource_luid or get_datasource_luid() or os.environ['DATASOURCE_LUID'],

I thought this might be a breaking change, but it seems like this line handles issues where datasource_luid() was not set, but it is present in env vars.

@stelloprint stelloprint assigned wjsutton and unassigned stelloprint Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants