AI Search in Quebec - Live Coding Happy Hour for 2021-02-19
[Music] so [Music] one hello and welcome to live coding happy hour on february 19th we are excited to be here with you today and before we get any further let's go ahead and start with our introductions check hey my name is chuck tomasi i'm a senior developer advocate at servicenow been here for what 10 and a half you know i should just say i started in 2010 i'm sick of doing the math touchy track pad it's what let me tell you people it's one of those days i've got injuries to prove it drywall screw in the finger this morning and it went downhill from there so if anything technical weird happens blame me uh because that's i still need my trainee badge for this video thing where were we on the intro let's just keep going you next started in 2010 and you are awesome and you're here and i'm andrew barnes developer advocate in servicenow i've been doing this for a while but not nearly as long as brad and chuck and i specialize in large scale development deployment integrations and custom apps brad my name is brad tilton i am a developer advocate with servicenow as well i've been doing servicenow things for about 12 years been an employee for the last four i do see the comments that our sound is really low and you guys can't really hear us very well it was not me this time uh but uh maybe we can look at that anyway is the sound working at all yeah well we're moving the meters i boosted the output just a little bit we'll see if that helps all right so one of the things we do on this show in addition to uh coding live and happy is that we drink some beverages and then we rate them at the end so let's go ahead and introduce our beverages check i've been so busy with the technical issues i forgot to grab a beer this week you guys do your introductions i'll be right back all right all right i have a brown bear brown ale from uh catawba is that a a cookie is there a cookie on that it's a bear oh it's a bear it looks kind of like a chocolate chip cookie bar he's a he's a big happy brown bear look at him and uh all right catawba brewing code i think so fred what did you get i have uh this deschutes uh is it to shoot the shoots home at port it's a it's a trappist belgian ale that has been aged in port barrels so i am excited about it apparently we need to ease that volume up even more it's at the max okay unless there's something in windows that i can set the output volume a little higher because they're saying they can barely hear me too let me see how badly this is it it is a select it's pretty low it's it's pretty low so we can try to talk loud it the the audio should switch when uh we move over to screen share all right we'll do that quickly okay i got my beer i have a locally brewed one papa go orange blossom which is a mandarin wheat all right well thanks i will hand it over to andrew to launch us into screen share so that people can hear us all right let us start with the screen share here we go um what am i doing yeah so today um what we're gonna do is look at ai search so we've been looking at the now intelligence things this week i've done some blogs we did a video um for our our creator toolbox on tuesday um and all related to now intelligence and there wouldn't be a now intelligence week if we didn't mention ai search so ai search is brand new here in quebec um let us know if the audio is any better now no oh this is disappointing very disappointing i'd um the only next solution then would be to uh stop streaming and then restart it from obs um so would you like to try that chuck or not i can stop streaming it's it's not even going halfway up the green which makes me wonder if it's an input issue do you want to reconnect the zoom as well then i can try it out that might be it let's try or or unless there's a zoom volume setting maybe microphone no we're not back live yet microphone input volume is like next to nothing and output volume is really low so i think we are live are we live okay hey guess what i didn't hit i didn't start but they're probably looking at a uh zoom screen ah the behind the scenes stuff input doesn't move i'm gonna boost output just a little bit let's see if that helps okay okay oh seems like it's better hey hey hey i see i hear an echo somewhere though let's make it even more better here in an echo as well have you turned off the vm's output volume to your i did earlier today but now it's off all right with those issues aside let's go back to screen share okay back to screen share i'll mute my mic and do a quick audio check too oh my goodness i'm so sorry for this uh today folks uh but we're gonna look at ai search so the first thing you do is you go to the documentation and and read up on ai search uh the second thing to note is ai search is not enabled in personal developer instances um and in most of the quebec user instances that have upgraded already during this early access and that's because there's hardware that drives this behind the scenes um and not all that hardware is deployed yet so many of you won't be able to leverage this until uh the market launch um a la patch one of quebec for general availability uh which will be next month so with all those caveats let's go take a look at ai search so i'm here in an instance and if you are in an instance that is going to work for ai search when you type ai search you'll get quite a bit of configuration item uh modules over here on the side and when you click search status it will tell you search is enabled if you don't have the hardware yet there will be a search is not enabled and there'll be a kb link there but our search is enabled on this instance and so what we're going to do today is we're going to do the underpinnings for a now experience search page for our artifact manager so we we have an application called artifact manager that we uh you know have some now experience pages for and we want to add a search page and we want to leverage ai search and in order to do that we need to to configure ai search to to search our tables and provide that data to as a search source does that make sense to the chuck and bread it does yes i'll say yes because i was resizing the video [Laughter] so the first thing that we need to do here under ai search index and let me make sure um let's make sure i'm plenty plenty big today that's good so um the first thing i'm going to do is i'm going to create one of these index sources so over here in configuring ai search documentation uh it will walk you through how to you know do these so we can create a index source so a search source and we're going to give it a name and we're going to say artifacts and we need to give it a source so we're going to give it the artifact table it's the application you have going on here uh that is uh really deceptive right there right yeah so i need to be in the correct uh application scope why is my alright you're getting a full reload buddy look at you being bad come on finish loading artifact manager thank you for that brad that would have caused me issues nice i'm glad i uh you you're you're already uh paid off your value here all right everybody have a great weekend [Laughter] power can go off in in texas for you uh so you'll see this little triangle right next to it um which says you know it's got i've got a nice little info message to say hey this hasn't been processed yet and that makes sense because i just set it up and i haven't hit index all tables yet or set up any of these um so we don't have any child tables that we want to look at for this um but we do need to do some field mappings so under field mapping go ahead the child tables that would be that would be if you had a parent table and then it had some children and you wanted to index instead of tables and provide them in the same in you know at the same time so i could do those as separate uh index sources or i could do them together okay so um we're gonna create a new field setting uh for our fields uh so we won't like probably like short description seems like a good one and and we're gonna map that to title and i'll tell you uh why and what that is in a bit so you just just believe me for now title's the way and i'm going to choose an attribute um i did do that one too fast which is i've got four choices here which is not searchable no text index mapped to which is what i'm doing which is i want to map a field to a value and then map to raw which i don't know what that does so three of these uh i know what they are and they're obvious to me i'm after all i don't know what that is and i haven't used that yet so this is all very very new stuff uh so if we run into walls it's because i just got hey i search enabled hardware today uh this is all new for me too um so after short description what's another field that you would think uh you would be searching for chuck description description seems good and i need to map that to uh what am i going to map that to we're gonna put a false value here for now that's not the value that it needs to be uh and uh we'll we'll come back somebody uh put a pin in that remind me that i i need to give it a real one and then one let's do one more abstract type type oh type okay and let's go with uh candy so we're mapping it to uh are these going to be like spots in the search results so the values are is the name of the of property essentially that i'm going to use to then map to uh the oh um i'm i i got confused oh these should be things that i want to display okay and you're mapping them to the spot in the not things that i want to search these are things i want to display so i uh so that's why uh we're gonna come back to this screen okay we'll be back these are i think these are still fine uh because these are things i will want to display at least i want to display type and short description i might not want to display uh the full description but for now uh we will say uh go so that we can get this going in the background and now i'm gonna go to ai search and we're going to create a new search profile and we're going to call this artifacts for the awesome and you'll see that i've got some choices here and i could have created a search source right from here but i'm going to link to an existing one because i've already created it just a moment ago um no i didn't because i created the index sources not the search source yet so we're gonna we need to create a new one so let's do it create and link artifacts and this is the one i've already done um so you'll see this as a theme um for a bit which is pretty much all of these levels so the search source and then two other places in the future that we will see are places and opportunities to add further conditioning on our our search so for now i'm going to do type is not archived so this is basically our an inactive flag because i don't need to search those that's that's where we send things that need to die yeah we don't delete things because that's just how we roll but that is where things go to die so very true brad now if you're familiar with searching like zinc search on the platform or other search things um some of these uh related lists will be familiar to you and they're auto created for you um you know right out right off the bat like the default stop word dictionary is applied to this uh search profile that i've uh created just now um and we can add new ones and we can uh you know remove them uh from here but it you know the default uh stop uh the default synonyms and the default typo handling is already applied for me so i'm gonna leave those i'm gonna save this record because i feel like i didn't save it enough and um we're gonna probably come back to genius results because i'm gonna want genius results as well so we're don't forget about genius results we're going to come back to you buddy we'll we'll see you in a bit uh so we need to publish this in order to consume it so i'm going to go ahead and publish it even though we're going to need to update it later so that should publish um and make active any of these dependencies under it so the search source should be in the available uh state and we can go check on our artifact table index and see if we've gotten our index done right here in our index history records process 38 awesome because that's how many we have nice so if i come over here to live streams i should have 38. just 10. you need all artifacts except the x archives 38 yep so um that is great news uh that it's found the things you uh not ui search ai search so uh we have most of a working profile now so i could stop at this point i think um because i've got an index and i've got a you know it all linked up to provide to a front end right now but i'm going to go ahead and create a genius result because i'm going to want that at the same time so let's go ahead and create one of these two now i'm going to set the trigger condition always artifacts our genius result answer type is search so i'm going to save this and then i'm going to have to figure out what's going to go oh yield label is in the current input selected table nothing what where was the choice where was the choice for that uh where is i think because i didn't actually put anything in here uh is what made it angry um let me switch over to here and take a look at so one thing i do need to know i i need to put in my return fields and i need to adjust this genius logic script are things that i definitely need to do i had a little bit of magic baking in the background because i didn't want to have to craft this from scratch entirely but um one thing to note is this snais is a documented api yay so sn ais is a documented uh thing and we needed uh if you noted there uh we need the genius results answer uh part of these and so these are the uh things that i can call inside um of this script area with this object uh to to do useful things so i'm going to need to set table ah which is what made it angry i believe is that i had not done this yet does that make sense yes all right so we're going to say answer dot set table and would you set that to the artifact table that's the artifact table um in artifact x under snc artifact under mgr that that's amazing that you know that but also i am a copy pasta yeah yeah no after migrating all the uh technical and community live stream stuff over i become very familiar with the table structure of that app but i use constants so i don't type them out it's a it's a reason why i don't uh run into typos very often in my code because i don't type you know even if there is a typo guess what it's the same everywhere i got to get you guys using the constants thing so that we don't have hidden hard-coded table values like this too i do like constants so now uh the next thing i needed to do was add some search phrases so let's add search phrase and this is going to be daniel's saying he saw a table field that was hidden by like a ui policy when this form was loaded we might want to do a show xml see if there's something in in this form that we just didn't see so what is context what was that so that is what we're passing into this function which oh i see it yeah it's an input parameter that the the person uh submitted yep um so now i'm going to set the search limit and we're gonna do one let's just get one genius result and let's uh return that looks good so let's add a field so we want to return the uh let's take a look we want to return the number field and the title field which is is actually called title let's take a look uh it is short description because of course it is number and short description now what you'll note is right now i have seven genius model uh fields as outputs or down here in this related list and i should when i hit save have not oh look at that table and number or a number and short description are in here now yay that makes me happy so let us return back up the ui a i wow that's that's probably going to get me genius results artifact looks happy i'm going to actually unlink this and link it back and see if i get that error again just because i want to see if i get that error i don't okay uh so let's go see if we can do some searching so in order to link this up to a um a now experience we need to create a search application oh good my memory is a is a fickle thing uh so we need to go in ai search search applications and create a new search application configuration artifacts so we're going to use the ai search because we're we're serving that up and we're going to choose the search profile that we just created artifacts um and this is where we get to you know apply uh the search results limits and the genius limits why would we limit the genius results to one so the genius results is a special category of results and i think that something around three two or three is the right number for that so i i heard one of the search folks say that when they tried to to go as high as like five it it it stopped being as useful to the users so to keep this number relatively low nice and i'm gonna believe them because that's their job [Laughter] until i have evidence to the contrary i've got to believe people now the what we need to do here um is is there anything interesting in the chat oh is everybody just going constance talk oh we've started a have we started a religious war no i think most people are on board that's disappointing it's fun when you do um so we need to on this screen uh create a uh the search facets that we're gonna provide um and this is gonna be from that field mapping um that we did earlier so we're going to name this one you know short description and we're going to call this title a lot of annotations on this form there are a lot of implementations in the most annotated form that i have seen that got positive feedback though somebody said in the chat that's great yeah this is a lot of annotations it's like a docs page right here you should tell if it's not obvious you should tell people how they need to fill something out i i like it um so now this is our facet field and this is gonna need to be the table name dot field name so i think i still have nope so we need our table name dot short description and we're going to give it an order and we're going to try this with just one for now attack cat going to try this with just one and see if we actually like have done enough of the steps right to do this so in in in true fashion uh i'm i'm not uh i have no idea if this is going to work we have done a lot of things so far without doing any testing i know right i am curious it's a little nerve-wracking right um so let's see if we can get off here and we are going to change this and open oh nope we need to save my search test has no matches well that is actually promising builder seems to have gotten me some results so you the title is a way for you to filter so the search facets are the are things that i can filter on yep so i could easily for example put a type here would be a good search facet yep um i haven't uh gotten this linked up properly and i think that's uh in my ui i need to go make some adjustments um because right now i'm using a name field and we don't have a name field so what i'm seeing is this is promising that that i'm actually getting the yeah it's promising getting results but i'm not seeing a a huge difference of this over like a keyword search because you've you've went for something very specific um sure let's uh let's narrow down then let's get uh so is that the mapping that we would have done would have affected the results we started doing it at the beginning uh so the mapping that we did at the is those field mappings was field value that was like cookies yep so over here in index source under artifact so these guys are are values that i can leverage to display the search results okay i think would this have affected nope they've got it actually these have to be the fields that we're searching as well field settings because we can say don't search if you know oh yeah one of the choices is don't search a thing hmm that's that's uh where i'm you know hit the uh the edge of my knowledge but it it feels to me like i someone told me that i didn't have to map i didn't have to put all the fields i want in here but the fields that i do put in here uh are the ones that i can surface um so let's search for well we're gonna have to get the display working so we can uh be sure um so i'm i need to adjust the display a little bit um so that's right sorry for this page was this uh um was this a page template that you just spun up um i don't understand what you mean when you add when you create a new page in ui builder there's like 10 page templates oh this is not from that's not okay you had to you had to grab this from someone all right yes and and this is uh creating one of these and wiring it up is a future future show but right now uh what uh the main thing i need to do is go look at my evam map the field i need i did an even blog this week and yeah i think it's in the it's in the middle tab i missed something what is evan entity view action mapper if you want to know more about it chuck i wrote a blog and did a 12-minute video on it this week well you know what i think that deserves a ding on the bell if i had it ready so the view template is so um i was trying to avoid uh doing this at all [Laughter] because this gets even more uh complicated uh and it again at the edge of my uh amazing uh deep knowledge on this which is non-existent uh but let's let's uh dive in then um so in order to provide these search results uh we need uh one of these uh you know entity view action mappers evam and i have already got one wired up to my ui that uh um which is this one and i'll need to uh really the the thing i should do is uh create a new one but i'm gonna see if i can maybe uh do this without breaking this one all the way just break it a little bit so i when i did a table um i lost my fields obviously um but uh and that's because they didn't exist and i need title there we are we need at least title um for are search results these are the fields that you're going to want to display on your card ah okay absolutely and then the view template is where you map those fields to the position on the card yes it is feeling kind of mobile to me so uh now that i have the title in this evam i think i should be fine i think you have to go into the view template and tell it to point to the title instead of name i will absolutely have to do that okay which is i was going to get there from the ui but i can get there from right here which is yeah it's right here you're you're most correct sir i've started evm a lot this um so down here in my mappings in my view template i need to change name to short title and then i should actually like get things in the uh in the search area hopefully maybe we'll see let's reload this that's something and look like the title though didn't look like the title it seems like maybe a different field was well let me reload it again and see why why why do i get past due what what are you doing to where does that even come from i don't even know that that's a thing is there a past due field no it's not a past due value hmm interesting well um that was so i i should probably uh do the full uh the full thing then well let's make sure i don't have something weird here i guess yeah let me check this property and make sure i'm mapping search to right where's the search application [Music] artifact copy society so you put that in the uh and you're over in my page yeah it's over in my page parameters i need to uh so i was forcing it a little bit uh by just shoving it in there uh directly um where are how do i get to the page parameters from here brad if you click on test can you just change test to a different i think i can click on it yeah there you go like i can put a client here and this there which it already is and then when i launch it it passes those let's see if you go back to the page it did apply those here but i'm still getting passed through there if you go back to the page and click into the data resource then you should at least see what the data resource is returning from those values on the right here yeah search results got this one yeah so that's our value i'm getting this yeah and i'm getting the right things back so i'm getting short description and table which is which are things i need what did you ask do i oh do i see past somewhere yeah text header label one one oh so maybe we need to set in that in the the uh page template page template back detail header one needs to be a one of the things we're passing on the mapping if you scroll down a little bit yeah into mappings oh it's because we're passing header label two maybe we just changed that to one we could do both yeah let's let's do both let's do both why half it do both then you won't you change two things you won't know which one worked i'm okay with that today [Laughter] it's friday get it to work then then start breaking it um i really thought that was it uh oh did we save the uh i saved it i saved this yeah uh let's take a look here and reload this guy yeah yeah yeah reload look at him saying pastor he's just taunting you we're still yeah why header label one pass do so down here i am getting a separate so i'm getting useful stuff down here so the field is it tight or short is there a set here oh it sure is look at that no yeah you can set so there's static values and this is static value the static values are for like if you have a card and you want to use a label on it you can just set the label to be a static value but do we need short description there and said a title isn't that the name of the field is yes a short description it is i can't tell you how many times i've been fooled by that in the last month so let's get rid of the static value and then use short description and then nuke this guy not that like just this guy say good call brad teamwork [Music] look at that so that's the when you see like created by an evaluation for those are our static values and then we're setting that short description to all of our uh mappings that's what we're doing that so we could set those to different fields and we haven't linked this up so clicking it is not useful you do that with a handle you know which do you know which values are or which results are from the regular search versus the genius search well right now everything is from oh um yeah so i haven't i'm not displaying the genius search on this ui oh okay so yes you do uh and it's how you present it to the user so you get control over that so you would put it in a more prominent place um uh to to do that so i'm going to uh stop the screen share because that's as much victory as we're going to get today so i'll go ahead and plug if uh if you were wondering what we were doing in ui builder there i did do a blog and it has a 12 minute video attached to it where i created a evam data an evam definition from scratch and then connected it to a data resource hooked it up to some events and then made it work on a page so if you're kind of lost on what we did in ui builder i would check that out on the developer block and and what i'll say is i'm going to turn this into a blog so i know that we did a lot of things on the screen today and not all of them felt super connected and some of that is i'm not as familiar with this as i want to be yet um but i'll i'll commit to doing a blog that will tie these things together from the video to show you how to to walk this through to you know to what we got to today which is being able to provide data to a search page in and now experience ui so uh but but to recap what we did is we defined a new index search source and you know so we indexed a table with ai search um which is like step one and then uh you know we did some framing around that which is you know set up the search profile and the search source to link to that index we did some uh field mappings there and then the next step so that's like setting up the index the next step is if you want to provide this to a now experience ui you need to set up that search application so that was that second big step we did was create that search application and then the third step is we need to which we skipped over so i completely glossed over it we we massaged an existing one a little bit uh which is we need to actually create a an evam to provide data so you have to in addition to that search application you need to you know provide an event to give that data to your experience and then in your experience you need to consume that so does that uh you know chuck this is all completely new for you how confusing was that for you i think it's very procedural i just have have to put it in context like you said i'll i'll watch this video again uh particularly so i can put the time codes in there and get that to me it feels very confusing yeah it well it's a bit i just did it mobile when you first start too yeah so was mobile when we first started you know with functions and function items and data items and and putting all that together but once you do it once or twice or ten times it should get a little more natural yep and so we did tie a bunch of new stuff together today so if you the uh a viewer were confused that is okay um because this was not a polished and complete end to end you know i was learning while i was doing this i learned a couple of things while we were doing it um and i had only done this mostly uh one time earlier today uh so this is this is all new stuff and we'll continue to keep uh giving you uh extra context and information around uh all of the new things in ui builder uh and now experience like connecting and things like ai search to it um that i'll hand it back to brad so before we get into raiding our drinks uh some questions from the chat uh they cannot do this currently in pdis uh and you said at the beginning of the show i think that once uh quebec goes ga they will be able to do it mp and cdi's i actually don't know the answer to that what i know for sure is customers uh production instances should be available um next month in uh once we're at market launch other than that uh it is a is outside of my knowledge of knowing so i'm not sure if we're going to have hardware to support personal developer instances to do this so it is extra hardware infrastructure and most of the time we don't provide that to the personal developer instances so like metric based for example has extra hardware requirements we don't provide that into our personal developer instances so it it is uh i'm not sure yet but history tells me it's not super likely uh soon phil says so customers can test it live in production i'm assuming that you'll also be able to use it on subfraud's customer as well yeah and the i worded that for a particular reason which is that's what the guarantee is is at market launch all production quebec instances will have the hardware available for that is is what i've been told so production instances may not all be available at that time okay so that hardware is rolling out to our data centers like as we speak um but but the production ones uh and and work with your account team if if you're a servicenow customer and you want to leverage ai search and you're on cadet um they they can accelerate things like that all right well thanks andrew i i learned a lot in that episode uh you know while we were configuring ai search uh let's go ahead and rate our beers before we go uh we'll start with chuck it's only half gone but uh i give this a the orange blossom from papago brewery mandarin wheat uh 375. it was good it was good i um i think i'm in the same place with this brown bear uh brown ale it's it's fine there's nothing wrong with it it's it's a it's a decent brew i wish i'd had like three more of these with the doing this a search today of a good good solid 375. all right and i had the deschute uh it's a trappist ale uh aged in port barrels it was excellent oh my god i'm going to give it a somehow i missed that during the intro can you show it to me again so i can be jealous a little longer it's uh it's a trappist dark ale and it was aged in port barrels for 13 months wow i'm so jealous of all the beers you bring to the table brad it was red we're just we're glad you were able to hang on for this entire hour given what you went through earlier this week i still have quite a bit left nice but you know with the rolling power outages and and the hat you had on tuesday that was we're glad you were able to get here and thank you for bringing us through all of the ai search stuff yeah awesome yeah thanks for joining us everybody uh it's been it's been a fun episode and we'll see everyone next week bye you
https://www.youtube.com/watch?v=mhByFBy3S9c