I hope this hasn’t been substantively answered elsewhere—I searched but didn’t find a direct discussion on this approach.
The Problem
Currently, there doesn’t appear to be a way to call other agents (personas) from within a Discourse AI conversation. By “agent” I mean invoking another persona that has specialized abilities or instructions not present in the main system prompt.
This creates a challenge: depending on use case, it can be necessary to create very large system prompts to cover all scenarios. The result is that we end up with directives that are infrequently used, potentially creating overhead or confusion for the AI to process unnecessarily on every interaction.
A Working Solution: Tools as Directive Injectors
I’ve been able to use a custom tool to inject directives for edge cases. The approach:
- Keep the main system prompt focused on core identity and common behaviors
- Create a tool with a generic parameter like:
- topic: string: The edge case topic or challenge being addressed (required) - Embed the specialized directives directly in the tool’s JavaScript, returned when invoked
- Add a small instruction block to the main prompt defining when to call the tool
When a user message meets the criteria for calling the tool, it fires and injects the specialized instructions into the conversation context. It works perfectly.
Example Use Case
Consider a general assistant AI that occasionally needs to shift into a specialized mode—say, detailed technical troubleshooting or in-depth research synthesis. Rather than loading those extensive protocols on every conversation (most of which are routine questions), a tool can inject the specialized directives only when the conversation context requires it. The main prompt stays lean and focused on common tasks, while the specialized mode activates only when triggered.
Questions for the Community
-
Thoughts on this pattern? Using tools not for external API calls or data retrieval, but as containers for specialized instruction sets that activate contextually.
-
Are there plans or existing methods to actually call other agents/personas and add them to conversations? Something like invoking a specialist persona mid-conversation that brings its own system prompt into the context.
-
Any gotchas I should watch for? I’m currently only using this in the context of private AI messages.
Curious if others have explored this approach or if there’s a more elegant solution I’m missing.