Skip to main content

Vector DB for Vector retrieval

How to Use ai12z as a Vector Store for Fuzzy Matching and Retrieval

Overview

The ai12z platform lets you ingest any large set of content items and search against them using vector search, which is semantic, fuzzy, and typo-tolerant queries. This approach eliminates brittle "exact match" logic and unlocks true conversational and typo-robust retrieval, without custom code or 3rd party vector db. Example use case below, we have a large data set, where we need the ID to call another custom integration with that ID, but the bot user does not know the ID but some phrase, in this case a bus route or stop.

Work flow block diagram

Typical Use Cases

  • Route or stop ID lookup (DART, transit, etc.)
  • Product or SKU lookup (retail)
  • Employee, location, or FAQ answer retrieval
  • Any situation where a user query may not exactly match your data

1. Prepare Your Data

Format your data of each item as a vector document, that will be uploaded to ai12z document file upload:

  • content: The phrase or question users might ask (e.g., "What is the stop ID for WALNUT HILL @ RAMBLER?")
  • title: The canonical ID or answer (e.g., "12908" or "Blue Line")
  • description short version of the content

Example:

{
"type": "bulkContent",
"data": [
{
"content": "What is the stop ID for WALNUT HILL @ RAMBLER - W - MB?",
"description": "What is the stop ID for WALNUT HILL @ RAMBLER - W - MB?",
"title": "12908"
},
{
"content": "What is the route ID for DALLAS STREETCAR?",
"description": "What is the route ID for DALLAS STREETCAR?",
"title": "26377"
}
// ... up to 8000+ entries
]
}
  • For DART, set "content" as the user-facing question phrase, and the "title" as the unique ID.

2. Bulk Upload into a Dedicated ai12z Agent

  • Go to ai12z Bulk Content Upload Docs.
  • Create a new ai12z Agent just for this lookup data (e.g., "DART Stops and Routes").
  • Use the web UI or API to upload your bulkContent file.

Tip: This isolates your vector store and ensures fast, noise-free search.


Work flow block diagram

  • In your main Agent (where your assistant/LLM runs), add a Custom Agent Vector Search.

  • Set the agent to use the ai12z https://api.ai12z.net/bot/search API endpoint:

    POST https://api.ai12z.net/bot/search
  • Parameters:

    • query: (the user’s bot phrase)
  • Full API Reference

-- JSONata request:

{
"apiKey": "0e7295b1...",
"query": query,
"num_docs": 5,
"score": 0.3,
"returnAll": true,
"returnContent": true
}

4. How the Fuzzy Lookup Works

  • When User submits a query, the reasoning Engine LLM determines if it should call the Vector search Integration function, with the query,

  • Endpoint https://api.ai12z.net/bot/search

  • ai12z performs vector similarity search (using embeddings), returning top N most relevant results—even with typos, partial matches, or synonyms.

  • The Reasoning LLM can then:

    • Interpret the top results received and the LLM will pick, almost always the top item, you are insured accurate ID.
    • Show a list of close matches if confidence is low
    • Fall back to clarification if nothing is found

Example Response:

{
"docs": [
{
"title": "12908",
"description": "What is the stop ID for WALNUT HILL @ RAMBLER - W - MB?",
"content": "What is the stop ID for WALNUT HILL @ RAMBLER - W - MB?",
"score": 0.68
}
// ... up to numDocs results
]
}

vector search


5. Benefits of This Approach

  • Lightning Fast: Isolated dataset means instant results
  • Noise-Free: No interference from unrelated documents
  • Fuzzy/Tolerant: Handles misspellings, partial matches, etc.
  • Scalable: Works for thousands of entries with no extra setup
  • No Code Maintenance: No Pinecone, custom embeddings, or middleware needed

6. Tips for Implementation

  • Use title as the canonical return value (ID, code, answer, etc.)
  • Use content as the varied ways users might ask the question or reference the entity
  • If using for LLM tool chaining (e.g., two-step workflows), always resolve to the ID/title before proceeding to downstream actions
  • You could use JSONata to transform title to "ID"

Summary

ai12z makes it easy to build a high-performance fuzzy lookup and retrieval system. Just bulk upload your data, set up a dedicated Agent and agent, and leverage the /bot/search API for typo-tolerant, relevant results—out of the box. Also it works for any language the question is asked in.