### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-openai-azure-qdrant.ipynb This code block shows how to initialize and run the Vanna AI Flask web application. It imports VannaFlaskApp, creates an instance with the Vanna object, and then starts the web server, providing a graphical interface for interacting with Vanna. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-openai-vanna-vannadb.ipynb This code demonstrates how to initialize and run the Vanna AI Flask web application. It imports the 'VannaFlaskApp' class, creates an instance linked to the Vanna model, and then starts the web server, providing a graphical interface for interacting with Vanna AI. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-openai-standard-marqo.ipynb This snippet installs the Vanna AI library along with specific dependencies for Marqo, OpenAI, and DuckDB using pip. This ensures all required components for the Vanna AI setup are available. ```python %pip install 'vanna[marqo,openai,duckdb]' ``` -------------------------------- ### Install Vanna Python Package Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-openai-vanna-vannadb.ipynb Installs the Vanna Python library using pip, typically in a Jupyter or IPython environment. This is the first step to use Vanna for SQL generation. ```python %pip install vanna ``` -------------------------------- ### Install Vanna AI with Qdrant, OpenAI, and DuckDB Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-openai-azure-qdrant.ipynb This command installs the Vanna AI library along with its specified optional dependencies: 'qdrant' for vector database integration, 'openai' for large language model connectivity, and 'duckdb' for local database querying. This ensures all necessary components are available for Vanna's operation. ```python %pip install 'vanna[qdrant,openai,duckdb]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-openai-vanna-vannadb.ipynb This snippet initializes and runs a local Flask-based user interface for Vanna AI. It imports VannaFlaskApp and creates an instance, passing the Vanna object. Running app.run() starts the web server, providing a graphical interface for interacting with Vanna, asking questions, and visualizing results. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with Qdrant Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/sqlite-openai-vanna-qdrant.ipynb This command installs the Vanna library along with its Qdrant-specific dependencies. It is typically executed in an IPython or Jupyter notebook environment to prepare the development setup. ```python %pip install 'vanna[qdrant]' ``` -------------------------------- ### Install Vanna.ai with Marqo and BigQuery Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-openai-vanna-marqo.ipynb Installs the Vanna.ai library along with optional dependencies for Marqo and BigQuery, enabling advanced features for natural language to SQL generation within a Python environment. ```python %pip install 'vanna[marqo,bigquery]' ``` -------------------------------- ### Install Vanna with Qdrant, Ollama, and Postgres dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-ollama-qdrant.ipynb Installs the Vanna library along with specific dependencies for Qdrant (vector store), Ollama (local LLM), and Postgres (database connector) using pip. This command ensures all required components for the setup are available. ```python %pip install 'vanna[qdrant,ollama,postgres]' ``` -------------------------------- ### Install Vanna with Marqo and OpenAI Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/sqlite-openai-standard-marqo.ipynb This command installs the Vanna library along with its specified integrations for Marqo and OpenAI. It ensures all necessary components are available for using Vanna with these services. ```python %pip install 'vanna[marqo,openai]' ``` -------------------------------- ### Install Vanna AI with Qdrant, Gemini, and BigQuery Integrations Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-gemini-qdrant.ipynb This command installs the Vanna AI library along with specific extra dependencies for Qdrant (vector database), Google Gemini (large language model), and BigQuery (data warehouse connector). It ensures all required components for a comprehensive Vanna setup are available. ```python %pip install 'vanna[qdrant,gemini,bigquery]' ``` -------------------------------- ### Install Vanna with Marqo and Postgres Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-openai-vanna-marqo.ipynb Installs the Vanna library along with its specific dependencies for Marqo and Postgres using the pip package manager. This ensures all necessary components are available for integration. ```python %pip install 'vanna[marqo,postgres]' ``` -------------------------------- ### Install Vanna with Gemini Support via Pip Source: https://github.com/vanna-ai/notebooks/blob/main/sqlite-gemini-vannadb.ipynb This command installs the Vanna library along with its dependencies for integrating with Google Gemini. It uses the `pip` package manager within a Jupyter environment. Ensure you have Python and pip installed before running. ```python %pip install 'vanna[gemini]' ``` -------------------------------- ### Install Vanna with OpenAI and DuckDB Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-openai-standard-other-vectordb.ipynb Installs the Vanna library along with optional dependencies for OpenAI integration and DuckDB database connectivity using pip. This command ensures all required components are available for the examples. ```python %pip install 'vanna[openai,duckdb]' ``` -------------------------------- ### Install Vanna AI with OpenAI and MySQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-openai-standard-other-vectordb.ipynb Installs the Vanna AI library along with necessary dependencies for OpenAI integration and MySQL database connectivity using pip within a notebook environment. ```python %pip install 'vanna[openai,mysql]' ``` -------------------------------- ### Install Vanna.AI with Qdrant, Gemini, and MySQL Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-gemini-qdrant.ipynb This command installs the Vanna.AI library along with specific integrations for Qdrant (vector store), Google Gemini (LLM), and MySQL (database connector). It uses `pip` for package management. ```python %pip install 'vanna[qdrant,gemini,mysql]' ``` -------------------------------- ### Install Vanna AI with MSSQL Support Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-openai-vanna-vannadb.ipynb Installs the Vanna AI library and its MSSQL dependencies using pip. This command prepares the environment for connecting to Microsoft SQL Server databases within a Python notebook. ```python %pip install 'vanna[mssql]' ``` -------------------------------- ### Install Vanna AI with ChromaDB, OpenAI, and Postgres Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-openai-standard-chromadb.ipynb This command installs the Vanna AI library along with specific integrations for ChromaDB (vector store), OpenAI (language model), and PostgreSQL (database connector). It ensures all necessary dependencies are available for a comprehensive Vanna AI setup. ```python %pip install 'vanna[chromadb,openai,postgres]' ``` -------------------------------- ### Launch Vanna Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-other-llm-qdrant.ipynb This snippet provides the necessary code to import and run the Vanna Flask application. It initializes `VannaFlaskApp` with the Vanna instance and then starts the web server, providing a graphical user interface for interacting with Vanna. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with OpenAI Integration Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-openai-standard-vannadb.ipynb This snippet demonstrates how to install the Vanna AI library using `pip`, specifically including the `openai` extra. This installation is crucial for enabling Vanna AI to leverage OpenAI's models for natural language processing tasks within your Python environment. ```python %pip install 'vanna[openai]' ``` -------------------------------- ### Install Vanna with BigQuery Support Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-openai-vanna-vannadb.ipynb Installs the Vanna library along with its BigQuery integration. This command uses pip within a Jupyter or IPython environment to manage Python packages, ensuring all necessary dependencies for BigQuery connectivity are included. ```python %pip install 'vanna[bigquery]' ``` -------------------------------- ### Launch Vanna Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-openai-vanna-qdrant.ipynb This snippet demonstrates how to initialize and run the Vanna Flask web application. It imports `VannaFlaskApp` from `vanna.flask`, creates an instance by passing the Vanna object, and then starts the web server, providing a graphical interface for interaction. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-other-llm-marqo.ipynb This code demonstrates how to initialize and run the Vanna AI Flask application, providing a web-based user interface for interacting with Vanna. Ensure you have the `vanna.flask` module installed to use this feature. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Marqo, Gemini, and MSSQL Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-gemini-marqo.ipynb This command installs the Vanna AI library and its specified integrations for Marqo (vector database), Google Gemini (LLM), and Microsoft SQL Server. It's designed for use in environments like Jupyter notebooks. ```Python %pip install 'vanna[marqo,gemini,mssql]' ``` -------------------------------- ### Install Vanna AI with OpenAI and Snowflake Dependencies (Python) Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-openai-azure-vannadb.ipynb This command installs the Vanna AI library using pip, including optional dependencies for OpenAI integration and Snowflake database connectivity. It's typically run in a Jupyter or IPython environment to prepare the environment for Vanna AI. ```python %pip install 'vanna[openai,snowflake]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/other-database-openai-vanna-qdrant.ipynb This snippet demonstrates how to launch a web-based user interface for Vanna AI using the `VannaFlaskApp`. This provides a more interactive way to interact with Vanna, allowing users to ask questions and view generated SQL through a web browser. It requires the `vanna.flask` module to be installed. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Qdrant, OpenAI, and Snowflake Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-openai-standard-qdrant.ipynb This command installs the Vanna AI library along with necessary dependencies for Qdrant (vector store), OpenAI (language model), and Snowflake (database connector). It's typically run in a Jupyter or IPython environment to prepare the environment for Vanna AI operations. ```python %pip install 'vanna[qdrant,openai,snowflake]' ``` -------------------------------- ### Install Vanna.ai with Qdrant, Gemini, and Postgres Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-gemini-qdrant.ipynb This command installs the Vanna.ai library along with specific dependencies for Qdrant (vector store), Google Gemini (LLM), and PostgreSQL (database connector). It ensures all necessary components are available for setting up a Vanna.ai instance. ```python %pip install 'vanna[qdrant,gemini,postgres]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-mistral-qdrant.ipynb This snippet initializes and runs a Flask-based user interface for Vanna AI, providing a web-based interaction method. It imports VannaFlaskApp and creates an instance, then starts the web server. This allows users to interact with Vanna through a graphical interface rather than directly via code. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Add Diverse Training Data to Vanna Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-openai-azure-qdrant.ipynb This section illustrates different methods to add training data to Vanna. It includes examples for training with DDL statements to define table structures, business documentation for terminology, and existing SQL queries to provide examples of common patterns. This enriches Vanna's understanding of the domain. ```python # The following are methods for adding training data. Make sure you modify the examples to match your database. # DDL statements are powerful because they specify table names, colume names, types, and potentially relationships vn.train(ddl=""" CREATE TABLE IF NOT EXISTS my-table ( id INT PRIMARY KEY, name VARCHAR(100), age INT ) """) # Sometimes you may want to add documentation about your business terminology or definitions. vn.train(documentation="Our business defines OTIF score as the percentage of orders that are delivered on time and in full") # You can also add SQL queries to your training data. This is useful if you have some queries already laying around. You can just copy and paste those from your editor to begin generating new SQL. vn.train(sql="SELECT * FROM my-table WHERE name = 'John Doe'") ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-openai-vanna-chromadb.ipynb This snippet demonstrates how to initialize and run the Vanna AI Flask web application. It imports `VannaFlaskApp`, instantiates it with the Vanna AI object (`vn`), and then starts the web server. This provides a graphical interface for interacting with Vanna AI. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with ChromaDB, Gemini, and BigQuery Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-gemini-chromadb.ipynb Installs the Vanna AI library along with specific dependencies for ChromaDB (vector store), Google Gemini (LLM), and BigQuery (database connector). This command uses pip with extra requirements to ensure all necessary components are available for the Vanna setup. ```python %pip install 'vanna[chromadb,gemini,bigquery]' ``` -------------------------------- ### Launch Vanna Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-openai-vanna-vannadb.ipynb This code initializes and runs a Vanna Flask web application, providing a graphical user interface for interacting with Vanna. It allows users to ask questions and view generated SQL queries through a web browser, offering a more interactive experience. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Launch Vanna Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-openai-azure-vannadb.ipynb Provides the Python code to initialize and run the Vanna Flask web application, allowing users to interact with Vanna through a graphical user interface in their browser. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with Ollama and MySQL dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-ollama-vannadb.ipynb Installs the Vanna library along with specific dependencies for Ollama and MySQL. This enables local LLM integration and MySQL database connectivity, which are crucial for the Vanna AI setup. ```python %pip install 'vanna[ollama,mysql]' ``` -------------------------------- ### Install Vanna AI with Qdrant, OpenAI, and MySQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-openai-standard-qdrant.ipynb This command installs the Vanna AI library along with optional dependencies for Qdrant vector store, OpenAI integration, and MySQL database connectivity using pip. It ensures all necessary packages are available for setting up Vanna AI. ```python %pip install 'vanna[qdrant,openai,mysql]' ``` -------------------------------- ### Install Vanna AI with ChromaDB and MistralAI Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-mistral-chromadb.ipynb Installs the Vanna AI library along with its integrations for ChromaDB (vector store) and MistralAI (language model). This command uses pip and specifies optional dependencies required for the setup. ```python %pip install 'vanna[chromadb,mistralai]' ``` -------------------------------- ### Install Vanna with Marqo and Snowflake Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-other-llm-marqo.ipynb Installs the Vanna library along with optional dependencies for Marqo vector database integration and Snowflake data warehouse connectivity. This command ensures all required packages are available for the custom setup. ```python %pip install 'vanna[marqo,snowflake]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-openai-standard-qdrant.ipynb Provides code to initialize and run a Flask-based user interface for Vanna AI. This allows users to interact with Vanna through a web application, offering a more user-friendly experience than direct code interaction. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with Qdrant and Postgres Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-openai-vanna-qdrant.ipynb This snippet installs the Vanna library along with its specific dependencies for Qdrant vector store integration and PostgreSQL database connectivity using the pip package manager. ```python %pip install 'vanna[qdrant,postgres]' ``` -------------------------------- ### Install Vanna AI with Qdrant, OpenAI, and Postgres Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-openai-standard-qdrant.ipynb This command installs the Vanna AI library along with specific dependencies for Qdrant (vector store), OpenAI (LLM integration), and Postgres (database connector). It ensures all necessary components are available for setting up a Vanna AI instance. ```python %pip install 'vanna[qdrant,openai,postgres]' ``` -------------------------------- ### Install Vanna AI with OpenAI Dependencies in Notebook Source: https://github.com/vanna-ai/notebooks/blob/main/other-database-openai-azure-vannadb.ipynb Installs the Vanna AI library and its OpenAI dependencies using pip. This command is typically run in a Jupyter or IPython notebook environment to prepare the Vanna AI setup. ```python %pip install 'vanna[openai]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-gemini-marqo.ipynb This code demonstrates how to launch a local web-based user interface for Vanna AI using the `VannaFlaskApp` class. It provides a graphical way to interact with Vanna and generate SQL queries through a browser. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with MistralAI and MSSQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-mistral-other-vectordb.ipynb Installs the Vanna library along with specific dependencies for MistralAI and Microsoft SQL Server integration using pip. This command ensures all necessary packages are available for the custom Vanna setup. ```python %pip install 'vanna[mistralai,mssql]' ``` -------------------------------- ### Install Vanna with Qdrant, MistralAI, and DuckDB Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-mistral-qdrant.ipynb Installs the Vanna library along with specific dependencies for Qdrant (vector store), MistralAI (language model), and DuckDB (database connector). This command ensures all required components are available for the setup. ```python %pip install 'vanna[qdrant,mistralai,duckdb]' ``` -------------------------------- ### Launch Vanna AI Flask Web Application Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-other-llm-qdrant.ipynb Provides code to initialize and run a Vanna AI web application using the Flask framework. It imports `VannaFlaskApp`, instantiates it with the Vanna AI object, and starts the web server, providing a graphical interface for interaction. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with Ollama and BigQuery Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-ollama-other-vectordb.ipynb This command installs the Vanna library along with its specific dependencies for Ollama and BigQuery. It uses the `%pip` magic command, common in Jupyter notebooks, to ensure all necessary packages are available for the Vanna setup. ```python %pip install 'vanna[ollama,bigquery]' ``` -------------------------------- ### Train Vanna with DDL, Documentation, and SQL Examples Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-mistral-chromadb.ipynb Shows different methods to train Vanna AI by providing various types of data. This includes Data Definition Language (DDL) statements for table structures, business documentation for contextual understanding, and existing SQL queries as examples for pattern recognition. ```python # The following are methods for adding training data. Make sure you modify the examples to match your database. # DDL statements are powerful because they specify table names, colume names, types, and potentially relationships vn.train(ddl=""" CREATE TABLE IF NOT EXISTS my-table ( id INT PRIMARY KEY, name VARCHAR(100), age INT ) """) # Sometimes you may want to add documentation about your business terminology or definitions. vn.train(documentation="Our business defines OTIF score as the percentage of orders that are delivered on time and in full") # You can also add SQL queries to your training data. This is useful if you have some queries already laying around. You can just copy and paste those from your editor to begin generating new SQL. vn.train(sql="SELECT * FROM my-table WHERE name = 'John Doe'") ``` -------------------------------- ### Install Vanna AI with OpenAI and Postgres Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-openai-azure-other-vectordb.ipynb This command installs the Vanna AI library using pip, including extra dependencies for integrating with OpenAI services and connecting to PostgreSQL databases. This ensures all required components for a Vanna setup are available. ```python %pip install 'vanna[openai,postgres]' ``` -------------------------------- ### Launch Vanna Flask Web User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-openai-standard-marqo.ipynb This code demonstrates how to initialize and run a Vanna web application using the Flask framework. It imports VannaFlaskApp and instantiates it with the Vanna object, then runs the Flask app. This provides a graphical interface for interacting with Vanna, making it accessible via a web browser. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with Qdrant and DuckDB dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-openai-vanna-qdrant.ipynb Installs the Vanna library along with necessary dependencies for Qdrant vector store and DuckDB database integration using pip. This command ensures all required components are available for the Vanna setup. ```python %pip install 'vanna[qdrant,duckdb]' ``` -------------------------------- ### Launch Vanna Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-ollama-chromadb.ipynb This code block initializes and runs a Flask-based web application for Vanna, providing a user-friendly interface to interact with the AI. It imports `VannaFlaskApp`, instantiates it with the Vanna object, and then starts the web server. This allows users to access Vanna's functionalities through a browser. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna Python Package Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-openai-vanna-other-vectordb.ipynb Installs the Vanna library using pip, the package installer for Python. This is the foundational step to set up the Vanna environment and enable its functionalities. ```python %pip install vanna ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/other-database-gemini-qdrant.ipynb This code snippet demonstrates how to launch a local web-based user interface for Vanna AI using the `vanna.flask` module. This provides an interactive way to interact with the AI, ask questions, and view generated SQL queries. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Train Vanna with Database Information Schema Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-openai-azure-qdrant.ipynb This code block shows how to train Vanna using the database's information schema. It first queries the INFORMATION_SCHEMA.COLUMNS to get metadata, then generates a training plan, and optionally trains Vanna with this plan. This helps Vanna understand the database structure. ```python # The information schema query may need some tweaking depending on your database. This is a good starting point. df_information_schema = vn.run_sql("SELECT * FROM INFORMATION_SCHEMA.COLUMNS") # This will break up the information schema into bite-sized chunks that can be referenced by the LLM plan = vn.get_training_plan_generic(df_information_schema) plan # If you like the plan, then uncomment this and run it to train # vn.train(plan=plan) ``` -------------------------------- ### Install Vanna.ai with BigQuery Support Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-other-llm-vannadb.ipynb Installs the Vanna.ai library along with the necessary dependencies for BigQuery integration. This command ensures that all required packages for connecting to and querying BigQuery databases are available. ```python %pip install 'vanna[bigquery]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-openai-vanna-chromadb.ipynb This code demonstrates how to initialize and run the Vanna AI Flask web application. It allows users to interact with Vanna through a graphical user interface, providing a more accessible way to generate and manage SQL queries. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Qdrant and Snowflake Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-other-llm-qdrant.ipynb Installs the Vanna AI library along with specific dependencies for Qdrant vector store and Snowflake database integration using pip. This command ensures all necessary packages are available for a Vanna AI setup. ```python %pip install 'vanna[qdrant,snowflake]' ``` -------------------------------- ### Install Vanna with Qdrant and Ollama Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-ollama-qdrant.ipynb This command installs the Vanna library along with its Qdrant and Ollama integrations. It uses `pip` for package management and is typically run in a Jupyter notebook environment to prepare the environment for Vanna. ```python %pip install 'vanna[qdrant,ollama]' ``` -------------------------------- ### Install Vanna AI with Gemini and MySQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-gemini-other-vectordb.ipynb This snippet installs the Vanna AI library using pip, including specific extras for Google Gemini integration and MySQL database connectivity. It ensures all necessary components are available for a Vanna AI setup. ```python %pip install 'vanna[gemini,mysql]' ``` -------------------------------- ### Launch Vanna Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-openai-vanna-other-vectordb.ipynb This snippet provides the necessary code to import and launch the Vanna Flask web application. Running this will start a local web server, providing a graphical user interface for interacting with Vanna. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Marqo, Gemini, and BigQuery Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-gemini-marqo.ipynb This command installs the Vanna AI library along with optional dependencies for Marqo, Google Gemini, and Google BigQuery. It is typically executed in a Jupyter notebook or similar interactive Python environment to prepare the environment for Vanna AI operations. ```python %pip install 'vanna[marqo,gemini,bigquery]' ``` -------------------------------- ### Add Various Types of Training Data to Vanna Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-openai-standard-qdrant.ipynb Shows different methods to add training data to Vanna, including DDL statements for schema information, documentation for business terminology, and existing SQL queries. Examples are provided for each type of training data to enrich the model's understanding. ```python # The following are methods for adding training data. Make sure you modify the examples to match your database. # DDL statements are powerful because they specify table names, colume names, types, and potentially relationships vn.train(ddl=""" CREATE TABLE IF NOT EXISTS my-table ( id INT PRIMARY KEY, name VARCHAR(100), age INT ) """) # Sometimes you may want to add documentation about your business terminology or definitions. vn.train(documentation="Our business defines OTIF score as the percentage of orders that are delivered on time and in full") # You can also add SQL queries to your training data. This is useful if you have some queries already laying around. You can just copy and paste those from your editor to begin generating new SQL. vn.train(sql="SELECT * FROM my-table WHERE name = 'John Doe'") ``` -------------------------------- ### Install Vanna AI with Anthropic and Postgres Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-anthropic-vannadb.ipynb This command installs the Vanna AI library along with its specific dependencies for integrating with Anthropic (for large language model interactions) and PostgreSQL (for database connectivity). It ensures all necessary components are available for a Vanna setup. ```python %pip install 'vanna[anthropic,postgres]' ``` -------------------------------- ### Install Vanna AI with Qdrant and OpenAI dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/other-database-openai-standard-qdrant.ipynb This command installs the Vanna AI library along with its optional dependencies for Qdrant (vector store) and OpenAI (chat model). It is typically executed in an IPython or Jupyter environment to prepare the environment for Vanna AI usage. ```python %pip install 'vanna[qdrant,openai]' ``` -------------------------------- ### Install Vanna AI Python Package with Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-openai-azure-chromadb.ipynb This command installs the Vanna AI library using pip. It includes extra dependencies for ChromaDB (vector store), OpenAI (LLM integration), and MSSQL (database connector), ensuring a comprehensive setup for Vanna AI. ```python %pip install 'vanna[chromadb,openai,mssql]' ``` -------------------------------- ### Launch Vanna Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/sqlite-openai-standard-marqo.ipynb This code demonstrates how to initialize and run the Vanna Flask web application, providing a graphical user interface for interacting with Vanna. It allows users to ask questions and view generated SQL queries through a web browser. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Marqo, Mistral, and MSSQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-mistral-marqo.ipynb This command installs the Vanna AI library along with specific dependencies for Marqo, Mistral AI, and Microsoft SQL Server. This setup enables integration with these services for enhanced Vanna AI functionality. ```python %pip install 'vanna[marqo,mistralai,mssql]' ``` -------------------------------- ### Install Vanna AI Dependencies with pip Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-openai-standard-marqo.ipynb Installs the Vanna AI library along with optional dependencies for Marqo, OpenAI, and PostgreSQL support. This command ensures all necessary components are available for setting up Vanna AI. ```python %pip install 'vanna[marqo,openai,postgres]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-openai-azure-vannadb.ipynb Explains how to launch a local web-based user interface for Vanna AI using the `vanna.flask` module. This provides a convenient way to interact with Vanna and visualize its capabilities in a browser. ```Python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with Marqo and Gemini Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-gemini-marqo.ipynb Installs the necessary Python packages for Vanna, including integrations for Marqo (vector database) and Google Gemini (LLM), along with MySQL support. This command ensures all required libraries are available for the Vanna setup. ```python %pip install 'vanna[marqo,gemini,mysql]' ``` -------------------------------- ### Install Vanna AI with MSSQL Support Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-other-llm-vannadb.ipynb This command installs the Vanna AI library, specifically including support for Microsoft SQL Server. It uses pip, the Python package installer. ```python %pip install 'vanna[mssql]' ``` -------------------------------- ### Add Various Types of Training Data to Vanna Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-ollama-marqo.ipynb This section illustrates different methods to add training data to Vanna, including DDL statements for schema definition, documentation for business terminology, and existing SQL queries. Examples are provided for each type to guide users in populating their Vanna instance. ```python # The following are methods for adding training data. Make sure you modify the examples to match your database. # DDL statements are powerful because they specify table names, colume names, types, and potentially relationships vn.train(ddl=""" CREATE TABLE IF NOT EXISTS my-table ( id INT PRIMARY KEY, name VARCHAR(100), age INT ) """) # Sometimes you may want to add documentation about your business terminology or definitions. vn.train(documentation="Our business defines OTIF score as the percentage of orders that are delivered on time and in full") # You can also add SQL queries to your training data. This is useful if you have some queries already laying around. You can just copy and paste those from your editor to begin generating new SQL. vn.train(sql="SELECT * FROM my-table WHERE name = 'John Doe'") ``` -------------------------------- ### Install Vanna with Marqo and OpenAI Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/other-database-openai-standard-marqo.ipynb Installs the Vanna library along with its Marqo and OpenAI integrations using pip. This command ensures all necessary dependencies for Vanna's vector database and LLM components are available for use. ```python %pip install 'vanna[marqo,openai]' ``` -------------------------------- ### Add Various Types of Training Data to Vanna Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-gemini-marqo.ipynb This section illustrates different methods for adding training data to Vanna AI. It covers adding DDL statements for schema understanding, documentation for business terminology, and existing SQL queries to bootstrap new SQL generation. Examples are provided for each type. ```python # The following are methods for adding training data. Make sure you modify the examples to match your database. # DDL statements are powerful because they specify table names, colume names, types, and potentially relationships vn.train(ddl=""" CREATE TABLE IF NOT EXISTS my-table ( id INT PRIMARY KEY, name VARCHAR(100), age INT ) """) # Sometimes you may want to add documentation about your business terminology or definitions. vn.train(documentation="Our business defines OTIF score as the percentage of orders that are delivered on time and in full") # You can also add SQL queries to your training data. This is useful if you have some queries already laying around. You can just copy and paste those from your editor to begin generating new SQL. vn.train(sql="SELECT * FROM my-table WHERE name = 'John Doe'") ``` -------------------------------- ### Install Vanna AI with Marqo, Ollama, and MySQL dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-ollama-marqo.ipynb This command installs the Vanna AI library along with optional dependencies for Marqo, Ollama, and MySQL, enabling vector search and local LLM capabilities. ```python %pip install 'vanna[marqo,ollama,mysql]' ``` -------------------------------- ### Generate and Review Vanna Training Plan Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-other-llm-chromadb.ipynb This section outlines the process of generating a training plan for Vanna AI. It starts by querying the information schema of the connected database to get column details, then uses `get_training_plan_generic` to create a structured plan for the LLM. The generated plan can be reviewed before actual training is initiated. ```python # The information schema query may need some tweaking depending on your database. This is a good starting point. df_information_schema = vn.run_sql("SELECT * FROM INFORMATION_SCHEMA.COLUMNS") # This will break up the information schema into bite-sized chunks that can be referenced by the LLM plan = vn.get_training_plan_generic(df_information_schema) plan # If you like the plan, then uncomment this and run it to train # vn.train(plan=plan) ``` -------------------------------- ### Install Vanna AI with ChromaDB, Ollama, and Postgres Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-ollama-chromadb.ipynb This command installs the Vanna AI library along with specific extras for ChromaDB (vector store), Ollama (local LLM integration), and PostgreSQL (database connectivity). It ensures all required components for the Vanna setup are available. ```python %pip install 'vanna[chromadb,ollama,postgres]' ``` -------------------------------- ### Install Vanna AI with ChromaDB, OpenAI, and BigQuery dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-openai-standard-chromadb.ipynb This command installs the Vanna AI library along with its required dependencies for ChromaDB (vector store), OpenAI (LLM integration), and BigQuery (database connector). It's a common first step for setting up a Vanna AI project in a Python environment. ```python %pip install 'vanna[chromadb,openai,bigquery]' ``` -------------------------------- ### Install Vanna AI with Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-mistral-chromadb.ipynb This snippet installs the Vanna AI library using pip, including specific integrations for ChromaDB (vector database), Mistral AI (language model), and PostgreSQL (database connector). This ensures all required components for a functional Vanna setup are available. ```python %pip install 'vanna[chromadb,mistralai,postgres]' ``` -------------------------------- ### Install Vanna AI with ChromaDB and Ollama Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/other-database-ollama-chromadb.ipynb Installs the Vanna AI library along with necessary dependencies for ChromaDB vector store and Ollama language model integration. This command is typically run in a Jupyter notebook environment to prepare the development setup. ```python %pip install 'vanna[chromadb,ollama]' ``` -------------------------------- ### Install Vanna AI with Marqo and MySQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-openai-vanna-marqo.ipynb Installs the Vanna AI library along with optional dependencies for Marqo (vector database) and MySQL (database connector). This command is typically run in a Jupyter notebook environment. ```python %pip install 'vanna[marqo,mysql]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-ollama-vannadb.ipynb Provides the necessary Python code to initialize and run a local web-based user interface for Vanna AI using the `VannaFlaskApp`. This interface allows for interactive querying, training, and management of the Vanna instance. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with ChromaDB and MSSQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-other-llm-chromadb.ipynb Installs the Vanna AI library along with optional dependencies for ChromaDB vector store and Microsoft SQL Server database connectivity using pip. This command ensures all required packages are available for the custom setup. ```python %pip install 'vanna[chromadb,mssql]' ``` -------------------------------- ### Install Vanna AI with Marqo, OpenAI, and BigQuery Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-openai-azure-marqo.ipynb This command installs the Vanna AI library along with its optional dependencies. It includes support for Marqo, OpenAI, and BigQuery, enabling comprehensive data querying capabilities. ```python %pip install 'vanna[marqo,openai,bigquery]' ``` -------------------------------- ### Install Vanna AI with Mistral and MSSQL Support (Python) Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-mistral-vannadb.ipynb This command installs the Vanna AI library, including specific integrations for Mistral AI and Microsoft SQL Server. It uses `pip` within a Jupyter/IPython environment to ensure all necessary dependencies are met for a comprehensive setup. ```python %pip install 'vanna[mistralai,mssql]' ``` -------------------------------- ### Install Vanna with Gemini and MSSQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/oracle-gemini-other-vectordb.ipynb Installs the Vanna library along with specific dependencies for Google Gemini integration and Microsoft SQL Server database connectivity using pip. This command ensures all required packages are available for a Vanna setup. ```python %pip install 'vanna[gemini,mssql]' ``` -------------------------------- ### Launch Vanna Flask Web Application Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-openai-vanna-qdrant.ipynb This code block shows how to initialize and run a Vanna web application using the `VannaFlaskApp` from the `vanna.flask` module. This provides a user interface for interacting with Vanna. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna with Marqo, Anthropic, and MySQL Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-anthropic-marqo.ipynb This command installs the Vanna library and its specified dependencies using pip. It includes support for Marqo (vector database), Anthropic (AI model), and MySQL (database connector), enabling a comprehensive setup for Vanna's functionalities. ```python %pip install 'vanna[marqo,anthropic,mysql]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/postgres-other-llm-qdrant.ipynb This code demonstrates how to initialize and run the Vanna AI Flask web application. This provides a graphical user interface for interacting with Vanna, allowing users to ask questions and view generated SQL queries. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Mistral and DuckDB Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-mistral-other-vectordb.ipynb This command installs the Vanna AI library along with specific dependencies for Mistral AI and DuckDB. This setup enables the use of these components within Vanna for advanced natural language to SQL capabilities. ```python %pip install 'vanna[mistralai,duckdb]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-gemini-marqo.ipynb Provides code to import and run the Vanna AI Flask application, enabling a web-based user interface for interacting with Vanna AI. This allows for a more customizable and accessible way to use the tool. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Marqo and OpenAI Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/mssql-openai-standard-marqo.ipynb This command installs the Vanna AI library along with its Marqo and OpenAI integrations. It is typically used in a Jupyter environment to ensure all required packages are available for the notebook. ```python %pip install 'vanna[marqo,openai]' ``` -------------------------------- ### Install Vanna AI with Qdrant, OpenAI, BigQuery dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-openai-standard-qdrant.ipynb This command installs the Vanna AI library and its required dependencies for Qdrant, OpenAI, and BigQuery. It uses the %pip magic command, suitable for Jupyter notebooks, to ensure all necessary components are available for the Vanna AI setup. ```python %pip install 'vanna[qdrant,openai,bigquery]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/duckdb-gemini-qdrant.ipynb This code demonstrates how to initialize and run a Flask-based user interface for Vanna AI. It imports `VannaFlaskApp`, creates an instance linked to the Vanna AI object, and then starts the web application, providing a graphical way to interact with Vanna. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with Anthropic and BigQuery Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-anthropic-vannadb.ipynb This command installs the Vanna AI library using pip, specifically including optional dependencies for Anthropic chat models and BigQuery database connectivity. This ensures all required components for a comprehensive Vanna setup are available. ```python %pip install 'vanna[anthropic,bigquery]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/bigquery-openai-standard-qdrant.ipynb This snippet initializes and runs a local Flask web application for Vanna AI, providing a user interface to interact with the model. It imports `VannaFlaskApp` and then creates and runs an instance of the app, making Vanna accessible via a web browser for interactive use. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ``` -------------------------------- ### Install Vanna AI with ChromaDB, OpenAI, and Snowflake Dependencies Source: https://github.com/vanna-ai/notebooks/blob/main/snowflake-openai-standard-chromadb.ipynb This command installs the Vanna AI library along with specific extras for ChromaDB (vector store), OpenAI (language model integration), and Snowflake (database connectivity). It ensures all required components are available for a comprehensive Vanna setup. ```python %pip install 'vanna[chromadb,openai,snowflake]' ``` -------------------------------- ### Launch Vanna AI Flask User Interface Source: https://github.com/vanna-ai/notebooks/blob/main/mysql-gemini-other-vectordb.ipynb This snippet demonstrates how to initialize and run a Flask-based web application for Vanna AI. It imports `VannaFlaskApp`, instantiates it with the Vanna model, and then starts the web server, providing a graphical interface for interacting with Vanna. ```python from vanna.flask import VannaFlaskApp app = VannaFlaskApp(vn) app.run() ```