Skip to main content

Embedded Weaviate

Embedded Weaviate is a deployment model that runs a Weaviate instance from your application code rather than from a stand-alone Weaviate server installation.

When Embedded Weaviate starts for the first time, it creates a permanent datastore in the location set in your persistence_data_path. When your client exits, the Embedded Weaviate instance also exits, but the data persists.

The next time the client runs, the client starts a new instance of Embedded Weaviate. New Embedded Weaviate instances use the data that is saved in the datastore.

For more details on using Embedded Weaviate, see Embedded Weaviate.

Start an Embedded Weaviate instance

import weaviate
import os

# Best practice: store your credentials in environment variables
openai_api_key = os.environ["OPENAI_API_KEY"]

client = weaviate.connect_to_embedded(
version="1.26.1",
headers={
"X-OpenAI-Api-Key": openai_api_key
},
)

# Add your client code here.
# When the client exits, the embedded instance also exits

Questions and feedback

If you have any questions or feedback, let us know in the user forum.