Prompt Development Guide
Nexent packages built-in prompt YAML under sdk/nexent/core/prompts/. Backend services collect business data and select templates. The SDK loads resources and renders fields with supplied parameters.
Files and interfaces
- Localized resources live under
zh/anden/, then in purpose-specific folders such asagent,meta,evaluation, andtool. Both languages have matching relative paths. Themeta/folder contains prompts used to generate prompts, Agent drafts, and skill drafts. - Agent resources live in
zh/agent/anden/agent/; manager and worker roles useagent_manager.yamlandagent_worker.yaml. Chat-title generation usesagent/generate_chat_title.yaml. Role templates havesystem_sections, role-specific stage fields, andfinal_answer. - Human interaction, context summary, and answer verification live in each language's
agent/human_interaction.yaml,agent/context_summary.yaml, andagent/answer_verifier.yaml. The Chinese context-summary and verifier resources are simple translations of the English originals. load_prompt(language, relative_path)loads an independent mapping relative to the language directory, for exampleload_prompt("zh", "agent/human_interaction"). The.yamlsuffix is optional. Userender_prompt_text(source, parameters)to render Jinja text with runtime values.- Backend services call the SDK using the resource language, purpose, and filename. User-defined prompt generation templates remain in the database; their built-in defaults come from SDK YAML.
Parameters
Callers pass current values to the SDK renderer. Agent configuration or conversation state supplies values such as duty, constraint, few_shots, and delegated tasks. NL2Agent, skill creation, and other workflows supply their tool names, skill drafts, document content, and related values. Missing required Jinja parameters raise an error instead of sending unresolved template placeholders to the model.
Extending a template
- Add YAML to the appropriate language and purpose folder, for example
zh/evaluation/judge.yaml. Preserve the workflow's field names and placeholders. - Use the resource language and relative path at the call site. Existing Agent templates also pass SDK bundle validation. Meta prompts use
meta/nl2agent.yamlandmeta/nl2skill.yaml. - Add parameter rendering and package resource tests. SDK
pyproject.tomldeclares YAML package data in the two-level subdirectories. - Run the consuming Backend service tests to verify final message content, language selection, and user template fallback.
