Skip to content

adityakumarprasad/Ask_Your_Codebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ask Your Codebase CLI

An agentic CLI tool that lets a developer ask natural-language questions about their codebase and have an AI agent search, explain, edit, and fix code — using RAG for retrieval and LangGraph for reasoning.

Tech Stack

  • Language: Python 3.11+
  • Agent Framework: LangGraph + LangChain
  • Embeddings: sentence-transformers (all-MiniLM-L6-v2 runs locally)
  • Vector Database: ChromaDB (local persistence)
  • LLM Providers: Groq (default), Google Gemini, and Ollama (local)
  • CLI Framework: Typer

Installation

Install in editable mode:

pip install -e .

To run the agent, export the environment variable for your LLM provider:

# For Groq
export GROQ_API_KEY="your-groq-api-key"

# For Google Gemini
export GEMINI_API_KEY="your-gemini-api-key"

Configuration

You can customize indexing and LLM settings by creating a .askcodebase.yml file in the root of your project:

ignore_patterns:
  - "node_modules/**"
  - ".git/**"
  - "venv/**"
  - ".venv/**"
  - "dist/**"

chunk:
  size: 1000
  overlap: 200

agent:
  max_iterations: 5
  auto_apply: false

llm:
  provider: "groq"
  model: "llama-3.1-8b-instant"
  temperature: 0.0

CLI Commands

1. Index Codebase

Recursively scans the directory, respects .gitignore, and generates embeddings:

ask-codebase index

To index a specific folder path:

ask-codebase index /path/to/project

2. Ask a Question

Get answers with precise file and line citations:

ask-codebase ask "How does the authentication middleware work?"

3. Automatically Fix Bugs

Ask the agent to locate a bug, modify code, and verify it with the project's tests:

ask-codebase fix "Fix the division-by-zero issue in calculator.py"

4. Interactive Chat (REPL)

Run a persistent, multi-turn conversation session:

ask-codebase chat

Use the --verbose or -v flag on any command to inspect the agent's full plan, tool calls, and observations.

About

An agentic CLI tool to search, explain, edit, and fix code in your codebase using RAG (ChromaDB) and LangGraph reasoning.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages