Once your data is embedded and stored in a vector database, it can be accessed via similarity searches that retrieve semantically related content. This is the core of many search-based automations, such as knowledge agents, similarity lookups, or classification.
1. Input and Embedding #
To perform a search, you must first embed the query input. The source of the query might be:
- A message from a user via Slack
- A question entered into a form or chatbot
- A cell in a Google Sheet
You can then use a cycle to pass the query text to an embedding service, and the resulting vector is used for similarity search.
It’s best practice to use the same embedding model for both data ingestion and queries to ensure compatibility. This is mainly due to different models producing vectors with different dimensionalities. Even models with identical output dimensions (e.g., 1536 vs. 1024 dimensions) may differ in how they encode and structure semantic meaning.
2. Performing the Search #
The exact methods available for querying a vector database in Cyclr will depend on the specific vector database connector and capabilities of the underlying service.
For example, the Cyclr Pinecone connector offers search methods such as:
- Search Text By ID
- Search Text By Vector
- Search Vector
- Search Text By Inputs
Most vector search methods include configurable parameters such as:
| Parameter | Purpose |
topK | Number of results to return (e.g., top 3 or 5 matches) |
filters | Optional metadata filters to narrow search scope |
Be sure to consult the connector documentation for your chosen vector database to confirm which methods and parameters are available.
Search results return matched vector records along with associated metadata and similarity scores. These can be passed to subsequent steps for handling.
3. Using the Results #
Once results are retrieved, there are several ways to apply them within your workflow. You may display the matches directly to an end user, or log them to a structured system like Google Sheets.
Common actions you might take after retrieving results:
- Display: Send results to Slack, Teams, or email
- Storage: Log responses in Google Sheets or internal systems
- Response Generation: Feed into an LLM as context for a generated reply
Use Case Example
For example, in this Retrieval-Augmented Generation (RAG) workflow, a user’s question is embedded, used to search the vector database, and the top results are bundled into a prompt. This prompt is sent to OpenAI’s chat API, and the response is returned to the user via a connected channel.
RAG Example Flow:
- User question is received
- Question is embedded
- Top results are retrieved from the vector database
- Results + question are composed into a prompt
- Prompt is sent to a language model (e.g., OpenAI)
- Final response is sent to user