RepoQuery is an early-beta project, that uses recursive OpenAI function calling paired with semantic search using sentence-transformers/all-MiniLM-L6-v2 to index and answer user queries about public GitHub repositories.
Note: Since the service returns responses as SSEs, a REST client like Postman is recommended. Download it here. The Postman web client doesn't support requests to
localhost
.
Endpoint | Method | Description |
---|---|---|
/ |
GET | Redirects to the configured redirect URL. |
/embed |
POST | Generate and store embeddings for a GitHub repository. |
/query |
POST | Perform a query on the API with a specific question related to a repository. |
/collection |
GET | Check if a repository has been indexed. |
The parameters are passed as a JSON object in the request body:
owner
(string, required): The owner of the repository.name
(string, required): The name of the repository.branch
(string, required): The name of the branch.
The request is processed by the server and responses are sent as Server-sent events(SSE). The event stream will contain events with optional data.
curl --location 'localhost:3000/embed' \
--header 'Content-Type: application/json' \
--data '{
"owner": "open-sauced",
"name": "ai",
"branch": "beta"
}'
The parameters are passed as a JSON object in the request body:
query
(string, required): The question or query you want to ask.repository
(object, required): Information about the repository for which you want to get the answer.owner
(string, required): The owner of the repository.name
(string, required): The name of the repository.branch
(string, required): The name of the branch.
The request is processed by the server and responses are sent as Server-sent events(SSE). The event stream will contain events with optional data.
curl --location 'localhost:3000/query' \
--header 'Content-Type: application/json' \
--data '{
"query": "How is the PR description being generated using AI?",
"repository": {
"owner": "open-sauced",
"name": "ai",
"branch": "beta"
}
}'
owner
(string, required): The owner of the repository.name
(string, required): The name of the repository.branch
(string, required): The name of the branch.
This endpoint returns an OK
status code if the repository has been indexed by the service.
curl --location 'localhost:3000/embed?owner=open-sauced&name=ai&branch=beta'
To run the project locally, there are a few prerequisites:
- The Rust toolchain
- The Onnx Runtime. Will be downloaded and installed automatically when building the project.
- Docker to run the QdrantDB instance.
make
for easy automation and development workflow
Once, the above requirements are satisfied, you can run the project like so:
The project requires the following environment variables to be set.
OPENAI_API_KEY
. To authenticate requests to OpenAI.
Start Docker and run the following commands to spin-up a Docker container with a QdrantDB image.
docker pull qdrant/qdrant
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
The database dashboard will be accessible at localhost:6333/dashboard, the project communicates with the DB on port 6334
.
Run the following command to install the dependencies and run the project on port 3000
.
cargo run --release
This command will build and run the project with optimizations enabled(Highly recommended).
The repo-query engine can also be run locally via a docker container and includes all the necessary dependencies.
To build the container tagged as open-sauced-repo-query:latest
, run:
make local-image
Then, you can start the repo-query service with:
docker run --env-file ./.env -p 3000:3000 open-sauced-repo-query
There's also a docker-compose.yaml
file that can be used to start
both qdrant and the repo-query engine together.
To build the image and then start the services, run:
make up
sentence-transformers/all-MiniLM-L6-v2.
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
We encourage you to contribute to OpenSauced! Please check out the Contributing guide for guidelines about how to proceed.
We have a commit utility called @open-sauced/conventional-commit that helps you write your commits in a way that is easy to understand and process by others.
Got Questions? Join the conversation in our Discord.
Find Open Sauced videos and release overviews on our YouTube Channel.
MIT © Open Sauced