CodeQuest is an AI-powered agent designed to streamline the onboarding process for software engineers. It integrates directly into Slack, answering questions about documentation and explaining complex code snippets to help new hires get up to speed faster.
Software engineer onboarding is often a slow and expensive process. New engineers face scattered documentation, complex codebases, and limited access to senior engineers' time. This leads to lost productivity and frustration. CodeQuest tackles this by providing an instant, context-aware knowledge source.
- Documentation Navigator: Ask questions in natural language and get answers sourced directly from your project's documentation. The system uses a Retrieval-Augmented Generation (RAG) pipeline to provide accurate, context-aware responses.
- Code Understanding: Paste a snippet of code and ask CodeQuest to explain it. The bot provides a breakdown of the code's purpose, language, and logic, along with architectural context and best practices.
- Seamless Slack Integration: Interact with CodeQuest directly within your team's workspace, ensuring a smooth and natural workflow.
This project was built using a modern, modular architecture, leveraging powerful AI tools.
- AI & Machine Learning:
- Language Model: Google Gemini Pro
- Framework: LangChain
- Embeddings: Google's
embedding-001Model - Vector Store: FAISS (Facebook AI Similarity Search)
- Backend & Integration:
- Language: Python
- Slack Integration:
slack-bolt - Environment Management:
python-dotenv
CodeQuest uses a router-based approach within the Slack bot.
- Slack Listener: The bot listens for
@mentionsin Slack channels. - Request Router: When mentioned, it analyzes the message.
- If the message contains a code block (
...), it's routed to the Code Analyzer. - Otherwise, it's treated as a documentation question and routed to the Documentation Navigator.
- If the message contains a code block (
- RAG Pipeline (Documentation): The question is used to retrieve relevant text chunks from the FAISS vector store, which are then passed to the Gemini model along with the original question to generate an answer.
- LLM Chain (Code Analysis): The code snippet is inserted into a specialized prompt and sent directly to the Gemini model for a detailed explanation.
Follow these steps to set up and run CodeQuest locally.
- Python 3.8+
- A Slack workspace where you can install apps.
- API keys for Google AI and Slack.
git clone https://github.com/your-username/codequest.git
cd codequestCreate and activate a virtual environment.
# Create the virtual environment
python -m venv venv
# Activate it (macOS/Linux)
source venv/bin/activate
# Or (Windows)
# venv\Scripts\activateInstall the required dependencies.
pip install -r requirements.txtCreate a .env file in the root directory and add your API keys.
# .env file
GOOGLE_API_KEY="YOUR_GOOGLE_AI_API_KEY"
SLACK_BOT_TOKEN="YOUR_xoxb-SLACK_BOT_TOKEN"
SLACK_APP_TOKEN="YOUR_xapp-SLACK_APP_TOKEN"
- Add your project's Markdown documentation files to the
/docsdirectory. - Run the
doc_navigator.pyscript once to create the local vector store.
python doc_navigator.pyThis will create a faiss_index folder containing the knowledge base.
Start the Slack bot.
python app.pyInvite the bot to a channel in your Slack workspace and start asking it questions!
1. Ask a question about the documentation:
@CodeQuest-Bot what is the database technology used?
2. Ask for a code explanation:
@CodeQuest-Bot please explain this code snippet:
```python
def __init__(self, key):
self.key = key
```
