At the end of this workshop, you too will have an idea of how to go about building AI-enabled experiences over YOUR data with the latest and greatest from Google models.
Given at DevFest Stockholm
Disclaimer: You will have to setup a billing account to use Google Models. Worry not if you don't have that, you can use something else.
An AI-powered personal assistant powered by our journal entries.
We'll use...
- Weaviate
- Next.js
- Google (maybe)
Please have the following installed:
- Node.js (v18+):
node -v
- VSCode (optional):
code .
- Google Cloud CLI (optional):
gcloud auth print-access-token
- expires in an hour.
- Setup a project and get our API keys
- Add Billing to your account
- Install Google Cloud CLI
Project ID can be found here.
Now let's chat with Google
Let's talk with Google! Go here.
Some journal data! Month entries to give as context to our LLM
- Link to data: Journal entries
- Make a new folder and run
npm init
in it. - Install weaviate-client, typescript and dotenv.
- Get credentials on Weaviate Cloud
- Setup TS config
- Create
.env
file. - Make a new script file and run it, but before!
Paste this!
const weaviateURL = process.env.WEAVIATE_URL as string
const weaviateKey = process.env.WEAVIATE_ADMIN_KEY as string
const googleKey = process.env.GOOGLE_API_KEY as string
const client: WeaviateClient = await weaviate.connectToWeaviateCloud(weaviateURL, {
authCredentials: new weaviate.ApiKey(weaviateKey),
headers: {
'X-Goog-Vertex-Api-Key': googleKey,
}
})
console.log("Client details", (await client.getMeta()).version)
- Create a file called
load.ts
- Let's import data with
insertMany()
!- Data link
- Run code!
- Create a file called
query.ts
- Play with Search using
nearText()
- Run code!
- What do our vectors look like?
- Let's play with
generate.nearText()
- Prompting 🪄
- Different types of context! Grouped or Single
How can we improve retrieval?
The best of both worlds!
- Alpha and Fusion algorithms
Can we drill down into our data?
- Filtering on properties
- Aggregate queries
- Clone - https://github.com/weaviate-tutorials/nextjs-weaviate-template
- Run
yarn install
andyarn dev
- What are we looking at?
- Let's make it our own!
Refer to slides! Weaviate Knowledge cards help a lot too!