Querying Your Agent

You can ask your agent questions through Credal or via third party applications you have deployed it to.

a. Hosting Agents through Credal’s UI

To use a agent in Credal, select your agent by clicking Select Agent in the chat menu.

agent-select.png

This will open a popup where you can select your desired agent. agent-select-from-input.png

Then simply type your questions in the search bar. Your agent will return an answer, citing the sources relied upon, which you can click to review.

agent-select-query.png

b. Using Agents within third party apps by API

If you have deployed your agent to a third-party application, your queries will be directed to your agent through your unique agent API.

In Slack, simply enter a query into a Slack channel the agent is connected to to get a response. The agent will respond with a 🧠, indicating it is thinking of an answer, before sending a response in a reply.

How and when your agent responds will depend on what queries you have asked it to respond to in the “Deploy” tab and your other configuration settings.

Example 1: Respond to all messages

If you have set your agent to respond to “all messages”, it will respond to all queries, regardless of whether the question falls within its area of expertise. Here we set Credal’s Information Security Copilot to respond to all messages:

slack_all_messages_query_example.png

slack_out_of_scope_response.png

Because this agent is set to be precise, when asked a question outside its expertise it responds that it does not have the context to answer. If this agent was set to creative, it would rely on its general knowledge to set out the rules of pickleball.

Example 2: Respond to relevant messages

If you have set your agent to respond to only a selection of messages, such as all relevant messages, or those matching a filter, the agent will only respond to queries that match that criteria.

Here, we set Credal’s Information Security Copilot to only respond to relevant messages:

Here, the Agent responded as the question fell within its scope—questions on information security at Credal.

Here, the Agent responded as the question fell within its scope—questions on information security at Credal.

This question fell outside of the Agent's scope, and it did not respond.

This question fell outside of the Agent’s scope, and it did not respond.

c. Creating effective prompts

A well-engineered prompt can yield better results from your agent. Some strategies to keep in mind as you write your prompts are:

  • Use clear and direct language.
  • Leverage keywords or naming conventions in your data set to point your agent to the right information (particularly if you know what documents you want it to look at).
  • Focus your prompt on the most complex or important part of the query.
  • Use iterative or sequential prompting by structuring your prompts in a logical sequence, especially when trying to explore a topic in depth. Start with a broad prompt and then follow up with more detailed questions. This not only helps in building context but also in creating a framework for the AI to understand the progression of the inquiry.

For a more in-depth look at prompt optimization, see this blog post.