Deep dive 17 of 27: Semantic Storage (Vector DB like Pinecone, Weaviate, or Chroma)
Nov 19, 2026 · Michael Chang · Status in NurseOps Now: ✅ built (Chroma (the database that stores the policy vectors))
Show definitions in ( ) · hover a highlighted word for its meaning, click it for details · open with ?defs=1 to show definitions
Part of: Remembering the right things: state management in NurseOps Now, section Implementing Long-Term Memory: External Persistence Architecture (7.3) · All 27 solutions · ← Structured Storage (SQL/Postgres) · Session Caching (Redis/Key-Value) →
Read in this order
- In plain words: what it is, without jargon
- The problem it solves: the problem, and the standard approach in my words
- How to implement it (ServiceApps): scenario, steps, code and real output
- In NurseOps Now: built or not, and where
- Trade-offs and Interview answer
In plain words
Semantic storage (a vector database that finds text by meaning) is a vector (text turned into a list of numbers so similar meanings sit close together) database: it stores text as embeddings (text turned into numbers so similar meanings sit close together) and finds items by meaning. It's the right place for knowledge where an approximate match is fine, like help articles, notes and documentation.
In plain terms: asking "something about my slow notebook" and getting the article titled "Computer running slow".
The problem it solves
Summarization solves volume, not time (a summary shrinks memory but doesn't survive a crash or restart): knowledge must live (using the real Claude API (costs money), not a fake stand-in) outside the window, and people never phrase questions like the article titles.
The standard approach (in my words): store unstructured (an open-source library that reads PDFs and Word files into headings, lists and tables) knowledge (PDFs (a fixed-layout document file), email threads (one saved conversation, here one per user and case), meeting notes, documentation) in a vector (text turned into a list of numbers so similar meanings sit close together) database and retrieve by semantic relevance.
How to implement it (ServiceApps)
Illustrative example: no ServiceApps (a company platform for IT tickets, HR requests and help-center articles) instance is connected, so the scenario and data are made up. The code is a self-contained sketch; it was run on that made-up data on Nov 19, 2026, and the output below is from that run.
The setting. ServiceApps (a company platform for IT tickets, HR requests and help-center articles) Assist, an AI helper inside a company's ServiceApps (a company platform for IT tickets, HR requests and help-center articles) portal. Employees ask it IT and HR questions; it answers from knowledge-base (KB (knowledge base: a library of help articles)) articles, looks up the employee's own tickets (incidents (a ServiceApps ticket for something broken) like INC0012345) and requests, and keeps one conversation per employee and ticket.
The scenario. An employee types "my notebook is sluggish". The KB article (one help-center article in a knowledge base, with a number like KB0010234) is called "Computer running slow". Some articles are only for executives.
Steps.
- Chunk (a small piece of a document; here, one policy rule) documents and embed each chunk (a small piece of a document; here, one policy rule).
- Store each vector (text turned into a list of numbers so similar meanings sit close together) with metadata (labels stored with each chunk: policy, CPT, version, section, page): KB (knowledge base: a library of help articles), category, who can read it.
- Search with metadata (labels stored with each chunk: policy, CPT, version, section, page) filters (KB (knowledge base: a library of help articles), permissions) first, then rank by similarity.
- Return the top chunks (small pieces of a document; here, one policy rule each) with their IDs for citation (a pointer to the exact page and quote that supports a claim).
The code (Python):
import math, re
from collections import Counter
SYN = {"laptop": "computer", "notebook": "computer", "pc": "computer", "wifi": "network", "wireless": "network",
"sluggish": "slow"}
def embed(t): # stand-in for a real embedding model (synonyms ~ meaning)
return Counter(SYN.get(w, w) for w in re.findall(r"[a-z0-9]+", t.lower()))
def cos(a, b):
d = sum(a[w] * b[w] for w in a)
n = math.sqrt(sum(v * v for v in a.values())) * math.sqrt(sum(v * v for v in b.values()))
return d / n if n else 0.0
docs = [{"id": "KB0040001", "text": "Computer running slow: close browser tabs and restart", "kb": "IT", "can_read": "all"},
{"id": "KB0040002", "text": "Wireless network drops in meeting rooms", "kb": "IT", "can_read": "all"},
{"id": "KB0090007", "text": "Executive laptop refresh schedule", "kb": "IT", "can_read": "executives"},
{"id": "KB0020311", "text": "Remote work policy: working abroad", "kb": "HR", "can_read": "all"}]
index = [(embed(d["text"]), d) for d in docs]
def search(q, kb=None, groups=("all",), k=2):
qv = embed(q)
hits = [(cos(qv, v), d) for v, d in index if (kb is None or d["kb"] == kb) and d["can_read"] in groups]
return [(s, d) for s, d in sorted(hits, key=lambda h: -h[0])[:k] if s > 0]
for s, d in search("my notebook is sluggish", kb="IT"):
print(f"{s:.2f} {d['id']} {d['text']}")
print("as an executive :", [d["id"] for _, d in search("laptop refresh", groups=("all", "executives"))])
print("as everyone else:", [d["id"] for _, d in search("laptop refresh")])
Output (from running the code above):
0.35 KB0040001 Computer running slow: close browser tabs and restart as an executive : ['KB0090007', 'KB0040001'] as everyone else: ['KB0040001']
What to watch for.
- Apply permission filters inside the search, never after showing results.
- Store chunk (a small piece of a document; here, one policy rule) IDs and section titles so answers can cite them.
- Re-index (rebuild the searchable store after documents change) when an article changes; delete chunks (small pieces of a document; here, one policy rule each) of retired (taken out of use; a retired article no longer shows to readers) articles.
In plain terms: a search that understands what you mean, but only looks on the shelves you're allowed to see.
In NurseOps Now
Built on Chroma (the database that stores the policy vectors) (pgvector planned for production): policy (the health plan's written rules for when a test is covered) chunks (small pieces of a document; here, one policy rule each) with metadata (labels stored with each chunk: policy, CPT, version, section, page) (CPT (a standard code for a medical procedure), version, section, page), searched only within the case's policy (the health plan's written rules for when a test is covered), plus a separate collection (a named group of stored chunks inside Chroma, like a table) for the user guide. See the ingestion deep dive.
Trade-offs
- Great recall for fuzzy questions, but similar isn't the same as correct; keep exact facts in SQL.
- Hosted vector (text turned into a list of numbers so similar meanings sit close together) databases (Pinecone, Weaviate) scale further; local ones (Chroma (the database that stores the policy vectors)) are simpler.
Interview answer
"Documentation and notes go in a vector (text turned into a list of numbers so similar meanings sit close together) database with metadata (labels stored with each chunk: policy, CPT, version, section, page) such as KB (knowledge base: a library of help articles), category and read permissions. Search filters on permissions first, then ranks by meaning, and returns chunk (a small piece of a document; here, one policy rule) IDs so every answer can cite its article."
All data in this post is made up. No real people, tickets or patient data.
← Back to all 27 solutions in the state management blog
Key terms
Every highlighted word in this post links here. Click ↩ Back to return to the spot you came from.
- Chroma
- The database that stores the policy vectors.Used in: In NurseOps Now, Trade-offs↩ Back to where you were
- chunk
- A small piece of a document; here, one policy rule.Used in: How to implement it (ServiceApps), Interview answer↩ Back to where you were
- chunks
- Small pieces of a document; here, one policy rule each.Used in: How to implement it (ServiceApps), In NurseOps Now↩ Back to where you were
- citation
- A pointer to the exact page and quote that supports a claim.Used in: How to implement it (ServiceApps)↩ Back to where you were
- collection
- A named group of stored chunks inside Chroma, like a table.Used in: In NurseOps Now↩ Back to where you were
- CPT
- A standard code for a medical procedure.Used in: In NurseOps Now↩ Back to where you were
- embeddings
- Text turned into numbers so similar meanings sit close together.Used in: In plain words↩ Back to where you were
- incident
- A ServiceApps ticket for something broken.Used in: How to implement it (ServiceApps)↩ Back to where you were
- KB
- Knowledge base: a library of help articles.Used in: How to implement it (ServiceApps), Interview answer↩ Back to where you were
- KB article
- One help-center article in a knowledge base, with a number like KB0010234.Used in: How to implement it (ServiceApps)↩ Back to where you were
- live
- Using the real Claude API (costs money), not a fake stand-in.Used in: The problem it solves↩ Back to where you were
- metadata
- Labels stored with each chunk: policy, CPT, version, section, page.Used in: How to implement it (ServiceApps), In NurseOps Now, Interview answer↩ Back to where you were
- A fixed-layout document file.Used in: The problem it solves↩ Back to where you were
- policy
- The health plan's written rules for when a test is covered.Used in: In NurseOps Now↩ Back to where you were
- re-index
- Rebuild the searchable store after documents change.Used in: How to implement it (ServiceApps)↩ Back to where you were
- retired
- Taken out of use; a retired article no longer shows to readers.Used in: How to implement it (ServiceApps)↩ Back to where you were
- semantic storage
- A vector database that finds text by meaning.Used in: In plain words↩ Back to where you were
- ServiceApps
- A company platform for IT tickets, HR requests and help-center articles.Used in: How to implement it (ServiceApps)↩ Back to where you were
- summarization solves volume, not time
- A summary shrinks memory but doesn't survive a crash or restart.Used in: The problem it solves↩ Back to where you were
- thread
- One saved conversation, here one per user and case.Used in: The problem it solves↩ Back to where you were
- Unstructured
- An open-source library that reads PDFs and Word files into headings, lists and tables.Used in: The problem it solves↩ Back to where you were
- vector
- Text turned into a list of numbers so similar meanings sit close together.Used in: In plain words, The problem it solves, How to implement it (ServiceApps), Trade-offs, Interview answer↩ Back to where you were