-
Notifications
You must be signed in to change notification settings - Fork 143
AI agents overview, restructure, streaming, initial context queries #2134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…der, added streaming to overview and task creation API page, fixed documentation platform migration issues
2d41554
to
433c14a
Compare
…e 7.1.3 is now a formal version)
<Admonition type="note" title=""> | ||
An agent can serve multiple clients concurrently. | ||
* The agent's **layout**, including its configuration, logic, and tools is shared by all the clients that use the agent. | ||
* **Conversations** that clients conduct with the agent are isolated per client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isolated per conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
An agent configuration includes - | ||
* **Basic agent settings**, like the unique ID by which the system recognizes the task. | ||
* A **system prompt**, that defines AI model characteristics like its role. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it more like instruction to the agent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--> A system prompt by which the agent instructs the AI model what its characteristics are, e.g. its role.
The LLM will be able to invoke query tools freely to retrieve data from the database. | ||
* **Read-only operations** | ||
Query tools can apply **read operations** only. | ||
To make changes in the database, use [action tools](../../ai-integration/ai-agents/ai-agents_overview#action-tools). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the agent nor the LLM can make changes... only user can make changes to the database.
it is very important to empathize this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is clarified when action tools are discussed, but I added a note here too:
"Note that actions can be performed only by the client. The LLM can just request the client to perform actions on its behalf."
You can optionally set a query tool as an **initial context query**. | ||
Queries that are **not** set this way are invoked when the LLM requests the agent to run them. | ||
Queries that **are** set as initial context queries are executed by the agent immediately when it starts a conversation with the LLM, without waiting for the LLM to invoke them, to include data that is relevant for the conversation in the initial context sent to the LLM. | ||
E.g., an initial context query can provide the LLM the last 5 orders placed by a customer, as context for an answer that the LLM is requested to provide about the customer's order history. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before the actual conversation starts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The LLM will be able to use these tools to request the client to perform actions. | ||
|
||
### Initiating a conversation: | ||
A conversation is a communication session between the client, the agent, and the LLM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it contains the history (all previous messages) as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--> A conversation is a communication session between the client, the agent, and the LLM, that also includes the entire history of messages exchanged between all parties, during which...
* An object to populate with the data sent with each action request. | ||
Make sure the object has the same structure you defined for the action tool's parameters schema. | ||
|
||
When you finish handling the requested action, `return` the LLM an indication that it was done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the return
is not an indication, it is rather the response to the action call.
this will be sent back to the LLM
|
||
<hr /> | ||
|
||
## Full example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should be moved to a different page?
now you have streaming below that
Func<string, Task> streamedChunksCallback, CancellationToken token = default); | ||
``` | ||
|
||
| Property | Type | Description | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I miss such tables of all other APIs..
|
||
| Property | Type | Description | | ||
|----------|------|-------------| | ||
| streamPropertyPath | `Expression<Func<TAnswer, string>>` | A lambda expression that selects the property to stream from the response object.<br /><ul><li>**Must be a simple string property**.</li><li>Strongly recommended that this would be the <strong>first property defined in the response schema</strong>.</li></ul> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does it mean simple string property
?
``` | ||
|
||
<hr /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have Handle
, but we also have Receive
related issues:
RDoc-3491 - AI agents initial context queries
RDoc-3510 - AI agents streaming
RDoc-3514 - AI agents overview
RDoc-3520 - AI agents start page