Welcome to the forefront of scenario analysis. Gnerate insightful questions and responses, coupled with a dynamic interface for engaging with hypothetical scenarios. Ideal for strategists, researchers, and innovators, our tools facilitate the exploration of complex situations, enabling users to make well-informed decisions based on simuluted future scenarios. Embrace a realm of possibilities and endless number of future worlds with Simulation AI and revolutionize your approach to problem-solving and strategic planning.
This project was created for the Assistants API LlamaIndex MongoDB Battle Hackathon.
Before running the scripts, ensure you have the following installed:
- Python 3.12
- MongoDB
- Streamlit
- OpenAI API key
- A Python environment manager (e.g., Miniconda, virtualenv)
-
Clone the repository:
git clone https://github.com/alexpwrd/aihackers.git
-
Navigate to the repository directory:
cd aihackers -
Set up a Python environment: You can use Miniconda or any other Python environment manager you prefer. Below are instructions for Miniconda and virtualenv as examples:
-
Using Miniconda:
conda create --name sim python=3.12 conda activate sim
-
Using virtualenv:
python -m venv sim-env source sim-env/bin/activate # On Windows use `sim-env\Scripts\activate`
-
-
Install required Python packages:
pip install -r requirements.txt
Create a .env file in the root directory of the project with the following environment variables:
OPENAI_API_KEY=your_openai_api_key
MONGO_URI=your_mongodb_uri
To use the vector search capabilities, you need to set up an Atlas Search Index on your MongoDB collection. Follow these steps to create an index named vector_index for the simulation.synthdata collection:
- Log in to your MongoDB Atlas dashboard.
- Navigate to your cluster where the
simulationdatabase is hosted. - Go to the "Collections" tab, and select the
simulationdatabase and thesynthdatacollection. - Click on "Indexes" and then click "Create Index".
- Choose "Search Index" and then use the following JSON configuration:
{ "fields": [ { "numDimensions": 1536, "path": "embedding", "similarity": "cosine", "type": "vector" } ] } - Name the index
vector_indexand create the index.
This script generates a series of questions based on a user-defined scenario and stores the responses in a MongoDB database.
Execute the following command in your terminal:
python sim_start.pyFollow the prompts to enter the scenario you wish to explore. The script will handle the generation and storage of questions and their detailed responses.
After generating data with sim_start.py, run this script to create embeddings for efficient querying.
Execute the following command in your terminal:
python sim_embed.pyThis script provides a web-based interface to chat with the stored responses.
To start the Streamlit web interface, run:
streamlit run sim_chat.pyNavigate to the provided local URL in your web browser to interact with the application.
This script evaluates the responses using the TruLens framework.
Execute the following command in your terminal:
python sim_eval.pyNavigate to the provided local URL in your web browser to interact with the application. Enter queries related to the stored scenarios and view responses directly from the MongoDB database.
- Ensure MongoDB is running and accessible via the URI provided in your
.envfile. - Use the Streamlit interface for an interactive experience with real-time feedback.
For any issues or questions, please open an issue on the GitHub repository or contact us.
Thank you for using our Simulation AI and Query Interface tools!