Weaviate is a cloud-native, real-time vector search engine (aka neural search engine or deep search engine). There are modules for specific use cases such as semantic search, plugins to integrate Weaviate in any application of your choice, and a console to visualize your data.
GraphQL - RESTful - vector search engine - vector database - neural search engine - semantic search - HNSW - deep search - machine learning - kNN
You can find detailed documentation in the developers section of our website or directly go to one of the docs using the links in the list below.
- Documentation
- About Weaviate
- Installation
- Modules
- RESTful API references
- GraphQL references
- Client Libraries
- How To's
- RESTful API references
- GraphQL references
- More resources
You can find more examples here
A simple example in Python (you can also use other client libs) showing how Weaviate can help you unmask superheroes thanks to its vector search capabilities ๐ฆธ
- Connect to a Weaviate
import weaviate
client = weaviate.Client("http://localhost:8080")
- Add a class to the schema
classObj = {
"class": "Superhero",
"description": "A class describing a super hero",
"properties": [
{
"name": "name",
"dataType": [
"string"
],
"description": "Name of the super hero"
}
],
"vectorizer": "text2vec-contextionary" # Tell Weaviate to vectorize the content
}
client.schema.create_class(classObj) # returns None if successful
Step 3. Add the superheroes with a batch request
batman = {
"name": "Batman"
}
superman = {
"name": "Superman"
}
batch = weaviate.ObjectsBatchRequest()
batch.add(batman, "Superhero")
batch.add(superman, "Superhero")
client.batch.create(batch)
Step 4. Try to find superheroes in the vectorspace
def findAlterego(alterEgo):
whoIsIt = client.query.get(
"Superhero",
["name", "_additional {certainty, id } "]
).with_near_text({
"concepts": [alterEgo] # query that gets vectorized ๐ช
}).do()
print(
alterEgo, "is", whoIsIt['data']['Get']['Superhero'][0]['name'],
"with a certainy of", whoIsIt['data']['Get']['Superhero'][0]['_additional']['certainty']
)
findAlterego("Clark Kent") # prints something like: Clark Kent is Superman with a certainy of 0.6026741
findAlterego("Bruce Wayne") # prints something like: Bruce Wayne is Batman with a certainy of 0.6895526
Step 5. See how the superheroes are represented in the vectorspace
def showVectorForAlterego(alterEgo):
whoIsIt = client.query.get(
"Superhero",
["_additional {id} "]
).with_near_text({
"concepts": [alterEgo] # query that gets vectorized ๐ช
}).do()
getVector = client.data_object.get_by_id(
whoIsIt['data']['Get']['Superhero'][0]['_additional']['id'],
additional_properties=["vector"]
)
print(
"The vector for",
alterEgo,
"is",
getVector['vector']
)
showVectorForAlterego("Clark Kent") # prints something like: The vector for Clark Kent is [-0.05484624, 0.08283167, -0.3002325, ...etc...