Code Buddy is an AI-driven assistant designed to answer technical questions using the latest documentation from various technologies. It leverages RAG (Retrieval-Augmented Generation) architecture combined with LangGraph, LangChain, and Pinecone to provide accurate, up-to-date responses by retrieving relevant documents and generating informed answers in real time.
This project was built during a hackathon with no prior experience in LangGraph. Everything was self-learned through documentation on the fly—demonstrating adaptability and a strong learning curve.
- LangGraph & LangChain Integration: Modular, agentic workflow using state graphs and tools.
- Document Ingestion: Retrieves and stores documentation in a vector store using Pinecone.
- Search Augmentation: Queries search engines (via Tavily) to fetch recent, real-time content.
- Contextual Q&A: Answers user queries with context from retrieved documents.
- Powered by Cohere LLM: Generates coherent and accurate answers using Cohere's language models.
LangGraph- Agentic framework for composing workflowsLangChain- Framework for building LLM appsPinecone- Vector store for semantic searchTavily- Real-time web search toolCohere- LLM for generating answersPython- Implementation languageJupyter Notebook- Prototyping environment
-
Document Retrieval:
- Uses TavilySearchResults to fetch documentation.
- Converts fetched pages into
Documentobjects.
-
Vector Store Indexing:
- Extracted documentation is embedded and indexed into Pinecone.
-
Query Handling:
- User inputs a query.
- Relevant documents are retrieved from Pinecone.
- A prompt is dynamically generated.
- Cohere LLM processes the prompt to generate an informed answer.
-
Agentic Execution:
- LangGraph handles state transitions (START → RAG → END).
- A tools-based conditional path determines whether to fetch or generate.
User: "How does LangGraph manage state transitions?"
Code Buddy:
- Searches recent LangGraph docs using Tavily.
- Retrieves top pages and converts them into vector embeddings.
- Queries Pinecone for the most relevant chunks.
- Constructs a prompt and generates a concise, helpful answer using Cohere.
-
Clone the repo
git clone https://github.com/sharukh010/code_buddy_team_attention/ cd code_buddy_team_attention -
Install dependencies manually
pip install -r requirements.txt
-
Set environment variables Create a
.envfile:TAVILY_API_KEY=your_tavily_key COHERE_API_KEY=your_cohere_key PINECONE_API_KEY=your_pinecone_key PINECONE_ENV=your_pinecone_env
-
Run the notebook Open
code_buddy.ipynbin Jupyter and run all cells.
- Deploy as a web app using Streamlit or Gradio.
- Add support for multi-document summarization.
- Integrate chat history for contextual follow-ups.
- Enable fine-tuned LLM integration.
MIT License. Feel free to fork, contribute, and build upon!