Skip to content

docs: add prompt-writing guidance for AI assistants - #662

Open
SangeetaMishr wants to merge 1 commit into
mainfrom
docs/ai-prompt-writing-guidance
Open

docs: add prompt-writing guidance for AI assistants#662
SangeetaMishr wants to merge 1 commit into
mainfrom
docs/ai-prompt-writing-guidance

Conversation

@SangeetaMishr

@SangeetaMishr SangeetaMishr commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #540

The issue's Discord link wasn't accessible to me, and the issue body itself has no specifics beyond "some prompt suggestions to be included in the documentation" - so per discussion, this adds general prompt-writing guidance to the AI Assistant docs rather than guessing at the specific examples from that Discord thread. If the actual thread has more specific suggestions, happy to fold those in as a follow-up.

Adds a "Writing effective instructions" section to "Creating and modifying AI assistants in Glific" covering:

  • What the Instructions field (system prompt) should cover: role/audience, source of truth, tone/format, and fallback behavior
  • A reusable prompt template with placeholders
  • A filled-in example
  • Tips for iterating: adding example Q&A pairs, using AI Evaluations to test against a Golden Set, keeping the fallback phrase consistent (ties into the AI-fallback-to-human-agent use case)

Also updates the Filesearch doc's existing prompt-engineering pointer (previously only an external blog link) to also point to this new in-house section.

Test plan

  • Docs site renders the new section and code blocks correctly
  • Reviewer confirms this covers what was actually discussed on Discord, or flags what's missing

Summary by CodeRabbit

  • Documentation
    • Updated integration documentation dates to July 2026.
    • Added guidance for writing effective assistant instructions, including roles, knowledge sources, tone, formatting, fallback behavior, templates, and examples.
    • Added prompt-iteration tips, including example Q&A pairs and evaluation guidance.
    • Added an additional prompt engineering resource to the file search setup instructions.

Adds a "Writing effective instructions" section with a reusable
prompt template, a filled-in example, and tips for iterating (using
AI Evaluations, keeping a consistent fallback phrase). Cross-linked
from the Filesearch doc's existing prompt-engineering pointer, which
previously only linked out to an external blog post.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated two assistant integration documents with July 2026 metadata. Expanded guidance for writing effective assistant instructions, including system-prompt coverage, templates, examples, evaluation practices, and fallback phrasing. Added an additional prompt-engineering reference to the file-search setup instructions.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: added prompt-writing guidance for AI assistants.
Description check ✅ Passed The description is directly related to the documentation updates and prompt-writing guidance added in this PR.
Linked Issues check ✅ Passed The PR adds prompt suggestions to the docs, matching issue #540's request for documentation guidance.
Out of Scope Changes check ✅ Passed The changes stay within the documented prompt-guidance scope and only update related documentation pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 28, 2026 13:14 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/5`. Integrations/Creating and modifying assistants in Glific.md:
- Around line 45-53: Update both fenced prompt examples in the documentation,
including the additional example around the second referenced section, so each
opening code fence specifies the text or markdown language. Leave the prompt
content unchanged and ensure every corresponding closing fence remains valid.

In `@docs/5`. Integrations/Filesearch Using OpenAI Assistants.md:
- Line 50: Update the first Markdown link in the referenced paragraph by
replacing “Click Here” with descriptive text such as “Read a simple guide to
prompt engineering,” while preserving its existing destination and the separate
“Writing effective instructions” link.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3baff521-0053-4418-a0dd-4eec7efbf651

📥 Commits

Reviewing files that changed from the base of the PR and between 8df612f and 84fe08d.

📒 Files selected for processing (2)
  • docs/5. Integrations/Creating and modifying assistants in Glific.md
  • docs/5. Integrations/Filesearch Using OpenAI Assistants.md

Comment on lines +45 to +53
```
You are a helpful assistant for [organization name]. You help [describe your users, e.g. "farmers enrolled in our program"] with questions about [topic].

Answer only using the information in your knowledge base. Do not guess or make up information.

If you don't know the answer, reply exactly with: "[fallback phrase]"

Keep answers under [N] sentences unless the user asks for more detail. Respond in [language(s)].
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Specify a language for both fenced prompt examples.

Add text (or markdown) after each opening fence so the documentation passes MD040 and renders consistently.

Proposed fix
-```
+```text
...
-```
+```text

Also applies to: 57-65

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 45-45: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/5`. Integrations/Creating and modifying assistants in Glific.md around
lines 45 - 53, Update both fenced prompt examples in the documentation,
including the additional example around the second referenced section, so each
opening code fence specifies the text or markdown language. Leave the prompt
content unchanged and ensure every corresponding closing fence remains valid.

Source: Linters/SAST tools


- Provide a system prompt in the `Instructions` field.
*[Click Here](https://glific.org/a-simple-guide-to-using-large-language-models/#prompt) to read more on prompt engineering.*
*[Click Here](https://glific.org/a-simple-guide-to-using-large-language-models/#prompt) to read more on prompt engineering, or see [Writing effective instructions](https://glific.github.io/docs/docs/Integrations/Creating%20and%20modifying%20assistants%20in%20Glific/#writing-effective-instructions) for a prompt template and examples.*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Replace “Click Here” with descriptive link text.

Use text such as “Read a simple guide to prompt engineering” so the link’s destination is clear without relying on surrounding context.

Proposed fix
-*[Click Here](https://glific.org/a-simple-guide-to-using-large-language-models/#prompt)
+*[Read a simple guide to prompt engineering](https://glific.org/a-simple-guide-to-using-large-language-models/#prompt)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
*[Click Here](https://glific.org/a-simple-guide-to-using-large-language-models/#prompt) to read more on prompt engineering, or see [Writing effective instructions](https://glific.github.io/docs/docs/Integrations/Creating%20and%20modifying%20assistants%20in%20Glific/#writing-effective-instructions) for a prompt template and examples.*
*[Read a simple guide to prompt engineering](https://glific.org/a-simple-guide-to-using-large-language-models/#prompt) to read more on prompt engineering, or see [Writing effective instructions](https://glific.github.io/docs/docs/Integrations/Creating%20and%20modifying%20assistants%20in%20Glific/#writing-effective-instructions) for a prompt template and examples.*
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 50-50: Link text should be descriptive

(MD059, descriptive-link-text)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/5`. Integrations/Filesearch Using OpenAI Assistants.md at line 50,
Update the first Markdown link in the referenced paragraph by replacing “Click
Here” with descriptive text such as “Read a simple guide to prompt engineering,”
while preserving its existing destination and the separate “Writing effective
instructions” link.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI Prompts

2 participants