When a user interacts with the chatbot and a knowledge base item is triggered, you can access the content of the triggered item in the flow. Then, you can parse the content to extract the name of the knowledge base based on the format used (e.g., using the "=== Knowledge Base: " prefix).
In the "Execute Code" node or any other node where you process the content, you can use JavaScript code to extract the knowledge base name: