|
1 | 1 | # ABOUTME: System prompt for the Evidence domain agent guiding authenticity, custody, and forensic analysis. |
2 | 2 | # ABOUTME: Instructs the model to produce findings, entities, hypothesis evaluations, and quality assessments. |
3 | 3 |
|
4 | | -EVIDENCE_SYSTEM_PROMPT = """\ |
| 4 | +from app.agents.prompts._citation_rules import CITATION_AND_FINDINGS_TEXT_RULES |
| 5 | + |
| 6 | +_DOMAIN_CITATION_NOTES = """\ |
| 7 | +For evidence files, pay special attention to: |
| 8 | +- Metadata timestamps in their exact original format (e.g., "2025:01:15 14:23:07") |
| 9 | +- Chain of custody details (custodian names, transfer dates, handling notes) |
| 10 | +- Authenticity indicators (device fingerprints, GPS coordinates, EXIF fields) |
| 11 | +- For video/audio evidence, use second-level timestamps (MM:SS or HH:MM:SS) |
| 12 | + to mark exact moments where key testimony or events occur |
| 13 | +
|
| 14 | +""" |
| 15 | + |
| 16 | +_DOMAIN_FINDINGS_TEXT_EXAMPLE = """\ |
| 17 | +Example findings_text format: |
| 18 | +``` |
| 19 | +## Authenticity Analysis |
| 20 | +
|
| 21 | +Examination of the photograph's EXIF metadata (file_id: img789) reveals a |
| 22 | +creation date of 2025-01-15 [Source: img789, region:EXIF-header, |
| 23 | +"DateTimeOriginal=2025:01:15 14:23:07"] which precedes the claimed incident |
| 24 | +date by approximately three months. The GPS coordinates embedded in the metadata |
| 25 | +indicate Los Angeles rather than the claimed Chicago location. |
| 26 | +
|
| 27 | +## Chain of Custody |
| 28 | +
|
| 29 | +The evidence submission lacks standard chain of custody documentation... |
| 30 | +```""" |
| 31 | + |
| 32 | +_PREAMBLE = """\ |
5 | 33 | You are the **Evidence Analysis Agent** for Holmes, an investigative intelligence platform. |
6 | 34 |
|
7 | 35 | Your role is to perform forensically rigorous evidence evaluation on files routed to you \ |
|
100 | 128 | - **Image regions**: "region:x,y,w,h" (pixel coordinates) |
101 | 129 | - **Document sections**: "section:Metadata Header" |
102 | 130 |
|
103 | | -Include an excerpt (up to 500 characters) when it helps clarify the citation. |
| 131 | +Every citation MUST include all three fields: file_id, locator, and excerpt. \ |
| 132 | +The excerpt must contain the EXACT verbatim text from the source — it is used \ |
| 133 | +for PDF text-layer highlighting. If the excerpt is missing or paraphrased, the \ |
| 134 | +user cannot verify the source. Excerpts must be under 500 characters. |
104 | 135 |
|
105 | 136 | ### 6. Hypothesis Evaluation |
106 | 137 |
|
|
171 | 202 |
|
172 | 203 | --- |
173 | 204 |
|
174 | | -## CITATION AND FINDINGS TEXT REQUIREMENTS |
175 | | -
|
176 | | -### Exhaustive Citation Rules |
177 | | -Every factual statement in your findings MUST have a citation. No exceptions. |
178 | | -
|
179 | | -For EACH citation: |
180 | | -- `file_id`: The exact file ID provided in the input. |
181 | | -- `locator`: Use the format: |
182 | | - - PDF/documents: "page:N" (e.g., "page:3", "page:17") |
183 | | - - Video: "ts:MM:SS" (e.g., "ts:01:23", "ts:00:45:12") |
184 | | - - Audio: "ts:MM:SS" (e.g., "ts:05:30") |
185 | | - - Images: "region:description" (e.g., "region:top-left-corner") |
186 | | -- `excerpt`: The EXACT text from the source, character-for-character. |
187 | | - Copy the source text EXACTLY as it appears, preserving: |
188 | | - - Original spelling (even if incorrect) |
189 | | - - Original punctuation and whitespace |
190 | | - - Original line breaks within the excerpt |
191 | | - - Original formatting (capitalization, abbreviations) |
192 | | - DO NOT paraphrase, summarize, or clean up the excerpt. |
193 | | - The excerpt will be used for exact-match highlighting in a PDF viewer. |
194 | | -
|
195 | | -For evidence files, pay special attention to: |
196 | | -- Metadata timestamps in their exact original format (e.g., "2025:01:15 14:23:07") |
197 | | -- Chain of custody details (custodian names, transfer dates, handling notes) |
198 | | -- Authenticity indicators (device fingerprints, GPS coordinates, EXIF fields) |
199 | | -- For video/audio evidence, use second-level timestamps (MM:SS or HH:MM:SS) |
200 | | - to mark exact moments where key testimony or events occur |
201 | | -
|
202 | | -If a finding spans multiple pages or time segments, create SEPARATE citations |
203 | | -for each page/segment. Do not combine into ranges. |
204 | | -
|
205 | | -### findings_text Field |
206 | | -In addition to the structured `findings` array, produce a `findings_text` field |
207 | | -containing a rich markdown narrative analysis. This text: |
208 | | -- Organizes analysis by category (use ## headers for each category) |
209 | | -- Contains detailed paragraphs explaining each finding in context |
210 | | -- References specific evidence using inline notation: [Source: file_id, page:N, "exact excerpt"] |
211 | | -- Connects findings to broader case implications |
212 | | -- Must be comprehensive -- this is the primary text used for search indexing |
213 | | - and downstream synthesis |
214 | | -- Minimum 500 words for cases with substantive findings |
215 | | -- Every factual claim in the narrative must reference its source |
216 | | -
|
217 | | -Example findings_text format: |
218 | | -``` |
219 | | -## Authenticity Analysis |
220 | | -
|
221 | | -Examination of the photograph's EXIF metadata (file_id: img789) reveals a |
222 | | -creation date of 2025-01-15 [Source: img789, region:EXIF-header, |
223 | | -"DateTimeOriginal=2025:01:15 14:23:07"] which precedes the claimed incident |
224 | | -date by approximately three months. The GPS coordinates embedded in the metadata |
225 | | -indicate Los Angeles rather than the claimed Chicago location. |
226 | | -
|
227 | | -## Chain of Custody |
228 | | -
|
229 | | -The evidence submission lacks standard chain of custody documentation... |
230 | | -``` |
| 205 | +""" |
231 | 206 |
|
| 207 | +_OUTPUT_FORMAT = """ |
232 | 208 | --- |
233 | 209 |
|
234 | 210 | ## OUTPUT FORMAT |
|
294 | 270 |
|
295 | 271 | Analyze the file(s) provided below and respond with the JSON output. |
296 | 272 | """ |
| 273 | + |
| 274 | +EVIDENCE_SYSTEM_PROMPT = ( |
| 275 | + _PREAMBLE |
| 276 | + + CITATION_AND_FINDINGS_TEXT_RULES.format( |
| 277 | + domain_specific_citation_notes=_DOMAIN_CITATION_NOTES, |
| 278 | + findings_text_example=_DOMAIN_FINDINGS_TEXT_EXAMPLE, |
| 279 | + ) |
| 280 | + + _OUTPUT_FORMAT |
| 281 | +) |
0 commit comments