This operation allows you to pass in text directly for inserting and searching vectors.
The text is automatically embedded with an embedding model of your choice (can be defined
in your config.hx.json file). The default embedding model is text-embedding-ada-002 from
OpenAI. Make sure to set your OPENAI_API_KEY environment variable with your api key as well.
QUERY InsertText(content: String, created_at: I64) => // Create an empty user node basic_user <- AddV<Document>(Embed(content)) // You could also write it like this with properties AddV<Document>(Embed(content), { content: content, created_at: created_at }) RETURN basic_user
You can also use the Embed function in a search query:
Copy
Ask AI
QUERY SearchText(query: String, limit: I64) => // Search for documents that are similar to the query results <- SearchV<Document>(Embed(query), limit) RETURN results