Skip to content
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

RAOC-25: Modifying the content to contain description of the improvement #3

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/docs/action-server/knowledge-base-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ previously set slots to decide what to query for.

### Query the Knowledge Base for Objects

In order to query the knowledge base for any kind of object, the user's request needs to include the object type.
In order to query the knowledge base to list objects, the user's request needs to include the object type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

.

Let's look at an example:

Can you please name some restaurants?
Expand Down Expand Up @@ -311,7 +311,9 @@ You also need to add those as entities and slots to the domain file.
### Query the Knowledge Base for an Attribute of an Object

If the user wants to obtain specific information about an object, the request should include both the object and
attribute of interest.
attribute of interest. The user is not required to query the knowledge base for objects prior to this.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rephrase this more

The `ActionQueryKnowledgeBase` will extract the object type from user's request and query the knowledge base for an attribute of an object.

For example, if the user asks something like:

What is the cuisine of Berlin Burrito Company?
Expand All @@ -328,7 +330,8 @@ intents:
- What is the [cuisine](attribute) of [Berlin Burrito Company](restaurant)?
```

Make sure to add the object type, “restaurant,” to the domain file as entity and slot.
Make sure to add the object type, “restaurant,” to the domain file as entity and slot. This will support `ActionQueryKnowledgeBase`
to extract the object type of the object user is interested in.

<a aria-hidden="true" tabIndex="-1" className="anchor enhancedAnchor" id="resolve-mentions"></a>

Expand Down Expand Up @@ -568,7 +571,7 @@ The implementation of the `InMemoryKnowledgeBase` itself can be found in the

If you have more data or if you want to use a more complex data structure that, for example, involves relations between
different objects, you can create your own knowledge base implementation.
Just inherit `KnowledgeBase` and implement the methods `get_objects()`, `get_object()`, and
Just inherit `KnowledgeBase` and implement the methods `get_objects()`, `get_object()`, `get_object_types()` and
`get_attributes_of_object()`. The [knowledge base code](https://github.com/RasaHQ/rasa-sdk/tree/main/rasa_sdk/knowledge_base/)
provides more information on what those methods should do.

Expand Down