> ## Documentation Index
> Fetch the complete documentation index at: https://simili.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Duplicate Detection

> Automatically identify duplicate issues

# Duplicate Detection

Simili Bot uses AI to automatically identify when a new issue is a duplicate of an existing one.

## How it works

1. **Find Similar Issues** - Use semantic search to find related issues
2. **Analyze with AI** - Use Gemini LLM to determine if truly duplicates
3. **Calculate Confidence** - Return confidence score (0.0-1.0)
4. **Post Comment** - Notify about duplicates with reasoning

## Example

**New Issue: "Can't log in with email"**

Simili Bot finds similar issues and analyzes:

* \#456: "Email login broken" (94% similarity, 87% duplicate confidence)
* \#123: "Authentication issues" (88% similarity, 76% duplicate confidence)

Posts comment:

```
🔍 Duplicate Analysis

This issue appears to be a duplicate of #456:

Duplicate Confidence: 87%
Analysis: Both issues describe the same authentication timeout
problem in the login flow with identical error messages.

Suggested Action: Close as duplicate and reference #456
```

## Automatic Closure

Simili Bot can take duplicate detection a step further by automatically managing the closure of confirmed duplicates.

### How to Enable

In your `simili.yaml`, add the `auto_close` section:

```yaml theme={null}
auto_close:
  grace_period_hours: 48 # Allow 48 hours for human review
```

### The Triage Flow

1. **Detection**: Bot identifies a duplicate.
2. **Labeling**: Bot adds the `duplicate` label.
3. **Grace Period**: The issue remains open for review.
4. **Auto-Close**: A scheduled worker (run via `simili auto-close`) closes the issue if the grace period has passed.

For more details on setting up the scheduled worker, see the [Auto-Close Configuration](/configuration/auto-close).

## Configuration

Control duplicate detection via workflow selection:

```yaml theme={null}
# In workflow
- uses: similigh/simili-bot@v0.2.0
  with:
    workflow: "issue-triage"  # Includes duplicate detection
    # or
    workflow: "similarity-only"  # Skip duplicate detection
```

## Confidence scores

* **90-100%**: Very likely duplicate
* **75-90%**: Probably duplicate
* **50-75%**: Possibly related
* **\<50%**: Not a duplicate

## Benefits

✅ Prevent scattered discussions
✅ Consolidate related issues
✅ Reduce duplicate work
✅ Improve issue tracking

## Next steps

<CardGroup cols={1}>
  <Card title="Semantic search" href="/guides/semantic-search">
    How semantic search powers duplicate detection
  </Card>
</CardGroup>
