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

# Set this environment variable
# OPENAI_API_KEY your OpenAI API key

import weaviate
import os

client = weaviate.connect_to_embedded(
version="1.25.4",
headers={
"X-OpenAI-Api-Key": os.getenv("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.