2024-03-06 19:52:11 +00:00
## Overview
2025-04-17 18:03:47 +00:00
2023-09-29 06:47:13 +00:00
The similar issue tool retrieves the most similar issues to the current issue.
2023-09-29 08:53:39 +00:00
It can be invoked manually by commenting on any PR:
2025-04-17 18:03:47 +00:00
2023-09-29 06:47:13 +00:00
```
/similar_issue
```
2024-04-18 07:04:38 +00:00
## Example usage
2023-09-29 06:47:13 +00:00
2024-03-26 21:00:57 +00:00
{width=768}
2024-03-06 19:52:11 +00:00
2024-03-26 21:00:57 +00:00
{width=768}
2024-03-06 19:52:11 +00:00
2024-03-26 21:00:57 +00:00
{width=768}
2023-09-29 06:47:13 +00:00
Note that to perform retrieval, the `similar_issue` tool indexes all the repo previous issues (once).
2025-02-21 08:38:18 +00:00
### Selecting a Vector Database
2025-04-17 18:03:47 +00:00
2025-02-21 08:38:18 +00:00
Configure your preferred database by changing the `pr_similar_issue` parameter in `configuration.toml` file.
2023-12-24 19:08:24 +00:00
2025-02-21 08:38:18 +00:00
#### Available Options
2025-04-17 18:03:47 +00:00
2025-02-21 08:38:18 +00:00
Choose from the following Vector Databases:
2023-12-24 19:08:24 +00:00
1. LanceDB
2. Pinecone
2025-02-21 08:38:18 +00:00
#### Pinecone Configuration
2025-04-17 18:03:47 +00:00
2025-02-21 08:38:18 +00:00
To use Pinecone with the `similar issue` tool, add these credentials to `.secrets.toml` (or set as environment variables):
2023-12-24 19:08:24 +00:00
2023-09-29 06:47:13 +00:00
```
[pinecone]
api_key = "..."
environment = "..."
```
2025-04-17 18:03:47 +00:00
These parameters can be obtained by registering to [Pinecone ](https://app.pinecone.io/?sessionType=signup/ ).
2023-09-29 06:47:13 +00:00
2024-06-18 06:29:32 +00:00
## How to use
2025-04-17 18:03:47 +00:00
2023-09-29 06:47:13 +00:00
- To invoke the 'similar issue' tool from **CLI** , run:
`python3 cli.py --issue_url=... similar_issue`
- To invoke the 'similar' issue tool via online usage, [comment ](https://github.com/Codium-ai/pr-agent/issues/178#issuecomment-1716934893 ) on a PR:
`/similar_issue`
2024-10-30 00:56:03 +00:00
- You can also enable the 'similar issue' tool to run automatically when a new issue is opened, by adding it to the [pr_commands list in the github_app section ](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L66 )