[Question] Error: Can't get standard auto vectorization to run?

Running a local docker container. I’ve got a typescript script (v3) creating a table & adding one toy example. No matter what I try, when I query on wcs, it is showing no auto vectorization. I know the openai key is good since I use it in other apps, and I include it both the docker compose and the script itself. The inserted text shows but vectors for each are empty. I’ve cleared the local data in WCS without improvement.

const jdCollectionSchema: CollectionConfigCreate = {
  name: "JD",
  vectorizers: [
    vectorizer.text2VecOpenAI({
      name: "basics",
      model: "text-embedding-3-small",
      sourceProperties: ["basics"],
      vectorizeCollectionName: false,
    }),
    vectorizer.text2VecOpenAI({
      name: "best_practices",
      sourceProperties: ["best_practices"],
      vectorizeCollectionName: false,
    }),
    vectorizer.text2VecOpenAI({
      name: "red_flags",
      sourceProperties: ["red_flags"],
      vectorizeCollectionName: false,
    }),
  ],
  properties: [
    {
      name: "basics",
      dataType: "text",
      vectorizePropertyName: false,
      tokenization: tokenization.LOWERCASE,
    },
    {
      name: "best_practices",
      dataType: "text",
      vectorizePropertyName: false,
      tokenization: tokenization.LOWERCASE,
    },
    {
      name: "red_flags",
      dataType: "text",
      vectorizePropertyName: false,
      tokenization: tokenization.LOWERCASE,
    },
    {
      name: "createdAt",
      dataType: "date",
    },
  ],
};

What am I missing?

docker image 1.26.4, dotenv 16.4.5, weaviate-client 3.0.8

Hi @weisisheng,

Can you share the code you use to:

  • connect (please redact your URLs/API keys),
  • insert data,
  • query?

In your configuration, you have 3 vectorizers. So, when you query, you need to provide the name of the vector you are searching on, like this:

const jd = client.collections.get('JD');

const result = await myNVCollection.query.nearText('your query', {
  targetVector: 'basics',
  limit: 2,
})

To be on a safe side.
Do you run Weaviate with Docker or in Weaviate Cloud?

I’ve got one collection which I’ve had on WCS for a few months Completely separate from this new project.

The one I am trying to insert is on docker. I just found the ability to query local from WCS today.

Let me do some snipping and I will send the rest.

Thanks!

connection

// Connect to local Weaviate database
  const weaviateClient = await weaviate.connectToLocal({
    headers: {
      "X-Cohere-Api-Key": process.env.COHERE_API_KEY || "",
      "X-OpenAI-Api-Key": process.env.OPENAI_APIKEY || "",
    },
  });
  
  
  // insert data 
  // Insert the example note into the note collection
  const jdCollection = weaviateClient.collections.get("JD");
  await jdCollection.data.insert(exampleJD);
  // query on WCS
  {
  Get {
    JD {
      basics
      best_practices
      red_flags
      createdAt
      _additional {
        vector
      }
    }
  }
}

response

{
  "data": {
    "Get": {
      "JD": [
        {
          "_additional": {
            "vector": []
          },
          "basics":
...

Set up a new openai api key, fixed the process.env reference for a typo, and narrowed the “vectorization” to one field, still no vectors.

  vectorizers: [
    vectorizer.text2VecOpenAI({
      name: "basics_vector",
      sourceProperties: ["basics"],
      model: "text-embedding-3-large",
      dimensions: 1024,
    }),
  ],

query

{
	Get {
		JobDescOpenAI {
			basics
			best_practices
			red_flags
			createdAt
			_additional {
				vector
			}
		}
	}
}

stumped for sure…

Support

See this post for the answer: Explain _additional vector returned response like i am 5

1 Like

Thanks for linking to the fix, the docs team is working on adding more information for that part of the documentation.