Build a Monster-Finding Tool For D&D. Editor.

Robert Turner

TL;DR

Naive multi-attribute search requires separate indices and post-processing, but Superlinked enables single search with attribute weighting at query time
D&D monster-finder demo - using look, habitat, and behavior attributes. Query weighting of attributes empowers fine-tuned control (-1.0 to 1.0). Single vector store with concatenated attributes outperforms multiple stores. Implementation uses BERT embeddings and cosine similarity scoring.

An AI-powered Army of Darkness

It's game night, your friends are perched around the games table, waiting to see what Dungeons & Dragons (D&D) character they'll become and quest they'll embark on. Tonight, you're Dungeon Master (storyteller and guide), crafter of thrilling encounters to challenge and enthrall your players. Your trusty D&D Monster Manual contains thousands of creatures. Finding the perfect monster for each situation among the myriad options can be overwhelming. The ideal foe needs to match the setting, difficulty, and narrative of the moment.
What if we could create a tool that instantly finds the monster most suited to each scenario? A tool that considers multiple factors simultaneously, ensuring each encounter is as immersive and exciting as possible?
Let's embark on a quest of our own: build the ultimate monster-finding system, using the power of multi-attribute vector search!

Creating creatures with vector search, why do it?

Vector search represents a revolution in information retrieval. Vector embedding - by taking account of context and semantic meaning - empowers vector search to return more relevant and accurate results, handle not just structured but also unstructured data and multiple languages, and scale. But to generate high quality responses in real-world applications, we often need to assign different weights to specific attributes of our data objects.
There are two common approaches to multi-attribute vector search. Both start by separately embedding each attribute of a data object. The main difference between these two approaches is in how our embeddings are stored and searched.
the naive approach - store each attribute vector in separate vector stores (one per attribute), perform a separate search for each attribute, combine search results, and post-process (e.g., weight) as required.
the Superlinked approach - concatenate and store all attribute vectors in the same vector store (using Superlinked's built-in funtionality), which allows us to search just once, with attendant efficiency gains. Superlinked's spaces also let us weight each attribute at query time to surface more relevant results, with no post-processing.
Below, we'll use these two approaches to implement a multi-attribute vector search tool - a Dungeons and Dragons monster finder! Our simple implementations, especially the second, will illustrate how to create more powerful and flexible search systems, ones that can handle complex, multi-faceted queries with ease, whatever your use case.
If you're new to vector similarity search, don't worry! We've got you covered - check out our building blocks articles.
Okay, let's go monster hunting!

...

Originally published here.
Like this project
0

Posted Feb 14, 2025

As Dungeon Master, you craft epic encounters—but finding the perfect D&D monster is tough. Let’s build a tool that picks the ideal foe with vector search magic!

Likes

0

Views

4

2023 Python Developer Salaries Around the World. Author.
2023 Python Developer Salaries Around the World. Author.
schedulingreform.org - website design and development
schedulingreform.org - website design and development
larret.org - website design and development
larret.org - website design and development
Proportional Security - website design and development
Proportional Security - website design and development