Important
App works best when installed locally!
To get started with Kairos, follow these steps:
- Langchain
- Streamlit
- Gemini API
- Jinja2 for prompt templating
- Bs4 & googlesearch api for scraping
- KeyBERT for keyword extraction
- Streamlit share for deployment
- Clone the repository:
git clone https://github.com/sarthakkapila/kairos.git
- Go to main dir:
cd kairos
- Create virtual env:
python -m venv kairos
- Activate virtual env:
source kairos/bin/activate
(for windows):kairos/Scripts/activate
- Install all dependencies:
pip install -r requirements.txt
Important
Please reload the demo 1 or 2 times for it to work properly.
The high level workflow is divided into different steps. The user selects a base model, for now Gemini-Pro. When provided with the api. The user is directed to workspace page where they input a prompt.
The input prompt given by the user is processed and the DecisionTaken agent determines the course of action. We have divided the DecisonTaker into 2 types of queries i.e.
- Code-related
- Non Code-related
Currently we have limited the non-code related queries.
Kairos generates a step-by-step plan using Planner agent, which is then presented visually, Step Formulation: Drawing from the objective and context, Kairos devises a series of broad steps to achieve the task.
The prompt's keywords are extracted as the name suggests. To extract the keywords we have employed BERT model which divides the prompt into nuances and find significance behind the words within. Working of bert: the Bert model is used to extract the keywords and rank them based on their relevance to the user's prompt. Kairos then pinpoints each part performs a research on it using Researcher Agent , retrieving information for task.
Researcher agent maintain search queries, which expands its knowledge base. Based on the contextual keywords extracted above, Kairos creates helpful search queries that can be emplyed with the googlesearch-py. Then the requests module is used to fetch the web pages of the queries. Using the beautifulsoup library, we extract the content from the web pages for processing.
Then, Kairos conducts internet searches based on queries, The info is then present in JSON format (For now) in browser tab.
The Coder agent then utilizes the plan and acquired information to write code. Then, the code generation module crafts code based on the planner, researcher, & taking in consider user prompts/specs. High level design -> Drawing from the planner, it constructs the foundational code, including classes fn etc. Then the rest of the code including algos, data etc are added which were extrated from research, the knowledge repo, thus code is produced.
Finally, Kairos's Creator agent generates and executes Python code to create and organize project directory and & different files.
Following the code generation, Kairos initiates the creation of a Python script utilizing the os module. Then it begins organizing the project files and folders generated previously during the coding phase of the project.