# In custom knowledgebase how to infer object type from attribute

**URL:** <https://forum.rasa.com/t/in-custom-knowledgebase-how-to-infer-object-type-from-attribute/31502>\
**Category:** Rasa Open Source\
**Created:** [July 18, 2020, 12:16pm UTC](https://forum.rasa.com/t/in-custom-knowledgebase-how-to-infer-object-type-from-attribute/31502 "2020-07-18T12:16:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [July 20, 2020, 12:15pm UTC](https://forum.rasa.com/t/in-custom-knowledgebase-how-to-infer-object-type-from-attribute/31502/2 "2020-07-20T12:15:36Z")

</div>

Hi @phoebebright, the current solution around knowledge base uses slots to construct the query that is then used to fetch the relevant information from the knowledge base. Always the most recent value of the slot type is used to construct the query. If you don’t provide the object type in the user message itself, the slot `object_type` will not be set and the `KnowledgeBaseAction` fails to construct the query. If you want to add a custom mapping that checks if a certain slot is set and refers to another type of slot, I guess you can [customize](https://rasa.com/docs/rasa/core/knowledge-bases/#customization) your `KnoweldgeBaseAction`. You could add a mapping at the top of the `run` method that checks the set slots and infers if another slot can be set or not.

FYI: We are currently looking into this feature again and trying to find a way to make it more flexible and easier to use. If you have some more details to share, I would be happy to jump on a quick call with you and discuss any problems you ran into so far. If you are interested just write me a private message. Thanks.

---

_[View the full topic](https://forum.rasa.com/t/in-custom-knowledgebase-how-to-infer-object-type-from-attribute/31502)._
