Skip to content

Commit 2571d14

Browse files
authored
Merge pull request #52 from trustgraph-ai/dev-agent-x
Agent Customization tweaks
2 parents 1b077d7 + e6749aa commit 2571d14

File tree

7 files changed

+62
-68
lines changed

7 files changed

+62
-68
lines changed

Diff for: index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/tg.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>TrustGraph deploy</title>
7+
<title>Config UI | TrustGraph </title>
88
</head>
99
<body>
1010
<div id="root"></div>

Diff for: src/simple-editor/agents/ToolEditor.tsx

+36-42
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
136136

137137
<Grid size={12}>
138138
<Divider textAlign="left">
139-
tool description
139+
Tool Definition
140140
</Divider>
141141
</Grid>
142142

143143
<Grid size={{ xs: 12, md: 4 }}>
144144
<TextField
145145
fullWidth
146-
label="ID"
146+
label="TrustGraph ID"
147147
value={tool.id}
148148
onChange={
149149
(event: React.ChangeEvent<HTMLInputElement>) => {
@@ -156,7 +156,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
156156
<Grid size={{ xs: 12, md: 8 }}>
157157
<TextField
158158
fullWidth
159-
label="Name"
159+
label="Tool Name"
160160
value={tool.name}
161161
onChange={
162162
(event: React.ChangeEvent<HTMLInputElement>) => {
@@ -166,25 +166,10 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
166166
/>
167167
</Grid>
168168

169-
<Grid size={12}>
170-
<TextField
171-
fullWidth
172-
label="Description"
173-
multiline
174-
value={tool.description}
175-
rows={5}
176-
onChange={
177-
(event: React.ChangeEvent<HTMLInputElement>) => {
178-
setDescription(event.target.value);
179-
}
180-
}
181-
/>
182-
</Grid>
183-
184169
<Grid size={12}>
185170
<FormControl fullWidth>
186171

187-
<InputLabel id="type-label">Type</InputLabel>
172+
<InputLabel id="type-label">Tool Options</InputLabel>
188173

189174
<Select
190175
labelId="type-label"
@@ -210,23 +195,20 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
210195
justifyContent="center"
211196
textAlign="center"
212197
>
213-
Knowledge<br/>query
198+
GraphRAG Query
214199
</Stack>
215200

216201
<Box sx={{
217202
}}>
218203
<Typography variant="body2"
219204
sx={{ whiteSpace: 'wrap' }}
220205
>
221-
This tool performs a Graph RAG
222-
query using a question which is
223-
automatically created based on
224-
what the agent wants to extract
225-
next. To be effective, the
206+
Performs a GraphRAG query.
207+
To be effective, the
226208
description should provide clear,
227209
precise information about what
228-
can be obtained using this
229-
a Graph RAG query on this dataset.
210+
information the GraphRAG query
211+
should return.
230212
</Typography>
231213
</Box>
232214
</Stack>
@@ -247,21 +229,18 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
247229
justifyContent="center"
248230
textAlign="center"
249231
>
250-
Text<br/>completion
232+
Text Completion
251233
</Stack>
252234

253235
<Box sx={{
254236
}}>
255237
<Typography variant="body2"
256238
sx={{ whiteSpace: 'wrap' }}
257239
>
258-
This tool sends a query to
259-
the text completion service,
260-
providing basic LLM output.
261-
This only works with knowledge
262-
or information which can be
263-
handled within the LLM without
264-
using any external knowledge.
240+
Sends a request to
241+
the text completion service to
242+
generate a LLM output without
243+
any additional context.
265244
</Typography>
266245
</Box>
267246
</Stack>
@@ -271,6 +250,21 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
271250
</FormControl>
272251
</Grid>
273252

253+
<Grid size={12}>
254+
<TextField
255+
fullWidth
256+
label="Tool Instructions"
257+
multiline
258+
value={tool.description}
259+
rows={5}
260+
onChange={
261+
(event: React.ChangeEvent<HTMLInputElement>) => {
262+
setDescription(event.target.value);
263+
}
264+
}
265+
/>
266+
</Grid>
267+
274268
{
275269
tool.arguments.map(
276270
(arg : Argument, ix : number) => (
@@ -279,14 +273,14 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
279273

280274
<Grid size={12}>
281275
<Divider textAlign="left">
282-
{'argument: ' + arg.name}
276+
{'Tool Argument ' + (ix+1) + ': ' + arg.name}
283277
</Divider>
284278
</Grid>
285279

286280
<Grid size={4}>
287281
<TextField
288282
fullWidth
289-
label="Name"
283+
label="Argument Name"
290284
value={arg.name}
291285
onChange={
292286
(event: React.ChangeEvent<HTMLInputElement>) => {
@@ -306,7 +300,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
306300
<InputLabel
307301
id={ 'arg-type-' + ix }
308302
>
309-
Type
303+
Argument Type
310304
</InputLabel>
311305

312306
<Select
@@ -344,7 +338,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
344338
variant="contained"
345339
onClick={ () => deleteArg(ix) }
346340
>
347-
Delete
341+
Delete {arg.name}
348342
</Button>
349343
</Box>
350344

@@ -355,7 +349,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
355349

356350
<TextField
357351
fullWidth
358-
label="Description"
352+
label="Argument Definition"
359353
value={arg.description}
360354
multiline
361355
rows={2}
@@ -386,7 +380,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
386380
variant="contained"
387381
onClick={ addArgument }
388382
>
389-
Add argument
383+
Add Tool Argument
390384
</Button>
391385
}
392386

@@ -400,7 +394,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
400394
variant="contained"
401395
onClick={ deleteTool }
402396
>
403-
Delete this tool
397+
Delete {tool.name}
404398
</Button>
405399
}
406400

Diff for: src/simple-editor/model-params/ModelParameters.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ const ModelParameters: React.FC<ModelParametersProps> = ({
9999
(_, value) => onTemperatureChange(value as number)
100100
}
101101
min={0}
102-
max={1}
103-
step={0.1}
102+
max={2}
103+
step={0.01}
104104
/>
105105
</div>
106106
<TextField

Diff for: src/simple-editor/options/Options.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ const ParamsForm: React.FC = ({
5858
enabled={configurePrompts}
5959
onChange={onConfigurePrompts}
6060
avatar={<ChatBubble color="primary"/>}
61-
title="Configure prompts"
61+
title="Data Extraction Prompts"
6262
content={
63-
'Tailor the prompts for the chosen LLM.'
63+
'Tailor the LLM system prompts, data extraction prompts, and RAG query prompts.'
6464
}
6565

6666
/>
@@ -69,9 +69,9 @@ const ParamsForm: React.FC = ({
6969
enabled={configureAgents}
7070
onChange={onConfigureAgents}
7171
avatar={<Psychology color="primary"/>}
72-
title="Configure agents"
72+
title="Agent Definitions"
7373
content={
74-
'Add agent configuration and define the flow.'
74+
'Add Agents that use a ReAct approach. Customize the Agent definitions, options, and arguments.'
7575
}
7676

7777
/>

Diff for: src/simple-editor/state/Agents.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ export const useAgentsStore = create<Agents>()(
4545
}
4646
*/
4747
{
48-
id: "shuttle-kb",
49-
name: "Shuttle knowledge",
48+
id: "sample-query",
49+
name: "Sample Query",
5050
type: "knowledge-query",
5151
config: {},
52-
description: "Query a knowledge base with information about the space shuttle program. The query should be a simple natural language question",
52+
description: "Query a knowledge base that has already been extracted. The query should be a simple natural language question.",
5353
arguments: [
5454
{
5555
name: "query",
5656
type: "string",
57-
description: "The search query string",
57+
description: "Describe the search query here.",
5858
}
5959
]
6060
},
@@ -74,16 +74,16 @@ export const useAgentsStore = create<Agents>()(
7474
},
7575
*/
7676
{
77-
id: "compute",
78-
name: "Compute",
77+
id: "sample-completion",
78+
name: "Sample Text Completion",
7979
type: "text-completion",
8080
config: {},
81-
description: "Compute the answer to a computational problem. The computation should be provided in the 'computation' argument",
81+
description: "Describe the request to send to LLM. This request will be sent with no additional context.",
8282
arguments: [
8383
{
84-
name: "computation",
84+
name: "response",
8585
type: "string",
86-
description: "The computation to solve",
86+
description: "The response expected from the LLM.",
8787
}
8888
]
8989
}

Diff for: src/simple-editor/state/ModelParams.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ export const useModelParamsStore = create<ModelParams>()(
3737
vectorDB: "qdrant",
3838
chunkerType: "chunker-recursive",
3939
chunkSize: 1000,
40-
chunkOverlap: 200,
40+
chunkOverlap: 50,
4141
modelDeployment: "ollama",
4242
modelName: "gemma2:9b",
4343
temperature: 0.3,
44-
maxOutputTokens: 1000,
44+
maxOutputTokens: 2048,
4545
platform: "docker-compose",
4646
trustgraphVersion: TRUSTGRAPH_VERSION,
4747

Diff for: src/simple-editor/state/Prompts.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,49 +25,49 @@ export const usePromptsStore = create<Prompts>()(
2525
prompts: [
2626
{
2727
id: "system-template",
28-
name: "System",
28+
name: "LLM System",
2929
prompt: prompts.default_system_prompt,
3030
custom: false,
3131
},
3232
{
3333
id: "extract-definitions",
34-
name: "Extract definitions",
34+
name: "Extract Definitions",
3535
prompt: prompts.default_definition_prompt,
3636
custom: false,
3737
},
3838
{
3939
id: "extract-relationships",
40-
name: "Extract relationships",
40+
name: "Extract Relationships",
4141
prompt: prompts.default_relationship_prompt,
4242
custom: false,
4343
},
4444
{
4545
id: "extract-topics",
46-
name: "Extract topics",
46+
name: "Extract Topics",
4747
prompt: prompts.default_topics_prompt,
4848
custom: false,
4949
},
5050
{
5151
id: "extract-rows",
52-
name: "Extract rows",
52+
name: "Extract Rows",
5353
prompt: prompts.default_rows_prompt,
5454
custom: false,
5555
},
5656
{
5757
id: "kg-prompt",
58-
name: "Knowledge graph query",
58+
name: "Knowledge Graph Query",
5959
prompt: prompts.default_knowledge_query_prompt,
6060
custom: false,
6161
},
6262
{
6363
id: "document-prompt",
64-
name: "Document query",
64+
name: "Document Query",
6565
prompt: prompts.default_document_query_prompt,
6666
custom: false,
6767
},
6868
{
6969
id: "agent-react",
70-
name: "ReACT agent",
70+
name: "ReAct Agent Router",
7171
prompt: prompts.default_agent_react_prompt,
7272
custom: false,
7373
},

0 commit comments

Comments
 (0)