商店现已上线

我们打造用于网站、AI 智能体和 LLM 训练的 Workstation AI 机器——在线配置并购买。

获取同行价格
AI 产品
AI 实验室OpenAI 智能体Claude 代理Grok BotWorkstation AI 原生 CRM营销所有产品
AI 解决方案
应用型 AIAI 智能体生成式 AIAI 自动化AI 技能提升中小企业 AI 套餐企业 AI 实验室AI 工作站NVIDIA 硬件与软件NVIDIA 加速计算私有 AIGPU 集群边缘 AI行业 AI
AI 服务
平台现代化数字工程数据基础与 AI自主运营AI 咨询DevOps 自动化网络安全软件开发智能体构建MLOps 搭建GPU 租赁
关于我们
公司我们的故事合作伙伴客户案例
AI 数据中心
AI 洞察Jev 系列基准测试实验室模型选择
技术说明
文档
Linux 操作系统UbuntuRed Hat Enterprise LinuxSUSE LinuxAlpine LinuxDebian, Rocky & AlmaLinux
AI 云平台AWS & Amazon BedrockGoogle Cloud & Vertex AIMicrosoft Azure & AI FoundryGPU 云与算力市场
私有 AI 数据中心面向律师事务所面向会计师事务所本地部署平台全面安全的云
工具Ring PromoterJobshout
新闻
博客
联系我们登录

面向现代企业的 AI 工作站、AI 多智能体软件、GPU 基础设施和智能代理解决方案。

联系我们

AI 解决方案

应用型 AIAI 智能体生成式 AIAI 自动化AI 技能提升中小企业 AI 套餐企业 AI 实验室行业 AI

产品

所有产品Workstation AI native CRM 与 ERP营销OpenAI 智能体Ring PromoterJobshout

公司

关于我们公司AI 数据中心为什么选择Workstation合作伙伴客户案例定价联系TenthMatrix

资源

AI 洞察技术说明文档Linux 操作系统AI 云平台私有 AI 数据中心博客搜索网站地图
英国办公室
77-79 Marlowes, Hemel Hempstead HP1 1LF路线指引 — 从 M25 外环伦敦 20 号出口驶出公司编号: 11641870周一至周五:上午 9:00 - 下午 6:00 GMT
+44 7515 356 146
比利时办公室
Workstation SRL, Rue Vanderkindere 34, 1180 Uccle, BrusselsBE 0751.518.683周一至周五:上午 9:00 - 下午 6:00 CET
+32 492 45 67 46
印度办公室
#159 Sector 9, Pocket 1, DDA Flats, 110077 Dwarka, New Delhi
+91 98881 98841

© 2026 Workstation AI。保留所有权利。

隐私数据删除Cookie服务条款网站地图

NVIDIA, the NVIDIA logo, RTX, RTX PRO, Blackwell, CUDA, NVLink, MGX, Omniverse, Spectrum-X, Quantum, BlueField, DGX and HGX are trademarks and/or registered trademarks of NVIDIA Corporation in the US and other countries. AMD, the AMD Arrow logo, EPYC, Instinct, Ryzen and Threadripper are trademarks of Advanced Micro Devices, Inc. Dell and PowerEdge are trademarks of Dell Inc. or its subsidiaries. Intel and Xeon are trademarks of Intel Corporation or its subsidiaries. AMAX, AceleMax and LiquidMax are trademarks of AMAX Engineering Corporation. All other product names, logos and brands are the property of their respective owners. We use them only to identify the products we describe, supply or support; their use does not mean their owners endorse us.

Loading blog...

首页 / 博客
AI AgentsRagNebuladbVector SearchSemantic SearchLLMDatabaseMcpOllamaRustAI

Build AI Agents with NebulaDB: Semantic Search, RAG and a Visa AI Agent

Eight hands-on Labs and a working Visa AI Agent: what we built on NebulaDB, what we measured, and what we learned

Balinder Walia2026年11月8日6 min read
Build AI agents with NebulaDB: semantic search, filtered SQL, RAG and a Visa AI Agent

Most AI agents fail on data, not on the model. They retrieve the wrong document, leak a record the user should not see, or let a language model invent a number that sounds right. We built eight hands-on NebulaDB Labs and a working Visa AI Agent to show how to get that layer right. This post walks through what we built, what we measured, and what we learned. The full technical guide has every query, plan and result.

The idea: put the agent's data, search and model calls in one place

Cloud databases such as Google's AlloyDB AI have made a clear case: an AI application is easier to build when the database does the vector search, the embeddings and the model calls, close to the operational data. We agree with the idea. NebulaDB is our open-source take on it, a single Rust binary you can run on your own hardware:

  • Documents with metadata, embedded on write by a pluggable embedder (we run nomic-embed-text, 768 dimensions).
  • Vector, keyword (BM25) and hybrid search through one endpoint.
  • SQL with meaning: semantic_match(text, '…') next to ordinary filters such as min_age <= 55, over REST or the Postgres wire protocol.
  • An LLM gateway (/api/v1/ai/chat) that routes chat, reasoning and summarising to the model you configure.
  • An MCP server, so agents such as Claude can call SQL, search and RAG as tools.

Our production instance holds 8.3 million documents. The Labs run on that same server, each in its own small bucket.

Eight Labs, eight businesses, one database

Each Lab teaches one idea in two to five minutes and runs against a real NebulaDB. There are no recordings and no canned numbers. You pick a business "pack" (a school trust, a care group, a logistics team chat, a newsroom, a B2B supplier, small UK businesses with tax notes, Indian farmers asking in Hindi and Punjabi, or a Thai visa agency) and the Lab seeds that pack's documents on first use. All the data is invented.

  1. Meaning vs words: the same question through BM25, vector and hybrid search, side by side.
  2. Model shoot-out: hit@1, hit@5 and MRR for each retriever over a labelled question set.
  3. Filters that matter: semantic search plus metadata filters in one SQL statement, with EXPLAIN ANALYZE.
  4. RAG, step by step: safety rules, then retrieval, then numbered sources, then the same model asked twice, once without the sources and once with them.
  5. Reason over the data: a multi-step plan in which every step is a live SQL query.
  6. When to say no: refusal rules, per-user access filters and relevance thresholds, scored on a confusion matrix.
  7. Scale it up: an HNSW ef sweep that trades latency against agreement.
  8. See the space: embeddings projected to 2-D in your browser.

What we measured: hybrid search is not always the winner

On 8 November 2026 we ran every pack's labelled questions against production NebulaDB and recorded hit@1, the share of questions whose correct document came back first:

Business packBM25VectorHybrid
School trust and university59%74%89%
Care homes62%88%73%
Thai visa agency42%71%65%
Small businesses and tax58%62%77%
Farmers (English, Hindi, Punjabi)42%32%48%

Two lessons came out of this. First, the best retriever depends on the business: hybrid search won for the school and the tax pack, while plain vector search won for care homes and visas. Measure before you choose. Second, an English-centric embedder struggles with Hindi and Punjabi, and no amount of prompt engineering fixes that. The fix is a multilingual embedder. These question sets are small (26 to 55 questions each), so treat them as smoke tests, not benchmarks.

The Visa AI Agent: let code decide, let the model write

The Visa AI Agent answers questions for "Lotus Gate", a fictional Thai visa agency, using 138 documents: 32 visa-type entries across 21 routes, plus rules, processes, fees, offices and private client case notes. Its design rule is simple: the language model never decides what to query. Small local models do not follow tool-calling instructions reliably, so plain code does four jobs:

  1. It reads the applicant's age, savings, income and purpose from the message.
  2. It runs the safety rules first. A request for a fake bank statement gets a fixed reply, and no model is called.
  3. It chooses the tools and writes the SQL itself, such as this real Visa Finder query:
SELECT * FROM lab_visa
 WHERE semantic_match(text, 'I''m 55, British, with 900k THB savings and want to retire in Chiang Mai')
   AND kind = 'visa_type'
   AND min_age <= 55
   AND min_funds_thb <= 900000
   AND array_contains(purpose, 'retire')
 LIMIT 200

On production this returned exactly three routes in about 100 ms: the 90-day Non-O for retirement, the one-year Non-O-A, and Thailand Privilege. The visa cards on screen are built from those SQL rows, not from the model's prose.

  1. It checks the answer. Every number in the model's reply must appear in a source.

That last check earned its place. With the production 3-billion-parameter model, one answer recommended the right visa but also "worked out" a monthly income of 75,000 THB by dividing the savings by 12. No source says that. Across four runs, two contained a figure that appears in no source, and the check flagged both. Given the same sources, a 30-billion-parameter model wrote a cited, correct comparison of five routes. The SQL, the cards and the guards were identical in every run. Only the writing quality changed.

Private data stays in the database

An unfiltered hybrid search for "I want to retire in Chiang Mai, I am 55" returned, at rank two, a private case note about another client. Retrieval is about relevance, not permissions. In NebulaDB the fix is a filter inside the query, AND client_id = 'LG-1042', so rows outside the signed-in user's scope never leave the database. Anonymous visitors only ever see public documents. We learned this the hard way: the agent's first rule search was plain hybrid search, and we caught that case note in a guest's evidence while writing this post. One client_id = 'public' predicate fixed it.

When the government changes the rules

Visa rules change often, and that is the strongest argument for RAG over fine-tuning. The RAG Lab's "The rules changed" panel re-ingests a simulated change to an official page, under the same document id, and asks the question again. The next answer cites the new rule, and no model is retrained. In production this becomes a scheduled crawler. It hashes each official page, upserts the changed text with its source and as_of date, and lets the agent cite the update on the next question.

Try it, then build your own

  • The Labs: showcase.nebuladb.net/#/labs. Sign in with a Google account.
  • The Visa AI Agent: showcase.nebuladb.net/#/tab/visaagent.
  • The code: github.com/bwalia/nebuladb, including the Labs under apps/showcase/src/labs/.
  • The deep dive: Building AI Agents with NebulaDB: the technical guide.

Want an agent like this over your own documents, with your own access rules, on hardware you control? Talk to us and we will start with a Lab-style pack of your data and measure retrieval before writing a single prompt.

The visa content in the demo is fictional and simplified. Rules change often, so verify with Thai Immigration or a Thai embassy. This is not legal advice.