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.
- Language: Python 3.11+
- Agent Framework: LangGraph + LangChain
- Embeddings: sentence-transformers (
all-MiniLM-L6-v2runs locally) - Vector Database: ChromaDB (local persistence)
- LLM Providers: Groq (default), Google Gemini, and Ollama (local)
- CLI Framework: Typer
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"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.0Recursively scans the directory, respects .gitignore, and generates embeddings:
ask-codebase indexTo index a specific folder path:
ask-codebase index /path/to/projectGet answers with precise file and line citations:
ask-codebase ask "How does the authentication middleware work?"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"Run a persistent, multi-turn conversation session:
ask-codebase chatUse the --verbose or -v flag on any command to inspect the agent's full plan, tool calls, and observations.