feat: add Period & Wellness AI Agent #425 - #466
Conversation
|
@Shreeyukta2806 is attempting to deploy a commit to the aditthyass' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey @Shreeyukta2806! 👋
|
|
hey @Shreeyukta2806! 👋 |
|
hey @Shreeyukta2806! 👋 |
📝 WalkthroughWalkthroughThis PR adds a new Period & Wellness AI Agent definition that answers user questions about menstrual health, cycle phases, and wellness guidance. The agent includes metadata, user input schema with cycle-phase selection, example queries, and a comprehensive system prompt that instructs the agent to respond in a warm, friendly tone while including required medical disclaimers on every response. ChangesPeriod & Wellness AI Agent Definition
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested Labels
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@Shreeyukta2806 Plz revert the Package file |
There was a problem hiding this comment.
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 `@src/agents/definitions/period-wellness-agent.js`:
- Around line 9-11: The agent configuration in period-wellness-agent.js
currently sets provider: "any" and defaultProvider: "anthropic", which conflicts
with the PR objective to use OpenAI; update the agent config (provider,
defaultProvider, and model fields in the agent definition) to use OpenAI (e.g.,
provider: "openai", defaultProvider: "openai") and select an appropriate OpenAI
model name compatible with your codebase, and verify any metadata or
provider-switch logic referencing provider/defaultProvider or model in this file
aligns with the OpenAI-only requirement.
- Around line 81-91: The prompt-only disclaimer is non-deterministic; add a
post-generation enforcement step in the agent runtime that inspects and, if
missing, appends the exact STANDARD DISCLAIMER string in italics to every final
output. Locate the response creation/dispatch flow (e.g., functions named
generateResponse, handleAgentOutput, sendResponse or runAgent in
period-wellness-agent.js) and implement a PostProcessResponse step that: 1)
checks the final text for the exact disclaimer substring, 2) appends the
disclaimer in italics if absent, and 3) normalizes spacing/newlines so it
appears at the end of the message; also add a unit/validation log entry when the
disclaimer was auto-appended for traceability.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e3466a71-ae44-480c-81f5-4128e54578a4
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
src/agents/definitions/period-wellness-agent.js
| provider: "any", | ||
| defaultProvider: "anthropic", | ||
| model: "claude-sonnet-4-6", |
There was a problem hiding this comment.
Provider configuration conflicts with the stated implementation objective.
The linked objective says this agent should use the OpenAI provider, but this config sets provider: "any" and defaultProvider: "anthropic". That breaks the declared contract for this PR scope.
🤖 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 `@src/agents/definitions/period-wellness-agent.js` around lines 9 - 11, The
agent configuration in period-wellness-agent.js currently sets provider: "any"
and defaultProvider: "anthropic", which conflicts with the PR objective to use
OpenAI; update the agent config (provider, defaultProvider, and model fields in
the agent definition) to use OpenAI (e.g., provider: "openai", defaultProvider:
"openai") and select an appropriate OpenAI model name compatible with your
codebase, and verify any metadata or provider-switch logic referencing
provider/defaultProvider or model in this file aligns with the OpenAI-only
requirement.
| - Always end with the medical disclaimer | ||
|
|
||
| ## HANDLING SENSITIVE QUESTIONS | ||
| - If someone describes severe, unusual, or worsening symptoms: acknowledge their concern with empathy, give general context, and firmly recommend seeing a doctor | ||
| - If someone seems distressed or anxious: lead with empathy before information | ||
| - Never make someone feel their symptoms are "just normal" if they sound serious | ||
|
|
||
| ## STANDARD DISCLAIMER | ||
| Always end EVERY response with this disclaimer in italics: | ||
|
|
||
| *⚕️ This information is for general wellness awareness only and is not a substitute for professional medical advice. If you have concerns about your health, please consult a qualified healthcare provider.* |
There was a problem hiding this comment.
Mandatory disclaimer is prompt-only, so “every response” is not guaranteed.
Requiring the model to append the disclaimer in the prompt is not deterministic. Given the requirement is strict (“every response”), add an explicit post-generation append/check in the runtime output path, not only in prompt instructions.
🤖 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 `@src/agents/definitions/period-wellness-agent.js` around lines 81 - 91, The
prompt-only disclaimer is non-deterministic; add a post-generation enforcement
step in the agent runtime that inspects and, if missing, appends the exact
STANDARD DISCLAIMER string in italics to every final output. Locate the response
creation/dispatch flow (e.g., functions named generateResponse,
handleAgentOutput, sendResponse or runAgent in period-wellness-agent.js) and
implement a PostProcessResponse step that: 1) checks the final text for the
exact disclaimer substring, 2) appends the disclaimer in italics if absent, and
3) normalizes spacing/newlines so it appears at the end of the message; also add
a unit/validation log entry when the disclaimer was auto-appended for
traceability.
|
Hey @AditthyaSS, I've reverted Quick question — Coderabbit flagged Also flagged the disclaimer enforcement |
What does this PR do?
Adds a Period & Wellness AI Agent that answers menstrual
health and wellness questions in a friendly,
science-informed tone — like advice from a knowledgeable
friend, not a doctor. The agent handles questions about
cycle phases, symptoms, nutrition, exercise, sleep, and
hormonal wellness, with a clear medical disclaimer on
every response.
Type of change
Checklist
For every PR:
npm run devFor new agent PRs:
src/agents/definitions/with the agent config
idis lowercase and uses kebab-case(
period-wellness-agent)of the output
already exists
Screenshots
Anything else I should know?
This agent is being built as part of GSSoC 2026
under the AI/Agents + Healthcare track.
V1 is intentionally kept simple — one solid agent file
with a dynamic system prompt (no hardcoded FAQs),
following the existing agent structure exactly.
V2 is planned to include full RAG + Vector DB support
for deeper, research-backed responses — already
discussed and approved by maintainer @AditthyaSS
in the Discussions thread.
Closes #425
Summary by CodeRabbit