You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scaffolder-templates/agentic-ai-template/skeleton/README.md
+58-3Lines changed: 58 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,68 @@ If you want to learn more about Quarkus, please visit its website: https://quark
7
7
8
8
## Running the application in dev mode
9
9
10
-
Set the approriate API keys in `application.properties` and create a directory called `playground` in your clone if you wish to use the `filesystem` MCP server.
10
+
You'll need `node` and `npm` installed (this is used to start mcp services). Follow the [recommended way](https://nodejs.org/en/download) to install for your system.
11
11
12
-
You can run your application in dev mode that enables live coding using:
12
+
You will also need a container environment available (e.g. Podman or Docker) if you want to see built-in telemetry, which you can access once the app is up by going to the Dev UI and finding the Grafana link. If you don't have a container environment, comment out the part in `application.properties` dealing with telemetry.
13
+
14
+
Create a directory called `playground` at the root folder of your clone if you wish to use the `filesystem` MCP server (or change the name in `application.properties` to some other name, but the directory must exist)
15
+
16
+
Several of the MCP services require API keys. Here are links to get the keys:
17
+
18
+
*[Brave web search](https://brave.com/search/api/)
*[Slack](https://github.com/modelcontextprotocol/servers/tree/main/src/slack#setup) (follow the instructions to get your _Bot User OAuth Token_ that starts with `xoxb-`, and your _Team ID_)
22
+
23
+
Once you have all that, the easiest way is to create a file called `.env` in your clone (this file is listed in `.gitignore` so won't be pushed to GitHub if you fork this repo and make the file). The `.env` file should look like:
24
+
25
+
```properties
26
+
quarkus.langchain4j.mcp.bravesearch.environment.BRAVE_API_KEY=<YOUR BRAVE API KEY HERE>
27
+
quarkus.langchain4j.mcp.googlemaps.environment.GOOGLE_MAPS_API_KEY=<YOUR GMAPS API KEY HERE>
quarkus.langchain4j.mcp.slack.environment.SLACK_TEAM_ID=<YOUR SLACK TEAM ID HERE>
30
+
quarkus.langchain4j.openai.api-key=<YOUR OPENAI API KEY HERE>
31
+
```
32
+
33
+
These variables will automatically be included when you run Quarkus in Dev mode. You can also put them directly in `application.properties` but be careful not to check them into a public source repository!
34
+
35
+
For production use, these should obviously be treated differently, stored in secure places like vaults or kubernetes Secrets, and injected as environment variables at runtime.
36
+
37
+
But for testing, you can run your application in dev mode that enables live coding using:
13
38
```shell script
14
39
./mvnw compile quarkus:dev
15
40
```
16
-
In Dev mode, you can use the Dev UI to chat with the LLM you've configured.
41
+
In Dev mode, you can use the Dev UI to chat with the LLM you've configured by going to "Extensions" and clicking "Chat" to chat. You'll find the system message pre-filled in from the content from [Bot.java](src/main/java/Bot.java)
42
+
43
+
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
44
+
45
+
## Testing the app
46
+
47
+
There is a simple frontend application to test the assistant - access `http://localhost:8080` and you should see:
48
+
49
+
Issue some sample prompts to see how it uses agent reasoning to invoke the various tools:
50
+
51
+
```console
52
+
My name is John Doe. I am a member of a team of 2 myself and Daniel Jane. I like Asian food, while Daniel is on a strict gluten-free diet.
53
+
54
+
Please find one good restaurant in Atlanta, GA with the highest rating that meets
55
+
the team's dietary needs and preferences. Then, invite the team to a lunch
56
+
at 12pm next Wednesday using the slack channel "#lunchtime".
57
+
In your message, include the name and description of the restaurant, the time and
58
+
date of the lunch, and driving directions from Georgia World Congress Center.
59
+
Also create an ICS calendar file for me to use in my calendar in the
60
+
"playground/calendar" directory.`
61
+
```
62
+
63
+
And some simpler follow-up prompts like:
64
+
65
+
* What was the reasoning you used to arrive at that recommendation?
66
+
* How did you choose the restaurant?
67
+
* What actions did you take for each step and which tools did you use?
68
+
* Why did you search for gluten-free restaurants?
69
+
* What did you remember about each person on the team?
70
+
71
+
In Dev mode, you can also use the Dev UI to chat with the LLM you've configured by going to "Extensions" and clicking "Chat" to chat. You'll find the system message pre-filled in from the content from [Bot.java](src/main/java/Bot.java)
17
72
18
73
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
These instructions are automatically active for all conversations. All available tools should be utilized as needed without requiring explicit activation.
12
-
13
-
{% if 'GoogleMaps' in values.mcp_server %}
14
-
- You have tools to access google maps to calculate distances, discover new places to visit, etc.
15
-
{% endif %}
16
-
17
-
{% if 'BraveSearch' in values.mcp_server %}
18
-
- You have tools to do internet searches using Brave.
19
-
{% endif %}
20
-
21
-
{% if 'Slack' in values.mcp_server %}
22
-
- You have tools to post notifications to Slack, an online chat platform. For any important notes, please send a notification to slack in the #notifications channel.
23
-
{% endif %}
24
-
25
-
- You have a tool to Memory Retrieval:
26
-
- You should assume that you are interacting with default_user
27
-
- If you have not identified default_user, proactively try to do so.
28
-
- Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph
29
-
- Always refer to your knowledge graph as your "memory"
30
-
- Use any relevant knowledge to refine any results.
31
-
32
-
Follow these steps for each interaction:
33
-
34
-
- Break down the research query into core components
35
-
- Identify key concepts and relationships, and save them in the knowledge graph
36
-
- Plan search and verification strategy
37
-
- Determine which tools will be most effective
38
-
- Brave web Search must be used for any fact-finding or research queries. Do not use brave_local_search.
39
-
40
-
- While conversing with the user, be attentive to any new information that falls into these categories:
c) Preferences (communication style, preferred language, etc.)
44
-
d) Goals (goals, targets, aspirations, etc.)
45
-
e) Relationships (personal and professional relationships up to 3 degrees of separation)
46
-
47
-
- If any new information was gathered during the interaction, update your knowledge graph as follows:
48
-
a) Create entities for recurring organizations, people, and significant events
49
-
b) Connect them to the current entities using relations
50
-
b) Store facts about them as observations
51
-
52
-
## Implementation Notes
53
-
- Tools should be used proactively without requiring user prompting
54
-
- Multiple tools can and should be used when appropriate
55
-
- Each step of analysis should be documented
56
-
- If asked, show the analysis steps you took and the tools you used
57
-
- Knowledge retention across conversations should be managed through the knowledge graph tool.
58
-
59
-
""")
60
-
Stringchat(@UserMessageStringquestion);
13
+
@SystemMessage("""
14
+
You are a helpful personal assistant, executing tasks as requested.
15
+
16
+
These instructions are automatically active for all conversations. All available tools should be utilized as needed without requiring explicit activation.
17
+
18
+
{% if 'Time' in values.mcp_server %}
19
+
- You have tools to tell you the current date and time. You should always fetch the current date and time before making any scheduling decisions.
20
+
{% endif %}
21
+
22
+
- You have tools to interact with the local filesystem and the users will ask you to perform operations like reading and writing files. The only directory allowed to interact with is the 'playground' directory relative to the current working directory. If a user specifies a relative path to a file and it does not start with 'playground', prepend the 'playground' directory to the path.
23
+
24
+
{% if 'GoogleMaps' in values.mcp_server %}
25
+
- You have tools to access google maps to calculate distances, search for locations, discover new places to visit, etc.
26
+
{% endif %}
27
+
28
+
{% if 'Slack' in values.mcp_server %}
29
+
- You have tools to post notifications to Slack, an online chat platform. When sending a message to slack, make sure to tag each user with <@UserID> format (look up the userID using their name), and use as much rich text formatting as possible including links and images and emojis.
30
+
{% endif %}
31
+
32
+
{% if 'BraveSearch' in values.mcp_server %}
33
+
- you have tools search the web for arbitrary information using Brave.
34
+
{% endif %}
35
+
36
+
{% if 'Memory' in values.mcp_server %}
37
+
- You have a tool to do Memory Retrieval. Always refer to your knowledge graph as your "memory". Use any relevant knowledge to refine any results.
38
+
{% endif %}
39
+
40
+
{% if 'BraveSearch' in values.mcp_server %}
41
+
- Brave web search must be used for any web research needs.
42
+
{% endif %}
43
+
44
+
## Implementation Notes
45
+
46
+
- Tools should be used proactively without requiring user prompting
47
+
48
+
- Multiple tools can and should be used when appropriate
49
+
50
+
- Each step of analysis should be documented
51
+
52
+
- If asked, show the analysis steps you took and the tools you used
53
+
54
+
{% if 'Memory' in values.mcp_server %}
55
+
- Knowledge retention across conversations should be managed through the knowledge graph tool.
0 commit comments