Prompt Engineering¶
Prompt Engineering mode provides a SQLite-backed interface for managing reusable prompt templates.
๐งญ Purpose¶
Prompt Engineering mode lets users create, search, sort, page, select, edit, update, and delete
prompt records stored in the local SQLite Prompts table. These templates can be reused as system
instructions for Text Generation and Document Q&A workflows.
๐งฑ Workflow Position¶
Create or Select Prompt Template
โ
โผ
Store Prompt in SQLite
โ
โผ
Load Prompt by Caption
โ
โผ
Cascade into System Instructions
โ
โผ
Use in Text Generation or Document Q&A
๐๏ธ Prompt Table¶
Prompt templates are stored in the SQLite Prompts table.
| Field | Purpose |
|---|---|
PromptsId |
Primary key for each prompt record. |
Caption |
Display label used in template selectors. |
Name |
Prompt name or internal title. |
Text |
Full prompt content. |
Version |
Version label or revision identifier. |
ID |
Optional external or user-defined identifier. |
๐ Searching and Sorting¶
Prompt Engineering mode supports search, sorting, and paging.
| Control | Purpose |
|---|---|
| Search | Filters prompts by name or text. |
| Sort by | Selects the field used for ordering rows. |
| Direction | Controls ascending or descending sort order. |
| Go to ID | Jumps directly to a prompt by identifier. |
| Previous/Next | Moves through paged prompt rows. |
๐งพ Selecting a Prompt¶
Select a prompt row from the table to load it into the edit fields.
Only one prompt should be selected at a time. If multiple rows are selected, the application warns the user to select exactly one prompt.
Loaded prompt fields populate:
| Field | Use |
|---|---|
| Caption | Display caption. |
| Name | Prompt name. |
| Text | Prompt body. |
| Version | Revision label. |
| ID | Optional identifier. |
๐๏ธ Editing Prompts¶
Use the Edit Prompt expander to update prompt metadata and text.
Common edits include:
| Edit | Reason |
|---|---|
Revise Text |
Improve behavior or add constraints. |
Update Version |
Track prompt changes. |
Change Caption |
Make the prompt easier to select. |
Change Name |
Improve prompt organization. |
| Clear selection | Prepare to create a new prompt. |
โ Creating a Prompt¶
To create a prompt:
- Clear the current selection.
- Enter a caption.
- Enter a name.
- Enter prompt text.
- Enter a version or identifier if useful.
- Save the prompt.
Example prompt text:
Respond as a concise federal data analyst. Use a short executive summary, followed by key findings, risks, and recommended next steps.
๐ Cascading into System Instructions¶
Prompt Engineering mode can cascade a selected prompt into the System Instructions field.
Use this when a prompt template should control the next chat or document-answering workflow.
Recommended use cases:
| Use Case | Example |
|---|---|
| Federal analysis | Budget, audit, policy, acquisition, or program-analysis framing. |
| Documentation | MkDocs, Google-style docstring, README, or API-reference instructions. |
| Data analysis | Summary, anomaly review, feature interpretation, or model-comparison format. |
| Drafting | Memo, cover letter, response, recommendation, or technical explanation. |
๐งช Example Prompt Template¶
Caption: Federal Analytical Summary
Name: federal_summary
Version: 1.0
ID: FED-SUMMARY-001
Text:
You are supporting a federal analyst. Provide a concise summary using:
1. Purpose
2. Key facts
3. Risks
4. Constraints
5. Recommended next steps
Use plain language and avoid unsupported assumptions.
โ Recommended Sequence¶
- Create reusable prompts for repeat workflows.
- Use clear captions because captions appear in selectors.
- Version prompts when changing behavior.
- Keep prompts specific enough to control output format.
- Cascade selected prompts into system instructions when needed.
- Test prompts in Text Generation before using them for high-value workflows.
๐งฏ Troubleshooting¶
| Issue | Likely Cause | Fix |
|---|---|---|
| Prompt does not appear in selector | Caption may be blank or database did not refresh. | Confirm Caption is populated and reload the app. |
| Multiple prompts selected | More than one table row has Selected checked. |
Select exactly one prompt. |
| Prompt changes not reflected | The active system instructions were not updated. | Cascade or reload the template into system instructions. |
| Prompt table is empty | No records exist in Prompts. |
Create a new prompt record. |
๐ Related API Pages¶
| API Page | Purpose |
|---|---|
| App API | Source documentation for prompt lookup, selection, creation, update, deletion, and prompt building. |
| Configuration API | UI help text and database path configuration. |