Skip to content

Commit 00c510f

Browse files
authored
Merge pull request #225 from supreme-gg-gg/docs/system-prompt-from
Add system prompt from config map or secrets instructions
2 parents ac2be8c + 0357d40 commit 00c510f

File tree

1 file changed

+34
-0
lines changed
  • src/app/docs/kagent/getting-started/system-prompts

1 file changed

+34
-0
lines changed

src/app/docs/kagent/getting-started/system-prompts/page.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,40 @@ Notice how much information we've added to the prompt. We've added a detailed op
161161

162162
The last trick I'd like to mention is using another model to aid in this process. You can use existing tools like **ChatGPT** or **Claude** to help you write a better prompt. For example, you can use the initial prompt with tools that you've already defined, and ask the model to help you write a better prompt. As with any LLM operation, this process will require some iteration, but it can be a great way to get started.
163163

164+
## Using ConfigMap and Secrets to store prompts
165+
166+
If you wish to reuse prompts across multiple agents or decouple the prompt from the agent definition, you can use a `ConfigMap` or `Secret` to store the prompt. An example is shown below:
167+
168+
```yaml
169+
apiVersion: v1
170+
kind: ConfigMap
171+
metadata:
172+
name: my-agent-config
173+
namespace: kagent
174+
data:
175+
system-message: "You are an expert Kubernetes agent that uses tools to help users."
176+
```
177+
178+
When creating the agent, you can reference the ConfigMap or Secret that contains the prompt. Note that `systemMessageFrom` (reference) and `systemMessage` (inline) are mutually exclusive, and you can only use one of them.
179+
180+
```yaml
181+
...
182+
declarative:
183+
systemMessageFrom:
184+
type: ConfigMap
185+
name: my-agent-config
186+
key: system-message
187+
```
188+
189+
```yaml
190+
...
191+
declarative:
192+
systemMessageFrom:
193+
type: Secret
194+
name: my-agent-secret
195+
key: system-message
196+
```
197+
164198
## Reference
165199

166200
There are many resources available online that can help you write better prompts. Here are some of the most useful ones:

0 commit comments

Comments
 (0)