https://github.com/markis/ask-the-code
https://github.com/markis/ask-the-code
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/markis/ask-the-code
- Owner: markis
- License: mit
- Created: 2024-09-03T12:33:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T13:23:12.000Z (almost 2 years ago)
- Last Synced: 2024-12-27T18:26:44.890Z (over 1 year ago)
- Language: Python
- Size: 554 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Ask the Code
A CLI tool for asking questions about documentation in a repository using AI-powered semantic search and retrieval-augmented generation (RAG).
-----
## Features
- **Semantic Search**: Index and search through markdown documentation using ChromaDB and FlagEmbedding
- **AI-Powered Answers**: Get contextual answers to questions about your documentation using Ollama
- **Repository-Aware**: Automatically indexes documentation files in your repository
- **Multiple Commands**: Create indexes, search sources, and ask natural language questions
- **Reranking**: Uses FlagEmbedding reranker for improved search relevance
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Commands](#commands)
- [Configuration](#configuration)
- [License](#license)
## Installation
```console
pip install git+https://github.com/markis/ask-the-code.git
```
## Usage
First, create an index of your documentation:
```console
ask create
```
Then ask questions about your documentation:
```console
ask "How do I configure the application?"
```
Or search for specific information:
```console
ask search "configuration settings"
```
## Commands
- `ask create [--repo PATH] [--glob PATTERN]` - Create and index the knowledge store
- `ask "question"` - Ask a question about the documentation
- `ask search "query"` - Search for sources matching a query
- `ask clean` - Clean up the data directory
### Options
- `--repo, -r PATH` - The repository path (defaults to current directory)
- `--glob, -g PATTERN` - The glob pattern to match files (defaults to `**/*.md`)
## Configuration
The tool uses Ollama for language model inference and requires:
- Ollama running locally or accessible via URL
- A compatible language model (configurable via settings)
- ChromaDB for vector storage
- FlagEmbedding for text embeddings and reranking
## License
`ask-the-code` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.