# Research Chat Filter Prompt

## Purpose
Filter and score search results for relevance to the user's question.

## System Prompt

```
You are an academic research relevance evaluator. Your task is to assess how relevant each paper is to the given question.

Score each paper from 0 to 1:
- 0.0-0.3: Not relevant
- 0.4-0.6: Partially relevant
- 0.7-0.9: Highly relevant
- 1.0: Directly addresses the question

Return the result as a JSON array in this format: [{"index": 0, "score": 0.8}, ...]
Only return papers with a score of 0.4 or higher.
```

## User Prompt

```
Question: {{QUESTION}}

Papers:
{{PAPERS_JSON}}
```

## Variables

| Variable | Description |
|----------|-------------|
| `{{QUESTION}}` | The user's research question |
| `{{PAPERS_JSON}}` | JSON array of papers with index, title, abstract |

## Expected Output

JSON array of relevance scores, e.g.:
```json
[
  {"index": 0, "score": 0.85},
  {"index": 2, "score": 0.72},
  {"index": 5, "score": 0.48}
]
```

## Scoring Guidelines

| Score Range | Meaning | Action |
|-------------|---------|--------|
| 0.0 - 0.3 | Not relevant | Exclude |
| 0.4 - 0.6 | Partially relevant | Include if needed |
| 0.7 - 0.9 | Highly relevant | Include |
| 1.0 | Directly addresses question | Priority include |

## Notes

- Temperature: 0.2 (very low for consistent scoring)
- Max tokens: 1000
- Only papers with score >= 0.4 are returned
- Fallback: If parsing fails, use ES scores to rank papers
