This project I'm aiming as a Prerequisites for analysis of my application(proposal) to work on the project - 2 in GSOC for https://github.com/keploy/keploy keploy
- Real-time Codebase Indexing: Automatically indexes code files upon changes, with real-time updates.
- Vector Database Search: Utilizes FAISS or a similar vector database for fast, efficient code search using embeddings.
- Conversational Coding Assistance: Integrates OpenAI's GPT models to provide contextual code suggestions, improvements, and fixes.
- Configurable Settings: Environment-specific settings are managed using a
.envfile for API keys, model selection, and directories.
- OpenAI API: Leverages GPT-4o (or any other OpenAI model) for conversational and coding improvements.
- Python: Core functionality and API interactions.
- FAISS (Facebook AI Similarity Search): For vector-based searching.
- python-dotenv: For managing environment variables.
- Retrieval-Augmented Generation (RAG): Combines search and generative models.
- Python 3.8+
- OpenAI API Key (You can get one here)
- FAISS
Create a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`Install required packages:
pip install -r requirements.txtCreate a .env file in the root of the project and add the following variables:
OPENAI_API_KEY=your_openai_api_key
OPENAI_EMBEDDING_MODEL=text-embedding-ada-002
OPENAI_CHAT_MODEL=gpt-4o
WATCHED_DIR=path_to_your_code_directory
FAISS_INDEX_FILE=path_to_faiss_index
EMBEDDING_DIM=1536 # Modify if you're using a different embedding modelStart the Backend:
To start the backend (indexing, embeddings, and monitoring):
python main.py
Start the Frontend:
To launch the Streamlit UI:
streamlit run app.py
- Ask a Question: Type your question or code request into the interface. The model will search the indexed codebase and provide suggestions or improvements.
- Review Suggestions: You'll receive a merged or fixed version of the code based on the model's analysis.
- Conversational History: The system keeps track of your queries and the AI responses for better context in future interactions.
main.py: The main script to run the application.prompt_flow.py: Handles querying OpenAI's API and manages the search and conversational history.keployrag/config.py: Stores configuration and environment variables.keployrag/search.py: Manages vector database (FAISS) searches for relevant code snippets..env: Holds environment-specific settings (OpenAI API keys, model configuration, etc.).requirements.txt: Lists the Python dependencies needed to run the project.