@caretakerai/agent 0.0.21-beta.2 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -36
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +12 -11
- package/dist/agent.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,13 +27,15 @@ When creating an `Agent`, you must provide an `AgentPrams` object with the follo
|
|
|
27
27
|
- `instruction`: (Optional) Completion instruction for the language model.
|
|
28
28
|
- `maxIterations`: (Optional) The maximum number of iterations the agent can perform.
|
|
29
29
|
- `maxRetries`: (Optional) The maximum number of retries for actions.
|
|
30
|
-
- `
|
|
30
|
+
- `optimizers`: The optimizer pileline used to improve the agent's performance.
|
|
31
31
|
- `signal`: (Optional) An abort signal to stop the agent's operation.
|
|
32
32
|
- `template`: (Optional) The template for generating prompts for the agent.
|
|
33
33
|
- `stop`: (Optional) A list of strings that, if generated by the agent, should cause it to stop.
|
|
34
34
|
- `logger`: (Optional) The logger the agent will use for outputting information.
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
|
|
36
|
+
### Objective
|
|
37
|
+
|
|
38
|
+
The `objective` is a crucial component of the Agent Framework. It defines the goal or purpose that the agent is trying to achieve. The objective is used to guide the agent's behavior and decision-making process.
|
|
37
39
|
|
|
38
40
|
```typescript
|
|
39
41
|
const agent = new Agent({
|
|
@@ -45,30 +47,108 @@ const agent = new Agent({
|
|
|
45
47
|
The objective will be included in the Agent's prompt template to provide context to the language model, ensuring that the Agent's interactions are focused and relevant to the goal.
|
|
46
48
|
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
### Schema
|
|
51
|
+
|
|
52
|
+
The schema is a GraphQL schema that defines the structure of the data that the agent can act upon. It includes type definitions for queries and mutations that the agent can perform. The schema is used to validate the queries and mutations that the agent receives, ensuring that they are well-formed and consistent with the agent's objectives.
|
|
53
|
+
|
|
54
|
+
**Importance of a Good Schema**
|
|
55
|
+
|
|
56
|
+
A good schema is essential for the QnA Agent Framework to function effectively. The schema defines the structure of the data that the agent can act upon, and it provides a clear and consistent way for the agent to interact with the user. A well-designed schema can help to:
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
* Improve the accuracy and relevance of the agent's responses
|
|
59
|
+
* Reduce the complexity of the agent's decision-making process
|
|
60
|
+
* Increase the efficiency of the agent's processing loop
|
|
61
|
+
* Enhance the overall user experience
|
|
62
|
+
|
|
63
|
+
Think of the Agent as a developer that writes the queries for you while you talk to them. When writing queries on the fly, it is essential to use a good schema to ensure that the queries are well-formed and consistent with the agent's objectives. A good schema can help to prevent errors and inconsistencies in the agent's responses, and it can improve the overall performance of the agent.
|
|
52
64
|
|
|
53
65
|
## Usage
|
|
66
|
+
To use the QnA Agent Framework, instantiate the `Agent` class with the necessary initialization parameters, including the language model, GraphQL type definitions, and resolvers. You can also include optional configurations such as history, objectives, and optimizers. Once the agent is configured, call the `agent.invoke()` method to begin the agent's processing loop.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Resolvers
|
|
70
|
+
Resolvers are functions that implement the logic for the queries and mutations defined in the schema. They are used to retrieve or update data in response to queries and mutations.
|
|
71
|
+
|
|
72
|
+
## History
|
|
73
|
+
Having at least one element in the history is important because it provides the agent with a starting point for its conversation with the user. This initial element in the history can be thought of as the "initial prompt" or "initial context" that sets the stage for the conversation.
|
|
74
|
+
|
|
75
|
+
Without an initial element in the history, the agent would not have any context or information to work with, and it would not know how to respond to the user's first message. By including at least one element in the history, you are providing the agent with a foundation for its conversation with the user, and it can use this information to generate more informed and relevant responses.
|
|
54
76
|
|
|
55
|
-
|
|
77
|
+
In the example provided, the initial element in the history is an observation that includes a message from the user asking "How can you help me?". This initial prompt provides the agent with a clear understanding of the user's intent and allows it to respond accordingly.
|
|
56
78
|
|
|
57
|
-
Here is an example of how
|
|
58
|
-
```
|
|
79
|
+
Here is an example of how the history is used in the agent's conversation:
|
|
80
|
+
```typescript
|
|
81
|
+
history: [
|
|
82
|
+
new Activity({ kind: ActivityKind.Observation, input: dedent /* yaml */`
|
|
83
|
+
data:
|
|
84
|
+
say:
|
|
85
|
+
reply: How can you help me?
|
|
86
|
+
` }),
|
|
87
|
+
],
|
|
88
|
+
```
|
|
89
|
+
This initial element in the history is used by the agent to generate its first response to the user. The agent can use this information to determine the user's intent and provide a relevant response.
|
|
90
|
+
|
|
91
|
+
In general, having at least one element in the history is important because it:
|
|
92
|
+
|
|
93
|
+
* Provides the agent with a starting point for its conversation with the user
|
|
94
|
+
* Gives the agent context and information to work with
|
|
95
|
+
* Allows the agent to generate more informed and relevant responses
|
|
96
|
+
* Helps to establish a clear understanding of the user's intent and goals
|
|
97
|
+
|
|
98
|
+
## Example
|
|
59
99
|
|
|
100
|
+
Here is an example of how to create a QnA agent that uses a language model to answer user queries:
|
|
101
|
+
```typescript
|
|
60
102
|
const agent = new Agent({
|
|
61
|
-
name: '
|
|
62
|
-
llm: new
|
|
63
|
-
|
|
64
|
-
|
|
103
|
+
name: 'QnA',
|
|
104
|
+
llm: new ChatOpenAI({
|
|
105
|
+
modelName: 'gpt-3.5-turbo-16k',
|
|
106
|
+
temperature: 0.7,
|
|
107
|
+
maxTokens: 2000,
|
|
108
|
+
}),
|
|
109
|
+
objective: dedent`
|
|
110
|
+
1. Help the user with finding information.
|
|
111
|
+
2. Search no more than 7 times before providing the answer.
|
|
112
|
+
3. Subsequent searches must be different from one another.
|
|
113
|
+
4. Prefer multiple searches to answer complex questions.
|
|
114
|
+
5. Prefer user language in making search queries and providing answers.
|
|
115
|
+
6. Prefer answers up to 300 words long.
|
|
116
|
+
7. Prefer descriptive answers split to paragraphs instead of lists.
|
|
117
|
+
`.trim(),
|
|
118
|
+
typeDefs: dedent /* GraphQL */`
|
|
65
119
|
schema {
|
|
66
120
|
query: Query
|
|
67
121
|
mutation: Mutation
|
|
68
122
|
}
|
|
69
123
|
|
|
70
124
|
type Query {
|
|
71
|
-
|
|
125
|
+
"""
|
|
126
|
+
Perform text-searches in the knowledge base and return the results as strings.
|
|
127
|
+
|
|
128
|
+
The following example shows the method of searching for information on complex topics:
|
|
129
|
+
<Observation>
|
|
130
|
+
data:
|
|
131
|
+
say:
|
|
132
|
+
reply: 'What is the difference between a white hole and a black hole?'
|
|
133
|
+
<Observation>
|
|
134
|
+
<Thought>
|
|
135
|
+
The user is looking for distinctive features of separate entities of the universe. I should split my search into 2.
|
|
136
|
+
</Thought>
|
|
137
|
+
<Action>
|
|
138
|
+
query {
|
|
139
|
+
blackHole: search(input: { query: "What is the nature of a black hole?" }) { result }
|
|
140
|
+
whiteHole: search(input: { query: "What is the nature of a white hole?" }) { result }
|
|
141
|
+
}
|
|
142
|
+
</Action>
|
|
143
|
+
<Observation>
|
|
144
|
+
data:
|
|
145
|
+
blackHole:
|
|
146
|
+
result: 'The nature of a black hole is...'
|
|
147
|
+
whiteHole:
|
|
148
|
+
result: 'The nature of a white hole is...'
|
|
149
|
+
<Observation>
|
|
150
|
+
"""
|
|
151
|
+
search(input: SearchInput!): SearchResult
|
|
72
152
|
}
|
|
73
153
|
|
|
74
154
|
type Mutation {
|
|
@@ -76,45 +156,65 @@ const agent = new Agent({
|
|
|
76
156
|
Relay information to the user and wait for the reply. Note that this is only way of communicating information to the user.
|
|
77
157
|
"""
|
|
78
158
|
say(input: SayInput!): SayResult
|
|
79
|
-
add(input: MathInput!): MathResult
|
|
80
|
-
# ... Rest of mutations
|
|
81
159
|
}
|
|
82
160
|
|
|
83
|
-
#
|
|
161
|
+
# Inputs for mathematical operations
|
|
162
|
+
input SearchInput {
|
|
163
|
+
query: String!
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
# Inputs for say operation
|
|
167
|
+
input SayInput {
|
|
168
|
+
message: String! # The message to say to the user
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
# Result for say results
|
|
172
|
+
type SayResult {
|
|
173
|
+
reply: String # The user's reply
|
|
174
|
+
error: String # can be used to describe any error that occurred during the computation
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# Result for mathematical operations
|
|
178
|
+
type SearchResult {
|
|
179
|
+
result: String
|
|
180
|
+
error: String # can be used to describe any error that occurred during the computation
|
|
181
|
+
}
|
|
84
182
|
`.trim(),
|
|
85
183
|
resolvers: {
|
|
184
|
+
Query: {
|
|
185
|
+
search: async (_, { input: { query } }) => {
|
|
186
|
+
try {
|
|
187
|
+
const chain = RetrievalQAChain.fromLLM(llm, retriever);
|
|
188
|
+
const { text } = await chain.invoke({ query });
|
|
189
|
+
return { result: text };
|
|
190
|
+
} catch (error) {
|
|
191
|
+
return { error };
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
},
|
|
86
195
|
Mutation: {
|
|
87
196
|
say: async (_, { input: { message } }) => {
|
|
88
197
|
console.log(`${chalk.bold(`${agent.name}:`)} ${message}`);
|
|
89
198
|
|
|
90
199
|
const reply = await inputPrompt({
|
|
91
|
-
message: 'Human:'
|
|
200
|
+
message: 'Human:',
|
|
92
201
|
});
|
|
93
202
|
|
|
94
203
|
return { reply };
|
|
95
204
|
},
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
return { result: left + right };
|
|
99
|
-
} catch (error) {
|
|
100
|
-
return { error };
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
// ... rest of resolvers
|
|
104
|
-
}
|
|
205
|
+
},
|
|
105
206
|
},
|
|
106
207
|
history: [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
})
|
|
208
|
+
new Activity({ kind: ActivityKind.Observation, input: dedent /* yaml */`
|
|
209
|
+
data:
|
|
210
|
+
say:
|
|
211
|
+
reply: How can you help me?
|
|
212
|
+
` }),
|
|
113
213
|
],
|
|
114
|
-
|
|
214
|
+
optimizers: [new RemoveErrorActivitiesOptimizer(), new LengthOptimizer(16)],
|
|
115
215
|
});
|
|
116
216
|
|
|
117
217
|
// Invoke the agent
|
|
118
218
|
await agent.invoke();
|
|
119
|
-
|
|
120
|
-
|
|
219
|
+
```
|
|
220
|
+
This example demonstrates how to create a QnA agent that uses a language model to answer user queries. The agent is configured with a set of objectives, type definitions, and resolvers that define its behavior. The `agent.invoke()` method is called to start the agent's processing loop.
|
package/dist/agent.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface AgentPrams {
|
|
|
20
20
|
instruction?: string;
|
|
21
21
|
maxIterations?: number;
|
|
22
22
|
maxRetries?: number;
|
|
23
|
-
|
|
23
|
+
optimizers: Optimizer[];
|
|
24
24
|
signal?: AbortSignal;
|
|
25
25
|
template?: PromptTemplate;
|
|
26
26
|
stop?: string[];
|
|
@@ -44,7 +44,7 @@ export declare class Agent implements AgentPrams {
|
|
|
44
44
|
maxRetries: number;
|
|
45
45
|
isChatModel: boolean;
|
|
46
46
|
signal: AbortSignal;
|
|
47
|
-
|
|
47
|
+
optimizers: Optimizer[];
|
|
48
48
|
logger: Logger;
|
|
49
49
|
template?: PromptTemplate;
|
|
50
50
|
executor?: GraphQLExecutor;
|
package/dist/agent.js
CHANGED
|
@@ -35,7 +35,7 @@ class Agent {
|
|
|
35
35
|
maxRetries;
|
|
36
36
|
isChatModel;
|
|
37
37
|
signal;
|
|
38
|
-
|
|
38
|
+
optimizers;
|
|
39
39
|
logger;
|
|
40
40
|
template;
|
|
41
41
|
executor;
|
|
@@ -68,7 +68,7 @@ class Agent {
|
|
|
68
68
|
new activity_1.Activity({
|
|
69
69
|
kind: activity_1.ActivityKind.Observation,
|
|
70
70
|
input: (0, dedent_1.default) `
|
|
71
|
-
data
|
|
71
|
+
data:
|
|
72
72
|
theBestNumber:
|
|
73
73
|
result: 73
|
|
74
74
|
`.trim(),
|
|
@@ -103,15 +103,17 @@ class Agent {
|
|
|
103
103
|
async prompt(params) {
|
|
104
104
|
let activities = [];
|
|
105
105
|
const retryErrors = [];
|
|
106
|
+
let history = [...this.history];
|
|
107
|
+
if (history.length < this.examples.length) {
|
|
108
|
+
history = [...this.examples, ...history];
|
|
109
|
+
}
|
|
110
|
+
for (const opt of this.optimizers) {
|
|
111
|
+
history = await opt.optimize(history);
|
|
112
|
+
}
|
|
106
113
|
for (let i = 0; i < this.maxRetries; ++i) {
|
|
107
|
-
let history = [...this.history];
|
|
108
|
-
if (history.length < this.examples.length) {
|
|
109
|
-
history = [...this.examples, ...history];
|
|
110
|
-
}
|
|
111
|
-
history = await this.optimizer.optimize(history);
|
|
112
114
|
const messages = [];
|
|
113
115
|
let aiActivities = [];
|
|
114
|
-
history.forEach(activity => {
|
|
116
|
+
[...history, ...activities].forEach(activity => {
|
|
115
117
|
if (activity.kind === activity_1.ActivityKind.Observation) {
|
|
116
118
|
aiActivities.length && messages.push(new messages_1.AIMessage(aiActivities.map(a => a.prompt()).join(constants_1.ACTIVITY_SEP)));
|
|
117
119
|
aiActivities = [];
|
|
@@ -177,7 +179,7 @@ class Agent {
|
|
|
177
179
|
const result = this.executor
|
|
178
180
|
? await this.executor(source)
|
|
179
181
|
: await (0, graphql_1.graphql)({ schema: this.schema, source });
|
|
180
|
-
|
|
182
|
+
activities.push(new activity_1.Activity({
|
|
181
183
|
kind: activity_1.ActivityKind.Observation,
|
|
182
184
|
input: (0, yaml_1.stringify)(result),
|
|
183
185
|
}));
|
|
@@ -185,6 +187,7 @@ class Agent {
|
|
|
185
187
|
retryErrors.push(...result.errors);
|
|
186
188
|
continue;
|
|
187
189
|
}
|
|
190
|
+
this.addActivities(...activities);
|
|
188
191
|
return;
|
|
189
192
|
}
|
|
190
193
|
catch (e) {
|
|
@@ -193,8 +196,6 @@ class Agent {
|
|
|
193
196
|
kind: activity_1.ActivityKind.Observation,
|
|
194
197
|
input: err.toString(),
|
|
195
198
|
}));
|
|
196
|
-
this.addActivities(...activities);
|
|
197
|
-
activities = [];
|
|
198
199
|
const message = `Retry ${i + 1} due to action error: ${err}`;
|
|
199
200
|
this.logger.debug(message);
|
|
200
201
|
retryErrors.push(err);
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,+BAAiC;AACjC,gDAAoC;AAEpC,qDAAwD;AAGxD,kDAA6D;AAE7D,qCAAkE;AAElE,2CAA2C;AAC3C,yCAAoD;AAEpD,uDAA+F;AA8C/F,MAAa,eAAgB,SAAQ,KAAK;IAG/B;IAFT,YACE,OAAe,EACR,MAAe;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAA;QAFP,WAAM,GAAN,MAAM,CAAS;IAGxB,CAAC;CACF;AAPD,0CAOC;AAED,MAAa,KAAK;IAChB,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,GAAG,CAAqB;IACxB,QAAQ,CAAc;IACtB,SAAS,CAAa;IACtB,OAAO,CAAc;IACrB,QAAQ,CAAa;IACrB,SAAS,CAAS;IAClB,WAAW,CAAS;IACpB,aAAa,CAAS;IACtB,UAAU,CAAS;IACnB,WAAW,CAAU;IACrB,MAAM,CAAc;IACpB,
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,+BAAiC;AACjC,gDAAoC;AAEpC,qDAAwD;AAGxD,kDAA6D;AAE7D,qCAAkE;AAElE,2CAA2C;AAC3C,yCAAoD;AAEpD,uDAA+F;AA8C/F,MAAa,eAAgB,SAAQ,KAAK;IAG/B;IAFT,YACE,OAAe,EACR,MAAe;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAA;QAFP,WAAM,GAAN,MAAM,CAAS;IAGxB,CAAC;CACF;AAPD,0CAOC;AAED,MAAa,KAAK;IAChB,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,GAAG,CAAqB;IACxB,QAAQ,CAAc;IACtB,SAAS,CAAa;IACtB,OAAO,CAAc;IACrB,QAAQ,CAAa;IACrB,SAAS,CAAS;IAClB,WAAW,CAAS;IACpB,aAAa,CAAS;IACtB,UAAU,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