ASKII is a CLI tool that answers natural-language questions about codebases using a RAG (Retrieval-Augmented Generation) pipeline with an agentic architecture. It ingests local git repositories into ChromaDB and uses semantic search to retrieve relevant code chunks, then synthesizes answers using Google's Gemini LLM.
Before installing ASKII, ensure you have the following installed on your system:
- Python 3.8+ - Required Python version
- Git - Required by GitPython for repository operations
- ripgrep (
rgcommand) - Required by the Explorer agent for file searching- macOS:
brew install ripgrep - Linux:
apt-get install ripgreporyum install ripgrep - Windows: Download from ripgrep releases
- macOS:
- Google Gemini API Key - Required for embeddings and LLM inference
- Get your API key from Google AI Studio
- Clone this repository:
git clone <repository-url>
cd ASKII- Install the package in editable mode:
pip install -e .This will install all Python dependencies from requirements.txt and set up the askii command-line tool.
ASKII requires a Google Gemini API key to function. Set it as an environment variable:
export GEMINI_API_KEY="your-api-key-here"Alternatively, you can use GOOGLE_API_KEY (both are supported).
For convenience, you can create a .env file in the project root:
GEMINI_API_KEY=your-api-key-here
The .env file is automatically loaded by the application.
# 1. Install ASKII
pip install -e .
# 2. Set your API key
export GEMINI_API_KEY="your-api-key-here"
# 3. Navigate to your repository (e.g., httpx)
cd /path/to/httpx
# 4. Ask a question about the codebase
askii "How does httpx handle request timeouts?"Or using Python directly (without installation):
# Set API key
export GEMINI_API_KEY="your-api-key-here"
# Run directly
python app.py "How does httpx handle request timeouts?" --repository-path /path/to/httpxNote: The first query may take longer as ASKII indexes relevant files on-demand. Subsequent queries are faster as the index is reused.
# Query the current directory (must be a git repository)
askii "How does the code validate SSL certificates?"
# Query a specific repository
askii "Where is proxy support implemented?" --repository-path /path/to/repo
# Reset the index and re-index before querying
askii "Explain the authentication flow" --repository-path /path/to/repo --reset-indexHere are some example queries you can ask about the httpx library:
- "How does httpx validate SSL certificates?"
- "Where in the code is proxy support implemented?"
- "What happens if a request exceeds the configured timeout?"
- "How does httpx handle connection pooling?"
- "Where is the HTTP/2 implementation?"
See examples/httpx_queries.md for detailed examples with expected answer formats and citations.
ASKII uses a RAG (Retrieval-Augmented Generation) loop with targeted indexing:
- Retrieval: Queries ChromaDB for semantically similar code chunks
- Gating: If evidence is strong enough (similarity ≥ 0.7), proceeds to synthesis
- Exploration: If evidence is weak, uses an Explorer agent to find relevant files
- Indexing: Indexes Explorer-selected files into ChromaDB
- Synthesis: Formats evidence and generates a cited answer using Gemini
The system automatically loops between retrieval and indexing until sufficient evidence is found or a maximum attempt limit is reached.
- Git-only repositories: ASKII only supports git repositories. Non-git directories are not supported.
- Read-only operations: ASKII never modifies source repositories. It only reads files for indexing and querying.
- Local storage: ChromaDB data is stored locally in
.data/chroma/(relative to current working directory). - System dependencies: Requires
gitandripgrep(rg) to be installed and available in PATH.
- Chunking strategy: AST-based chunking is only used for Python files (
.py). All other text files use sliding window chunking with 20% overlap. - Token limits: Maximum 300 tokens per chunk (enforced during chunking).
- Similarity threshold: Strong evidence threshold is 0.7 (cosine similarity). Lower similarity scores may result in additional indexing attempts.
- Retrieval attempts: Maximum 3 retrieval attempts before synthesizing an answer (even with weak evidence).
- File types: Best results with text-based source code. Binary files are skipped during indexing.
All answers include:
- Plain text format (no markdown in output)
- Inline citations:
[file_path:line_range](e.g.,[src/client.py:45-67]) - Grounded in retrieved code snippets
- Concise and focused responses
When evidence is weak or insufficient, ASKII will:
- Explicitly state uncertainties
- Show what was found vs. what's unclear
- Refuse to answer if no relevant code is found
ASKII/
├── app.py # Entry point
├── src/
│ ├── agents/ # Strands graph orchestration
│ │ ├── graphs/ # Graph builders
│ │ ├── nodes/ # Deterministic graph nodes
│ │ └── factories/ # Agent factories
│ ├── chunking/ # File chunking strategies
│ ├── cli/ # Command-line interface
│ ├── db/ # ChromaDB integration
│ └── utils/ # Shared utilities
├── examples/ # Example queries
├── tests/ # Test suite
└── requirements.txt # Python dependencies
For detailed architecture documentation, see ARCHITECTURE.md.
- Ensure you're in a git repository or provide
--repository-pathpointing to a git repo - Verify git is installed:
git --version
- Check that ChromaDB can write to
.data/chroma/directory - Ensure you have write permissions in the current directory
- The repository may not contain code related to your question
- Try rephrasing your question or using more specific terms
- Use
--reset-indexto force re-indexing
- Verify
ripgrepis installed:rg --version - Ensure
rgis in your PATH
MIT License
Contributions are welcome! Please ensure all tests pass before submitting a pull request.
# Run tests
pytest
# Run with coverage
pytest --cov=src