Skip to content

Conversation

reebhub
Copy link
Contributor

@reebhub reebhub commented Sep 23, 2025

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

@reebhub reebhub requested a review from karmeli87 September 23, 2025 22:20
@reebhub reebhub force-pushed the RDoc-3491_initialContextQueries branch from 2d41554 to 433c14a Compare September 25, 2025 13:00
<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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isolated per conversation

Copy link
Contributor Author

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.

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

Copy link
Contributor Author

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).

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.

Copy link
Contributor Author

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.

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

Copy link
Contributor Author

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,

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

Copy link
Contributor Author

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.

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

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 |

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> |

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 />

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants