The situation: you have a job for "AI": remember a customer, answer from your help articles, flag risky transactions, check that an answer matches the policy. The default today is to prompt an LLM for all of it. Sometimes that's right. Often a smaller, cheaper tool does the job better and gives the same answer every time.
We build SynapCores. The guidance here applies whichever stack you use. Already know your problem? Jump to the twelve guides.
Pick by the job: the decision table
| You need to… | Use | Why it fits | Watch out for |
|---|---|---|---|
| Write, summarise or explain an answer | LLM | Flexible language generation | Makes things up; output varies run to run; cost per call |
| Find content about the same topic | Vector search | Embedding similarity captures meaning, not keywords | Similar ≠ correct. A contradiction can be very similar |
| Check whether a passage supports a claim | NLI | Labels entailment / contradiction / neutral for a pair of texts | Judges only the passage given; weak on numbers, dates, scope; unrelated pairs can score as "contradiction" |
| Predict a number or category | Traditional ML | Learns from labelled history; cheap, repeatable | Needs representative labels; drifts; needs monitoring |
| Judge a piece of text: route, rate, yes/no | Decision model (d1) | A probability for each answer you describe in words; no training data; zero output tokens | Judges only the text you give it; doesn't write or check against a source |
| Enforce exact conditions | SQL / rules | Deterministic, auditable | Someone has to write the logic |
| Follow relationships (who is linked to whom) | Graph | Multi-hop paths are natural to express | Modelling effort |
Find your problem
Each guide starts from the problem and explains the technique inside it. Guides that aren't published yet are marked Coming soon.
Find things (vector search, plus SQL filters and graph)
- How to search by meaning instead of keywords
- How to find duplicate customer records, even with typos
- How to build "customers who bought this also bought" recommendationsComing soon (graph + vectors)
Write and answer (LLM, grounded in your data)
- How to ask your database questions in plain EnglishComing soon
- How to let an LLM query your database without exposing customer PII
- How to build a support chatbot that only answers from your help articles (with sources)Coming soon
- Tutorial: Build a local RAG app with citations in one database (28 lines of Python, compared with Postgres + pgvector + Ollama)
Remember (agent memory: vectors to recall, NLI to check each write)
- AI agent memory: types, architecture and how to build it (the full guide, with 15 recipes)
- How to make a chatbot remember previous conversations
- How to let several AI agents share one memoryComing soon
Choose between them
- LLM, NLI, ML or a decision model: which one should you use? (one support ticket through all four)
Check claims (NLI, with a similarity floor and exact rules)
- How to check if an AI answer is actually backed by your documents
- How to check if two sentences mean the same thing (or contradict each other)Coming soon
- How to automatically check sales and support calls for complianceComing soon
Predict and flag (traditional ML in the database)
- How to find unusual transactions in your data with SQL (plus a graph hop for rings)
- How to predict which customers will cancel, using SQLComing soon
New to the category? What Is an AI-Native Database? explains why these can run in one engine.
Four questions to ask
- Is the output free text? Then an LLM is probably in the loop. Decide what checks its output.
- Is the output a fixed label or a number, and do you have labelled history? Train a classifier or regressor. It will be cheaper and more consistent than prompting an LLM.
- Do you need to find things, or to judge things? Finding is retrieval (vectors, keywords, SQL filters). Judging whether a claim holds against a source is NLI, an LLM judge or a human.
- Can it be written as a rule? "Refund amount ≤ order total" is SQL, not AI. Use AI for what you can't write as a rule.
How they fit together
question
│
▼
SQL filters + access control ── tenant, product, date, permissions
│
▼
retrieval ── vector similarity (+ keyword, + graph) "what's on topic?"
│
▼
LLM ── drafts an answer from the retrieved passages "write it"
│
▼
NLI ── each sentence vs its on-topic passages "is it supported?"
│
▼
SQL / rules ── exact checks on numbers, dates, limits "is it allowed?"
│
▼
ship / review / block, logged
A classifier usually sits beside this pipeline rather than in it: scoring churn risk, routing tickets, or flagging anomalous transactions that a person or an agent then explains.
Same text, four different signals
Here's what the techniques actually return on the same pairs of sentences. The numbers come from our recipes, run on SynapCores 2.3.1 and re-run on 2.3.2-ce (same values), with the default 384-dim embedding model and the nli-default NLI model (DeBERTa-v3-small).
| Evidence passage | Claim | Similarity | NLI says | Reality |
|---|---|---|---|---|
| "Annual plans can be refunded in full within 30 days of purchase." | "You can get a full refund on an annual plan within 30 days of buying it." | 0.903 | entailment 0.998 | Supported ✔ |
| "After 30 days, annual plans are refunded pro rata for the unused full months." | "After that, annual plans cannot be refunded at all." | 0.561 | contradiction 0.999 | Contradicted ✔ |
| "Refunds are issued to the original payment method within 5 to 10 business days." | "Refunds arrive within 24 hours." | 0.779 | entailment 0.930 | Wrong claim; NLI missed it ✘ |
| "The customer's office is in Denver." | "The customer is learning to play the cello." | 0.235 | contradiction 0.997 | Unrelated; NLI false alarm ✘ |
Sources: rows 1–3 from recipe 037 (Step 3), row 4 from recipe 036 (Step 3), both observed on 2.3.1 and re-run on 2.3.2-ce with the same values.
What this shows:
- Similarity tells you topic, not truth. The contradiction in row 2 still scores 0.561. The wrong timeline in row 3 scores 0.779, higher than the contradiction.
- NLI tells you support, within limits. It nails rows 1 and 2. It misses the number mismatch in row 3, and it calls two unrelated sentences a contradiction in row 4.
- They fix each other's weak spots, partly. A similarity floor removes row 4 before NLI sees it. Row 3 needs neither: it needs an exact comparison of the numbers, in SQL or code.
How to Check If an AI Answer Is Actually Backed by Your Documents walks through these failures in detail.