Dynamic Knowledge Base
# 🤝help
q
Hi I'd like to have a knowledge base that can be updated separately from the bot and the bot will automatically use the new material without republishing. I tried giving a google doc link but it didn't work. Is what I'm looking for possible?
f
Same Problem. Bumbing this thread up. @quick-sunset-51605
@acceptable-gold-88171
a
Here's the thread to upvote on feature requests https://discord.com/channels/1108396290624213082/1124414296470863985
h
Was just looking for this too, even with a google sheet spreadsheet. I have a database that is constantly updating so that's why I'm interested in this.
r
me too, we real time update inventory in Google sheet.
a
with the new tables feature that just released, it's possible that this use case can work with them. we'll be releasing documentation and tutorials so keep an eye out on our youtube channel
m
I'm using a webhook with make.com to keep a botpress table in sync with a google spreadsheet (the webhook returns some json and iterates through and updates the table). Is there going to be additional functionality to streamline this?
a
hi goodwood, we're still in the early stages of tables so we'll be adapting to how our users want to use the new feature. feel free to post on #1111026806254993459 if there's a specific functionality you'd like to see
m
Thanks. Can you say if we be able to use tables as a knowledgebase?
a
towards the end of the office hours last week we hinted at how tables & KBs can interplay we each other. here's the recording: https://discord.com/channels/1108396290624213082/1132041248526581830/1132454796775936153
a
Hey man, can you teach me how to do that?
m
Sure, I can post some screenshots when I get in front of a computer.
a
Thank you so much!
m
Ok here goes. I use an Execute Code card to call a scenario in Make.com using a webhook. The scenario activates due to the webhook, gets the values from a google spreadsheet, aggregates the data and saves it to a json element, then returns it to Botpress using the webhook response. In the same Execute Code card it then removes all data from the Table and inserts the updated data.
Code:
Copy code
const currentDateAndTime = luxon.DateTime.now().toISO()
const webhookUrl = 'https://hook.us1.make.com/<your_scenario_id>'
try {
  const response = await axios.post(webhookUrl, { currentDateAndTime })
  const webhookResponse = response.data
  console.log(webhookResponse)
  const { sheetsData } = webhookResponse // Extract the array
  console.log(sheetsData)
  await removeAllRecords()
  await insertRecords(sheetsData)
} catch (error) {
  console.log(error)
}

async function removeAllRecords() {
  try {
    const data = await SheetsDataTable.findRecords({ selectorName: 'allRecords' })
    const recordIDsToDelete = data.map((data) => data.id)
    await SheetsDataTable.deleteRecords(recordIDsToDelete)
  } catch (error) {
    console.log(error)
  }
}

async function insertRecords(sheetsData) {
  try {
    await SheetsDataTable.createRecords(sheetsData)
  } catch (error) {
    console.log(error)
  }
}
And here is the Make.com scenario. JSON documentation here: https://www.make.com/en/help/tools/json
a
Thank you so much! That is amazing
a
this is really awesome. goodwood, would you mind posting this on #1132038253109837994? i think this is something the community would love to learn how to do.
m
Thanks! Sure I can give it a shot, but might have to wait until next week when I have more time. Although it's fairly limited right now because tables can't be used as KB's and when I pass the info from the table to AI it really struggles (i.e. it can't reliably do math or relay accurate information based on the columns). I'm really interested to see how the native AI fares in comparison when you release the feature to use tables as KB's. (if there is a beta for that I'd love to join btw!!)
c
Me too i would love to test it @rich-battery-69172 is there any way to access it early as developers?🥹
l
i like this
c
Its coming
m
84 Views