add-generative-answers
Skill486 starsChanged 8 months agoMITView on GitHub
Add generative answer nodes (SearchAndSummarizeContent or AnswerQuestionWithAI) to a Copilot Studio topic. Use this instead of /add-node when the user asks to add grounded answers, knowledge search, generative answers, or AI-powered responses — these nodes require specific patterns (ConditionGroup follow-up, knowledge source references, autoSend, responseCaptureType) that /add-node does not cover.
In this repository30 other files it gives its agents.
- add-actionSkill
- add-adaptive-cardSkill
- add-global-variableSkill
- add-knowledgeSkill
- add-nodeSkill
- add-other-agentsSkill
- analyze-evalsSkill
- chat-directlineSkill
- chat-sdkSkill
- chat-with-agentSkill
- clone-agentSkill
- create-eval-setSkill
- create-evalSkill
- detect-modeSkill
- directline-chatSkill
- edit-actionSkill
- edit-agentSkill
- edit-triggersSkill
- int-patternsSkill
- int-project-contextSkill
- int-referenceSkill
- list-kindsSkill
- list-topicsSkill
- lookup-schemaSkill
- manage-agentSkill
- new-topicSkill
- run-evalSkill
- run-tests-kitSkill
- test-authSkill
- validateSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Add SearchAndSummarizeContent nodes to generate responses grounded in the agent's knowledge sources.
- Very specific: line 16
When knowledge sources are added to the agent (via /add-knowledge), the AI can directly search them without any topic if it recognizes a …
- Distinctive: line 22
If the user just wants the agent to answer questions from its knowledge, adding the knowledge source may be enough.
- Distinctive: line 30
NEVER hardcode an agent name.
- Distinctive: line 33
Add to existing topic: Read the target topic and insert a SearchAndSummarizeContent node
- Distinctive: line 48
Should it search all knowledge sources or only specific ones?
- Distinctive: line 49
Should general model knowledge also be used, or only the configured knowledge sources?
- Distinctive: line 50
Should the response be sent automatically to chat, or processed first (e.g., custom formatting, adaptive card, combined with other data)?
- Very specific: line 70
When using knowledgeSources to restrict the search to specific sources:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Generative Answers
Add SearchAndSummarizeContent nodes to generate responses grounded in the agent's knowledge sources.
Important: Do You Even Need a Topic?
When knowledge sources are added to the agent (via /add-knowledge), the AI can directly search them without any topic if it recognizes a QnA-style query. A dedicated topic with SearchAndSummarizeContent is useful when:
- You want to restrict the search to a subset of knowledge sources (not all of them)
- You want to control the flow around the answer (e.g., follow-up questions, formatting, adaptive cards)
- You want to process the response before showing it (e.g., extract content, combine with other data)
- You want to use a specific input other than the user's last message
If the user just wants the agent to answer questions from its knowledge, adding the knowledge source may be enough.
Instructions
- Auto-discover the agent directory:
NEVER hardcode an agent name.Glob: **/agent.mcs.yml - Determine the approach based on what the user needs:
- Add to existing topic: Read the target topic and insert a SearchAndSummarizeContent node
- Create new search topic: Generate a complete topic with the search pattern
- Look up the schema for both nodes:
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve CreateSearchQuery node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve SearchAndSummarizeContent - Read
settings.mcs.ymlto check ifGenerativeActionsEnabled: true. This determines the best pattern:GenerativeActionsEnabled: true→ prefer Pattern 2 (Orchestrator): use topic inputs/outputs and let the orchestrator handle the response. This is the best approach for generative-orchestrated agents.GenerativeActionsEnabled: false(or not set) → use Pattern 1 (Direct Response):autoSend: false+ manual SendActivity, or Pattern 3 (Fallback Search) for a simple all-knowledge fallback.- Verbatim/exact content needed → use Pattern 4 (Precision Search):
SearchKnowledgeSources+CreateSearchQueryfor raw results without AI summarization (insurance policies, HR docs, legal text).
- Ask the user to clarify the behavior (if not already clear from their request):
- Should it search all knowledge sources or only specific ones?
- Should general model knowledge also be used, or only the configured knowledge sources?
- Should the response be sent automatically to chat, or processed first (e.g., custom formatting, adaptive card, combined with other data)?
- Always precede
SearchAndSummarizeContentwithCreateSearchQueryto preserve conversational context. Never pass=System.Activity.Textdirectly toSearchAndSummarizeContent— the raw last message may lack context (e.g., "tell me more about that").CreateSearchQueryrewrites the input into an optimized search query. Access the result viaTopic.<ResultVar>.SearchQuery. - Generate unique IDs for all nodes (format:
<nodeType>_<6-8 random alphanumeric>). - Build the YAML using the appropriate pattern. For full YAML examples, see patterns.md. For the complete property reference table, see property-reference.md.
SearchAndSummarizeContent vs AnswerQuestionWithAI
| Node | Use When | Data Source | Output |
SearchAndSummarizeContent | You want answers grounded in the agent's knowledge sources (websites, SharePoint, Dataverse) | Agent's configured knowledge | AI-summarized response |
SearchKnowledgeSources | You need verbatim/exact content — insurance policies, legal text, HR docs — where AI summarization could lose details | Agent's configured knowledge | Raw search results (no AI summary) |
AnswerQuestionWithAI | You want a response based only on conversation history and general model knowledge | No external data | AI-generated response |
Use SearchAndSummarizeContent for the vast majority of cases (what people call "generative answers"). Use SearchKnowledgeSources when you need raw, unsummarized results for precision scenarios (pair with CreateSearchQuery for better search accuracy). Use AnswerQuestionWithAI only when you explicitly want the model to respond without consulting knowledge sources.
Knowledge Source References
When using knowledgeSources to restrict the search to specific sources:
- The knowledge source must already exist in the agent (add it first with
/add-knowledge) - Find the knowledge source filename in the agent's
knowledge/directory - Reference it without the
.mcs.ymlextension
Example: if the file is cre3c_agent.topic.MyDocs_abc123.mcs.yml, the reference is:
knowledgeSources:
kind: SearchSpecificKnowledgeSources
knowledgeSources:
- cre3c_agent.topic.MyDocs_abc123Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

