This repository provides the IoT-Agentic-Search-Engine project that leverages a DevContainer for a seamless development environment setup. Follow the instructions below to install and start the demo.
Before you begin, ensure you have the following installed on your system:
- VS Code - Download and Install
- DevContainers Extension for VS Code:
- Install the Dev Containers Extension from the VS Code Extensions Marketplace.
- Docker - Download and Install
Clone this repository to your local machine:
git clone https://github.com/SensorsConnect/IoT-Agentic-Search-Engine.git
cd IoT-Agentic-Search-Engine
Launch VS Code and open the cloned project directory:
code .
-
Once the project is opened in VS Code, you'll see a prompt:
"Folder contains a Dev Container configuration file. Reopen folder to develop in a container."
Click Reopen in Container. -
If the prompt does not appear, manually reopen the folder in a DevContainer:
- Press
F1
(orCtrl+Shift+P
). - Select Dev Containers: Reopen in Container.
- Press
VS Code will automatically build the DevContainer using the provided .devcontainer/devcontainer.json
file. This process may take a few minutes during the first run.
-
Open a terminal inside the DevContainer.
-
Run the following command to activate the IoT-Engine Conda environment:
conda activate IoT-engine
-
To make this environment the default for the container, run:
conda config --set auto_activate_base false echo "conda activate IoT-engine" >> ~/.bashrc
-
Close and reopen the terminal to ensure the changes take effect.
VS Code will automatically build the DevContainer using the provided .devcontainer/devcontainer.json
file. This process may take a few minutes during the first run.
Once the container is running, verify that the environment is correctly set up by running the following command in the terminal inside the container:
bash setup-demo.sh
This script will install dependencies and prepare the demo.
Before running the project, ensure you have the following environment variables configured in a .env
file at the root of your project. This file should not be shared publicly as it contains sensitive information.
- Create a
.env
file in the root directory of the project (if not already present). - Copy the environment variables listed in .env.example into your
.env
file. - Replace the empty values with the appropriate keys and URLs.
Run the following command to export environment variables from a .env
file into your system environment.
bash export_env.sh
source ~/.bashrc
- Navigate to the vector_db folder:
cd src/vector_db/
- Create services descriptions vector database:
python create_vectordb.py
Start the demo run the following demo in src
:
uvicorn main:app --reload
- Follow the instructions provided in the terminal output to access the application, usually via
http://127.0.0.1:8000/docs
. - To try the IoT- Agentic Search Engine (IoT-ASE), click the try button on the query API and replace
"string"
in thetext
value with your query and put a randomthreadid
value, for instance
{
"text": "I want to get coffee",
"threadId": "1234"
}
- Click on the execute button and wait until you receive the response.
The devcontainer is configured using the following files:
.devcontainer/devcontainer.json
: Defines the container settings.Dockerfile
: Customizes the development container image.setup-demo.sh
: Installs dependencies required for the demo.
Feel free to adjust these files to fit your needs.
-
Ensure Docker is running on your system.
-
If the container build fails, clear the cache and try again:
Dev Containers: Rebuild Container
(accessible via
Ctrl+Shift+P
orF1
). -
Check for common issues in the Dev Containers documentation.
Feel free to open issues or submit pull requests if you find any bugs or have suggestions for improvement.
This project is licensed under the MIT License. See the LICENSE file for details.