Search
Find relevant memories using adaptive dense and sparse retrieval, entity and graph evidence, temporal truth, facet coverage, and calibrated ranking metadata.
Smaller responses and score padding
Results with an exact-zero score and no supporting evidence are not used to pad the result list, while low nonzero scores and supported structural matches are kept. For smaller search responses, opt into include_proof_context: false alongside view: "compact": the signed proof token is omitted, required evidence/safety fields remain, and a later proof-bound decision cannot use that omitted token. Linked outcome metadata adds recent counts, latest status and a descriptive reversal warning; mixed history is not labeled all-failed. If your installed SDK has no helper for one of these options yet, send it over HTTP. Scores remain ranking signals, not truth or applicability guarantees.
How Search Works
Hebbrix uses multiple independent signals to find the most relevant memories:
- Vector Search: semantic similarity using embeddings. Understands meaning, not just keywords.
- BM25 Keyword: classic keyword matching for exact terms and names.
- Graph Traversal: finds related memories through entity relationships.
- Temporal & Calibrated Ranking: distinguishes current from superseded facts, preserves multi-intent facet coverage, and exposes whether scores are calibrated or relative.
Grounding and ranking
soft is the default: the bounded ranked candidate pool is preserved, including when verification supports only a narrower subset. Unverified candidates carry low_confidence and abstention warnings instead of being erased.strict requires supported claim evidence. off skips claim filtering, but never tenant, deletion or supersession checks. An unparsed query is retrieval-only evidence, not a verified answer. Inspect grounding,low_confidence and abstain_recommended.
Candidate retrieval and answer evidence are different. A matching allergy does not justify dropping a separate intolerance, and a person's own name does not answer a relative's name question. Inspect facet receipts where present; missing verification is not proof that a relevant constraint is absent. Search results do not certify food or medical safety.
Quality mode is the default
Omitting fast runs quality mode: a relevance model scores the candidates, so a score is an absolute relevance and "nothing relevant" is clearly separated from a real answer (no_match). Use it when you need a reliable signal that nothing stored answers a question, or when you filter on low_confidence. fast: true skips that model and returns relative fusion scores in a few hundred milliseconds; use it for low-latency retrieval of context. Fast mode never runs the relevance judge: for a question, rows claim grounding could not certify come back with low_confidence: true as unjudged context, not rejected rows, so filter on low_confidence only in quality mode; and rules that do not govern a request can be returned unflagged: to check which stored rules govern an action before taking it, send fast: false.
When claim grounding cannot verify any candidate, search decides which of them state what a question about personal memory asks: a question about the user or the people in their life ("my", "I", "the user"). Both modes first apply checks that need no language model: a question asking when, how long or how often needs a memory that states a time, a person the question excludes ("other than Mia") is not its subject, and when no candidate reaches a 1% calibrated probability of relevance, no_match is true.
- Fast mode never calls a language model to decide relevance. It also rules out a memory that only states a fact about one of the user's people for a question about the user ("The user's mother drives a Kia" does not answer "What car do I drive?"). The remaining rows are returned, flagged as candidates (
low_confidence) when claim grounding could not certify them. Rows the calibrated relevance score used forno_matchfinds relevant come first, each group keeping its ranked order (so what outcome learning moved up stays up), then the user's own fact before a relative's on the same topic and a memory naming the asked identifier before its siblings. - Quality mode then runs one bounded relevance check over the top candidates. Rows that state what the question asks are returned in their ranked order and are not flagged; rows it finds not relevant are left out (pass
include_low_confidence: trueto keep them, flagged). With that flag a row is never dropped silently: one the structural checks rule out (another person's fact, a record of another occasion or kind) also comes back flagged, withlow_confidence_reason: "ruled_out_by_structure", after the rows that may answer, and so does a rule a request's check found to be about another entity (scoped_to_another_entity, with the same reason in every mode). An instruction to carry out an action ("Ship order 90 to Oslo with UPS.", "Refund the customer $300.") and a message describing an action about to be taken, by you or anyone else ("I'm about to issue a refund ... what rules apply?", "The social media team is about to publish a blog post"), in progress, or as a status note ("Processing a refund of $300.00 ...") are read as a request for the rules that govern the action, never as a question with no answer. A rule for a group of people or a kind of case shapes a request it may cover even when the records cannot establish the condition. Withinclude_low_confidence, every row the default view leaves out comes back flagged with the reason (no_relevance_signalfor a row with no retrieval signal), so an unflagged row is always one the default view returns. A rule stated for a broader entity that includes the one named (the country of a named city, the department of a named team) governs it. A statement ("I play the viola.") is read as a question about what it states, so it returns the memories that state it or a value it updates. When nothing is relevant,no_matchis true. When the relevance model rates a row at 90% or more and the check finds nothing, the check is asked once more andno_matchneeds both answers to agree. The check starts while the rest of the search runs, is bounded in time, and its verdict is cached for identical searches; if it is late or unavailable, the rows are returned flagged. Quality mode therefore returnsno_matchmore often than fast mode for a question nothing stored answers.
Requests addressed to the assistant ("Book me a table for Friday", "Suggest a dinner") and recommendation questions ("Where can I find decent pho near me?", "Any good cycling routes nearby?") are retrieval in both modes: their rows, such as a diet, an allergy, a budget or where the user lives, are returned as context, and they never return no_match. Only rows about a different customer or person than the one the request names are left out. In quality mode the rows that bear on the request come first. A request with several parts is read as one request, not split into separate questions, so none of its restrictions is lost. Questions and requests about other knowledge (documents, policies, runbooks) keep the calibrated relevance model and claim grounding in both modes.
A single lookup question that names an exact record is answered only by a memory that names it, in both modes: when no stored memory names the identifier, no_match is true, and a memory about a sibling record ("ticket SVC-62171") does not answer "What's the status of ticket SVC-61052?". Exact records are identifiers of shapes only systems use: email addresses, dotted host and file names (api.example.io, config.yaml), snake_case names, paths (acme/payments-api), kebab-case names of three or more parts (billing-worker-prod), and a value an identifier label introduces ("ticket SVC-61052", "order 4471", "account no. 88213"). Unlabelled codes ("TNL-409", often an error condition a general fix answers), short mixed tokens ("F1", "PS5", "COVID-19") and two-part names keep their rows, with exact matches ranked first. So do questions asking what to do ("How do I restart billing-worker-prod?", "Which fix should I use ...?"), compound questions and requests.
- When no stored memory states what the question asks but memories about the same person, thing or topic exist, the closest of them (up to 3) are returned instead of nothing, each with
low_confidence: trueandlow_confidence_reason: "closest_match_not_an_answer", andconfidence_reason: "closest_match_not_an_answer", besideno_match: trueandabstain_recommended: true: nothing answers, and these are what is closest. For "Am I vegan?" that is "The user's wife Priya is vegan.", and for "Where does my brother live?" the sister's city: context for the answer, not the answer. Filter onlow_confidenceto keep only answers. A memory that lacks the kind of detail a question asks for (a time for "when", "how long" or "how often", a name for "what is ... called") or that is about another record ("ticket 4411" for ticket 4410) is never offered this way: such a question still returnsno_match. A question asked with a general word is answered by a memory naming a specific kind of it: "What's the name of our family pet?" returns "The user's parrot is called Kiwi." as an answer, and a memory the answer follows from in one step answers too: "Do I like seafood?" returns "The user is vegetarian." no_match: truewith no results (confidence_reason: "no_relevant_memory") means no stored memory states what the question asks and none is about it. A person the question excludes ("other than Mia") is never returned. Answer "I don't know" or ask the user. A request never returnsno_matchbecause of a restriction or preference that bears on it: a stored diet or allergy is returned for a food request.abstain_recommended: truewith results means no returned memory was verified to answer; use them as context, not as a confirmed answer.
For single-intent queries with soft or off grounding, results are ordered by displayed score. With fast omitted, soft and off request relevance-model ranking; this adds latency and returns an availability error if its required retrieval dependencies fail. Explicit fast: true opts into the lower-latency relative-ranking policy. Compound queries preserve a complementary evidence set, which need not be globally score-sorted. Low-latency fusion scores can repeat across queries; they are not probabilities. Use fast: false for optional relevance-model ranking of narrow queries. Neither a high relevance score nor a citation proves an answer correct.
Use collection_id and user_id consistently on reads and writes.X-Hebbrix-Require-Collection: true rejects accidental account-wide calls. Outcome recall is opt-in, separately labeled caller-reported, and grants no authority to act.
Non-debug responses omit duplicated plaintext proof manifests and repeated claim text. Signed proof tokens and safety fields are unchanged. include_metadata: falseremoves per-result metadata; it does not remove the top-level evidence and scope contract. Use debug: true when expanded diagnostic detail is needed.
Confidence flags, entities, profile and memory types
- In the default soft grounding,
low_confidenceandabstain_recommendedare set only for genuinely weak or unverified matches; a verified strong match is not flagged.grounding.statusis"not_applicable"when the query makes no claim to verify. - Each result lists the proper names and record identifiers it is about in
applies_to(what it requires, such asEXP-7in "need customs form EXP-7" orcustoms_form='EXP-7', is invaluesinstead, andvalue_conflictsnames any different value of that kind the query gives), andentity_matchcompares them with the entities in the query (returned asquery_entities):match,partial,mismatch,unscoped(the memory names no entity of the query's kind, as a general rule does) ornot_applicable(the query names no entity). Entities include the identifiers systems use: email addresses, host names, service, database and repository names (orders-db,billing_service,acme/payments-api), ticket IDs (OPS-33856) and account or order numbers after their label. A memory naming the same identifier is amatch, and one naming only a different identifier of that kind is amismatch, not the same entity. Like is compared with like: an identifier only conflicts with a queried identifier, a name with a queried name, and a place ("17:00 New York time") only when the query names a place. A place another place qualifies, written out or as a postal code ("Paris, Texas", "Paris, TX 75460", "Dublin, OH, USA", "London, ON"), is not read as the European city; a code for the city's own country keeps it ("Berlin, DE"), and an unknown qualifier that ends the place ("Paris, Somewhere") places it nowhere. Tools, channels and agents such as Slack or OpsAgent are not entities. For a task or request, rows scoped to another entity are left out unlessinclude_low_confidenceis set, which returns them flagged. For a question, by default mismatches move after the other rows of the returned page (scores unchanged), so a rule about someone else is still returned for multi-hop answers;prefer_entity_match: truereorders the whole candidate list andfalsekeeps pure relevance order. - Each result says whose fact it is in
subject:userfor the person the memories belong to, a relation such assisterorneighbourfor someone they mention, or null. For first-person questions ("What am I allergic to?", "What city do I live in, not my sister?") the user's own rows come before other people's rows on the same topic, and a row about someone else ("The user's neighbor owns a cat") is never certified as the user's answer. Typographic apostrophes and quotes ("the user’s sister", "don’t") are read the same as ASCII ones wherever subjects, entities and forget requests are parsed; stored and returned content keeps the characters it was written with. - Memories written without extraction (raw, batch, fast ingest) get a
memory_typewhen it is clear from the text ("To reset the router, unplug it ..." is aprocedure; a dated sentence in the past tense is anevent), and events getevent_datefrom the date they state ("2026-03-09", "March 9, 2026", "9 March 2026"). For requests such as "recommend a restaurant", standing facts and preferences rank above events older than 30 days across all candidates. include_profile: truereturns the end user's standing profile facts and preferences in a separateprofilefield, scoped like chat's profile. It never changes the ranking.profile.scopenames thecollection_id,end_user_idandagent_idit was read for, andprofile.projectionsays whether recent writes of that scope are reflected yet:statuspending(a fact may still appear or change;pending_writescounts the unfinished writes,capped: truewhen there are at least that many),ready, orfailed(nothing is pending andfailed_writeswrites will not be reflected unless their batch is retried;failure.reasonsays why). Poll again afterretry_after_seconds.profile.status: "ok"means only that the read succeeded, andunavailableis not the same as an empty profile. A fact learned under anagent_idbelongs to that agent: a search with anagent_idsees facts learned without an agent plus that agent's own, never another agent's, and a search with no agent sees user-level facts only (see agent scope).memory_types(for example["rule", "procedure"]) returns only memories of those types; it is the same filter asfilters.memory_type, and sending both with different values returns 422.view: "compact"returns slimmer rows anddebug: trueadds the ranking diagnostics back. Both SDKs use compact by default; passview: "full"for full rows.
What a response can establish, and what it never can
Five questions are easy to blur. A memory response answers the first two, reports the third, and never answers the last two:
| Question | Who answers it | Where it appears |
|---|---|---|
| Answerability: do the stored memories state an answer to this question? | Hebbrix | answer_status, abstain_recommended, confidence_reason, and each row's low_confidence |
| Readiness: does that answer cover everything accepted for the scope, or only what is indexed so far? | Hebbrix | answer_finality (final, provisional, none), indexing.status, indexing.answer_risk, and the batch receipt |
| Recorded approval: does a stored memory say that someone approved something? | Hebbrix reports what the memory says | The memory's text, as evidence of what was recorded. A question about your own permission over such a record is authorization_not_verifiable. |
| Verified authority: does the person asking actually hold that approval or role now? | Your identity, approval or permission system | Never in a memory response. A stored note, a claim in the question, or a recorded approval is not verification. |
| Execution permission: may this action run? | Your application's permission check or tool dispatcher | Never in a memory response. Nothing Hebbrix returns grants permission to act. |
answer_finality is final when an answerable response covers the whole scope, provisional when it is answerable only from what is indexed so far (or readiness was not reported), and none when there is no answer to act on. So an answerable response with answer_finality: "final" means the memories fully answer the question as asked; it does not mean the action they describe is allowed. When a question asks whether the asker may act, /v1/search keeps the rule or record rows as evidence, sets confidence_reason: "authorization_not_verifiable" and recommends abstention; /v1/search/reason states what memory records and that it cannot verify the asker's authority, and never answers "yes", "you may" or "you are permitted"; the SDK helpers return action: "verify_authorization"; and the MCP answer gate declines (hebbrix_confidence reports authorization_granted: false). An informational question about the record ("What approval was recorded for change B18?") is answered from it like any other fact. The decision to act stays with your permission system: check authority there, then dispatch. Whose memories a request reads is also your application's decision; see binding the end user's scope.
When to answer: abstention and confidence
abstain_recommended is advice about the question as asked, not a block on the rows. When it is true, the response does not establish an answer, so do not state one from these rows. The rows are still returned, ranked, and each says what it is: low_confidence: false is evidence of what the row states, low_confidence: true is a retrieval candidate (the row's low_confidence_reason says why; it is returned on every flagged row), and only revision_status: "current" answers a question about the present. A page can mix evidence and candidates. Read answer_status first, then confidence_reason, then each row's low_confidence and revision_status; grounding.fallback_reason and grounding.authorization give the detail behind soft_claim_candidate and authorization_not_verifiable, and both are kept in the compact view. Make the decision in your own code before your model runs: a model given the flag as text can answer anyway.
| Situation | What the response shows | What to do |
|---|---|---|
| Answerable | answer_status: "answerable", abstain_recommended: false, indexing.answer_risk: "none" | Answer from the rows with low_confidence: false and revision_status: "current". |
| A count, total, list or first/last while the scope is still indexing | answer_status: "indexing", abstain_recommended: true, indexing.answer_risk: "incomplete_set" | Do not answer: read from part of the scope, such an answer is wrong by construction. Ask again when indexing.status is ready. |
| A one-record question while indexing, answered | answer_status: "answerable", abstain_recommended: false, indexing.answer_risk: "may_change" | Answer; a memory still being indexed may correct or complete it. For a costly decision, or one that needs the whole history, wait for ready first. |
| A one-record question while indexing, abstention | indexing.answer_risk: "may_change", abstain_recommended: true | Do not answer. When answer_status is indexing, ask again later; otherwise act on its reason as in the rows below. |
| Related rows, none establishes the answer | answer_status: "unverified", confidence_reason: "soft_claim_candidate"; grounding.fallback_reason says why | Do not state an answer from them. Show them as context, labelled as such, ask a narrower question, or ask the user. |
| A permission the store cannot confirm: the question asks whether the asker may do something ("can / may / could I ...", "am I allowed / permitted / authorized ..."), and the evidence is a rule that restricts the act to a group no returned memory places the user in ("only members of the finance team may ..."), a rule that requires an approval, sign-off or review, or a memory that records an approval was given ("a release manager approved the deployment") | answer_status: "unverified", confidence_reason: "authorization_not_verifiable"; the rule or record rows are evidence | State the rule or the record as what memory says, then check the asker's authority in your own identity, approval or permission system before acting. A role or approval claimed in the question or in a stored note is not verified authority. Never grant from memory. |
| Contradicting memories | answer_status: "conflicting", confidence_reason: "conflicting_evidence", rows with revision_status: "conflicting" | Do not choose. Show both with their stated_at and ask the user which holds. |
| Only a replaced value | answer_status: "superseded" | Say the old value no longer holds; do not answer with it. |
| Nothing relevant stored | answer_status: "no_relevant_memory", no rows | Say you do not know. |
Only indexing outcomes and the service failures calibration_unavailable and claim_verification_unavailable (nothing was certified, which is not evidence of absence) are worth asking again. The others are answers: the same question returns the same one while the memories are unchanged. Even with evidence, memory never authorizes an action; your tool boundary checks permissions, approvals and limits itself.
The SDKs apply this rule for you. should_answer (Python) and shouldAnswer (TypeScript) take a search_with_proof() / searchWithProof() or reason() response (plain search() returns only the rows) and return one action per outcome, so your code can tell the cases apart without parsing reasons:
| Situation | answer_status | reason | action | Rows |
|---|---|---|---|---|
| Answerable | answerable | answerable | answer | memories: the evidence rows |
| Nothing relevant stored | no_relevant_memory | no_relevant_memory | say_unknown | none |
| Related rows, none establishes the answer | unverified | unverified | abstain | context |
A rule that speaks to the asked case, not verified to decide it (a row with evidence_role: "applicable_rule") | unverified | applicable_rule | use_as_context | context: the rules first, then the other rows |
| Permission the store cannot confirm | unverified | authorization_not_verifiable | verify_authorization | context: the rule rows |
| Contradicting memories | conflicting | conflicting | ask_user | context |
| Still indexing | indexing | indexing | retry | context |
| Only a replaced value | superseded | superseded | say_no_longer_current | context |
Reason suggestion or plan (grounding.answerability: "context_only") | any | context_only | use_as_context | context: the memories that should shape it |
require_ready set and the index is not ready, or answer_risk is not none | any | index_not_ready | retry | context |
Two options change the decision. require_ready=True (Python) / requireReady: true (TypeScript) is for high-stakes flows such as money, health or actions: the answer is then also held, with action retry, until indexing.status is ready and indexing.answer_risk is none, and a response that does not report its indexing is not ready. history=True is for a question about the past that your application recognises: superseded and historical rows then count as evidence when the server answered or marked the response superseded; a superseded response's abstain_recommended or decision_abstained concerns the present, so it does not bar this; it never overrides unverified, no_relevant_memory, indexing, conflicting, authorization_not_verifiable or no_match. A response marked answerable that also sets an abstention flag contradicts itself; the server never sends one, and the helpers decline it in every mode with that flag as the reason. A use_as_context result shapes a suggestion: give its memories to your model to compose the recommendation, never as an established fact or a permission to act.
Pass memories to your model; context is never something to answer from. answer_context(response, decision) / answerContext(response, decision) renders the user's standing profile (with include_profile: true) and the usable rows, each with its date, memory type, subject and support, as the context for your model.
Rule rows: evidence_role
Every row says what it is to the question. answer: verified evidence (current and not low_confidence). applicable_rule: a current rule, policy, instruction or procedure step that speaks to what a rule or decision question asks, about the asked entity or about no entity, but is not verified to decide the asked case: whether the case meets the rule's conditions is not checked. related: anything else. For "Does Lark qualify for free expedited shipping?" with the memories "Premium customers qualify for free expedited shipping" and "Lark is a premium customer", the response is unverified with the rule labelled applicable_rule: give the rule and the case's facts to your model as policy to apply, labelled as such, or ask /v1/search/reason, which applies the rule to the case and cites both; that answer is the verified one. A rule never authorizes an action: a permission question whose rule names a group the store does not tie to the asker stays authorization_not_verifiable.
Reason failures and retries
/v1/search/reason answers 200 for every decision it reaches, an abstention included. A 503 with reasoning_failed means a dependency did not answer (the evidence verifier or the model), never a verdict on the memories, and is not billed: its body carries retryable: true, retry_after_seconds and a cause, with a Retry-After header. Send the same request again after Retry-After, backing off with jitter (2 s, 4 s, 8 s), at most three attempts, then tell the user the answer is temporarily unavailable rather than that nothing is known. One transient verifier timeout is already retried inside the request. Reason works within a 30-second budget and reports reasoning_status: "timed_out" or "partial" as a 200; set your client timeout to 35-40 s. Which responses to retry, the client timeout for each request, and the fallbacks of a chatbot turn and an agent step are in timeouts, retries and fallbacks.
Questions answered from several memories
Some answers are not stated by any one memory. A count, total or list ("How many different museums or galleries did I visit in February?") is answered by every memory that states one member, and nouns joined by "or" or "and" name one set, never two questions. A computation ("What percentage of leadership positions do women hold?", "How much cashback did I earn?") needs its inputs: a part and its whole, a purchase and a rate. Search returns each such memory with low_confidence: false when the relevance check relates it to the question; pass every one of them to your model together. /v1/search/reason reads the members or inputs itself and computes the answer, and a number no memory states is admitted only when one arithmetic step over the cited values gives it.
In quality mode (fast: false) the relevance check always reads a computed question (a percentage, share, fraction or ratio, a difference, or an amount a memory states only as a rate) and returns all of its inputs as evidence, which count only together:
| Stored | /v1/search returns |
|---|---|
| The part and the whole ("20 Fennel leadership positions are held by women.", "Fennel has 100 leadership positions in total.") | Both rows with low_confidence: false, answer_status: "answerable". |
| The result itself ("Women hold 20 of Fennel's 100 leadership positions.") | That row with low_confidence: false. |
| One input only (the part, no whole) | The row, flagged: low_confidence_reason: "computation_input_missing", grounding.reason: "computation_input_missing", abstain_recommended: true, answer_status: "unverified". No answer can be computed from it. |
| Inputs about another subject (Juniper's positions, an industry figure) | No evidence: no_relevant_memory, or the rows flagged. |
grounding.relevance_judge.complete records whether the selected rows together give the whole answer. Fast mode never calls the relevance judge, so ask a computed question in quality mode, or use /v1/search/reason.
A memory about a related but different kind is not evidence: tennis does not answer a question about table tennis. no_relevant_memory means the relevance check found no retrieved memory that states what was asked (related ones may exist); unverified means related memories were found and returned but none was established as the answer. Neither proves that nothing is stored.
Dates in questions and memories
A memory's own dates decide when its event happened: "I visited The Art Cube on 2/15", said in a conversation of 3 March, is a February visit, and a conversation's date stands only for statements that give no date of their own. Numeric dates are read month first. A relative date in a memory ("last Thursday") is relative to that memory's date. A relative date in a question is relative to when it is asked, which the API is not told, so it is matched as words: when the day matters, resolve it in your application and ask with the calendar date, or limit the search with date_range_start and date_range_end on POST /v1/search/advanced (POST /v1/search takes no date filter and rejects these fields with 422).
Reason: recalled context versus a verified decision
Reason may return verbatim, independently reviewed memory quotes with citations when typed question parsing cannot establish coverage. Quotes retain full sentence boundaries, including abbreviations. Missing evidence still requires abstention.
Inspect decision_abstained and grounding metadata, not just a non-null answer. A safety or permission question can return useful quoted context whiledecision_abstained: true explicitly withholds a decision. Stored allergies, possession or project rules are not medical advice, safety clearance or authorization to act.
decision_abstained is true whenever answer is null, and abstain_reason says why in machine-readable form, for example mandatory_evidence_missing, no_retrievable_evidence, rule_does_not_cover_case, authorization_not_verifiable, decision_not_verified or no_cited_evidence. When a stored rule sets a threshold, metadata.rule_application shows how it was applied: a question about a $100 refund under a “refunds over $250 need approval” rule returns the rule with the comparison “$100 is not above $250”.
A request for a suggestion, a plan or a recommendation ("Can you suggest accessories for my photography setup?") has no stored record that answers it. When Reason finds nothing to verify for such a message and reads it as a request, it returns the memories that should shape the response as cited sources, with decision_abstained: false, grounding.answerability: "context_only" and metadata.decision: "request_context". The answer lists their excerpts and states no recommendation of its own: compose the recommendation with your model from those sources. A question, or a request that nothing on record shapes, keeps Reason's abstention.
Send view: "compact" to /v1/search/reason for a smaller response: the answer, the abstention fields, the cited sources and the safety envelope stay, and the internal decision diagnostics are left out. debug: true returns everything. The Python and TypeScript SDKs request the compact view by default.
Reason applies your rules
For a yes/no or eligibility question, a question about what a rule requires ("How quickly must a refund for Globex be processed?", "Who needs to approve an 18% discount?") and a value question ("How many ...", "How much would ... cost", "How long does ... take?"), reason applies stored rules to the asked case even when no single memory states the answer. A rule stated for a group applies to a case the records place in that group, through up to two links: from "Acme is a partner airline", "Partner airline employees are treated as Gold" and "Gold members get two free bags", it answers that an Acme employee gets two free bags. It also uses the most specific rule when several apply (electronics 15 days over orders 30 days) and compares the question's amount or date with the rule's threshold, including the exact boundary (a $250 refund is not "over $250"). Asked whether any rule restricts something, it answers no when none does and cites the closest rule (only Friday deploys are frozen).
It answers with the decision, requirement or value and cites every rule used. A number or date it states is quoted from the question or the records, or one step from stated values: a difference or a sum, the interval between two stated times, or a stated date moved by a stated duration, including business days ("20 business days after March 2"). It states no other number or date. metadata.rule_application lists each step with its exact quote and the overridden general rule. A widely known fact about a place may put a place the question names into a group a rule names ("Portugal is in the Schengen area"); it is listed in metadata.rule_application.general_knowledge, never as a fact about the person or organization asked about. A rule stated for a kind of thing ("Parcels to countries outside the EU must include customs form EXP-7.") applies to the case only when the question or a record says it is one: asked about "shipping order 5540 to London", the answer is conditional ("If shipping order 5540 is a parcel, it must include customs form EXP-7"), and asked about "parcel 5540" it is a plain yes. A place the reference table puts outside the rule's group decides no, whatever else is not stated. A case outside a restrictive rule's range is answered with what the rule requires of it: asked "Can I issue a $100 refund without asking a human?", the answer says the $250 approval rule does not apply to a $100 refund, so it requires nothing of it. The top-level decision gives the answer's shape for code to branch on: yes, no, conditional, value, no_rule_applies (the case lies outside the cited rules) or abstained (answer is null), and null for an answer that is not a rule decision; metadata.rule_application.decision holds the same value (not_applicable for no_rule_applies), and metadata.rule_application.membership lists each case and group the answer applies with its status (established, excluded or not_stated), so an agent can act on a not_stated condition without parsing the answer. Reason never authorizes you: it states what the rules require, such as a manager's approval. Instructions inside a question are ignored and its factual part is still answered.
Rate limits
Every search endpoint has a base limit on the Free plan that grows with your plan (Enterprise 50x): search, ask and similar-memory lookups 60/30 per minute base, advanced search 20, graph 15 and reason 10 (500 per minute on Enterprise), always within your account limit. See the full table in Errors & rate limits; each response reports the endpoint's own limit in X-RateLimit-Endpoint-Limit.
Endpoints
Search memories using adaptive dense, sparse, graph, temporal, facet, and optional outcome or feedback signals. Inspect calibration and degraded-mode fields before treating a score as an absolute probability.
Request body
| Field | Type | Description |
|---|---|---|
queryrequired | string | The search query |
collection_id | string | Filter to specific collection |
user_id | string | End-user isolation within your account and collection; use the same value on writes and reads |
grounding | string | soft (default), strict, or off; controls evidence filtering, not authorization or lifecycle filtering |
include_metadata | boolean | False omits optional per-result metadata; top-level safety and scope fields remain |
include_outcomes | boolean | Opt in to separate caller-reported outcome_evidence. Requires collection_id; run_id is unsupported for legacy decisions |
outcome_limit | integer | Outcome evidence limit, default 5, range 1–20; bounded to 200 recent scoped decisions |
limit | integer | Max results (default 10, max 100) |
search_type | string | hybrid | vector | bm25 | graph |
filters | object | Additional filters |
facets | string[] | Independent atomic subqueries for multi-intent coverage (max 64) |
temporal_mode | string | Control current-state versus historical retrieval |
min_score | number | Absolute floor on each returned score. Uncalibrated scores are ranking signals, not probabilities; the same floor need not mean the same quality across policies |
fast | boolean | true selects relative low-latency ranking and decides relevance without a language model (its low_confidence rows are unjudged context); false requests quality mode (relevance judge, no_match). Omitted requests quality mode for soft and off grounding. |
include_explanations | boolean | Include why each result matched |
Response
| Field | Type | Description |
|---|---|---|
query | string | Original query |
results | SearchResult[] | Matching memories with scores |
total | integer | Total matching memories |
search_type | string | Search method used |
processing_time_ms | number | Search latency in ms |
scores_calibrated | boolean | Whether all returned rows carry a relevance-model score; individual rows expose score_calibrated. Relevance is not answer correctness |
query_confidence | number | null | Query-level evidence signal, not a guarantee of truth |
ranking_fallback_applied | boolean | Whether ranking used a declared fallback path |
facet_evidence | array | Evidence coverage receipts for individual facets |
outcome_evidence | object | null | Opt-in scoped decisions with caller-reported outcomes; never verified facts or permission to execute |
Example
{
"query": "What programming language does the user prefer?",
"collection_id": "YOUR_COLLECTION_ID",
"user_id": "user-123",
"limit": 5
}{
"query": "What programming language does the user prefer?",
"results": [
{
"memory_id": "mem_abc123",
"content": "User prefers Python for development",
"score": 0.92,
"rank": 1
}
],
"total": 1,
"search_type": "hybrid",
"processing_time_ms": 438
}Advanced search with date ranges, importance boosting, and entity filters.
Request body
| Field | Type | Description |
|---|---|---|
queryrequired | string | The search query |
min_score | number | Minimum relevance score (0-1) |
boost_recent | boolean | Boost newer memories |
boost_important | boolean | Boost high-importance memories |
date_range_start | datetime | Filter memories after this date |
date_range_end | datetime | Filter memories before this date |
entity_filter | string[] | Filter by entities mentioned |
Find memories similar to a specific memory using vector similarity. The {memory_id} must be a valid UUID: malformed IDs return HTTP 422, unknown IDs return HTTP 404. Accepts optional ?limit= (default 10, max 100). Returns the same SearchResponse shape as POST /v1/search.
Response
| Field | Type | Description |
|---|---|---|
query | string | Echo of the request, e.g. "Similar to {memory_id}" |
results | SearchResult[] | Similar memories ordered by similarity (source memory is excluded) |
total | integer | Number of similar results returned |
search_type | string | "vector" |
processing_time_ms | number | Search latency in ms |
Search the knowledge graph for entities and their relationships. Pass the search term in `entity` (preferred) or the legacy `query` field; both work. Can also be passed as ?query= URL parameter.
Request body
| Field | Type | Description |
|---|---|---|
entity | string | Entity name or relationship to search for. Preferred field name. |
query | string | Legacy alias of `entity`, still accepted. Can also come from ?query= URL param. |
collection_id | string | Filter to specific collection |
depth | integer | Subgraph depth (default 2, max 5) |
Response
| Field | Type | Description |
|---|---|---|
query | string | The resolved search term |
nodes | array | Graph nodes in the subgraph |
edges | array | Relationships between nodes |
center_entity | string | Most relevant entity found |
entities_found | integer | Total entities matching query |
processing_time_ms | number | Query latency in ms |
Answer a question using relevant memories and an LLM. Retrieves memories, builds context, and generates an answer with source citations. The `billing` receipt reports the operation credits charged and the provider tokens of every model stage. `query` must be non-empty (whitespace-only queries are rejected with HTTP 422 before any LLM billing occurs).
Request body
| Field | Type | Description |
|---|---|---|
queryrequired | string | The question or prompt to answer. Must be non-empty and non-whitespace; empty queries return HTTP 422. |
collection_id | string | Filter memories to specific collection |
provider | string | "openai" (default) or "anthropic" |
include_steps | boolean | Include reasoning steps in response |
Response
| Field | Type | Description |
|---|---|---|
answer | string|null | Evidence-backed answer or cited recalled context; null when no supported answer or context is available |
decision_abstained | boolean | True when no decision is verified, including when answer contains useful quoted context. Never interpret a non-null answer as authorization. |
sources | array | Memory sources used to generate the answer |
metadata | object | Additional metadata about the reasoning |
billing | object | Usage receipt; every field is described under Billing response fields on the Billing page |
billing.model_used | string | LLM model used |
billing.operation_credits_charged | integer | Operation credits charged for this request |
billing.actual_tokens | integer | Provider tokens of every model stage, the sum over billing.stages |
billing.billed_tokens | integer | Legacy token-quota count of those tokens; informational under operation-credit billing |
billing.estimated_cost_usd | number | The legacy token quota's list price for billed_tokens; informational, not a charge |
Example
{
"query": "What programming language does the user prefer?",
"collection_id": "YOUR_COLLECTION_ID",
"user_id": "user-123",
"include_steps": true
}{
"answer": "The user prefers Python for development. [1]",
"sources": [
{
"memory_id": "mem_abc123",
"content": "User prefers Python for development",
"score": 0.95
}
],
"metadata": {},
"billing": {
"model_used": "gpt-5-nano",
"billed_tokens": 1250,
"estimated_cost_usd": 0.003
}
}Code Examples
Basic Search
import os
import requests
BASE = "https://api.hebbrix.com/v1"
H = {"Authorization": f"Bearer {os.environ['HEBBRIX_API_KEY']}",
"X-Hebbrix-Require-Collection": "true"}
# Adaptive hybrid search with explicit confidence and coverage metadata
r = requests.post(
f"{BASE}/search",
headers=H,
json={"query": "user preferences", "limit": 10,
"collection_id": os.environ["HEBBRIX_COLLECTION_ID"], "user_id": "end-user-123"},
timeout=30,
)
r.raise_for_status()
for hit in r.json()["results"]:
print(f"[{hit['score']:.2f}] {hit['content']}")Search with Filters
import asyncio
import os
from hebbrix import MemoryClient
async def main():
async with MemoryClient(api_key=os.environ["HEBBRIX_API_KEY"]) as client:
results = await client.search(
query="project deadlines",
collection_id=os.environ["HEBBRIX_COLLECTION_ID"],
user_id="end-user-123",
limit=20,
)
print(results)
if __name__ == "__main__":
asyncio.run(main())Find Similar Memories
# GET /v1/search/similar/{memory_id}: vector similarity search
r = requests.get(
f"{BASE}/search/similar/mem_abc123",
headers=H,
params={"limit": 5},
)
for hit in r.json()["results"]:
print(f"[{hit['score']:.2f}] {hit['content']}")cURL Examples
/v1/searchcurl -X POST "https://api.hebbrix.com/v1/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What are the user'\''s preferences?",
"collection_id": "YOUR_COLLECTION_ID",
"user_id": "end-user-123",
"limit": 10
}'/v1/search/reasoncurl -X POST "https://api.hebbrix.com/v1/search/reason" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What programming languages does the user know?",
"collection_id": "YOUR_COLLECTION_ID",
"user_id": "end-user-123",
"include_steps": true
}'Search Types
| Field | Type | Description |
|---|---|---|
| hybrid | Fast (default) | General queries (default) |
| vector | Fast | Semantic/conceptual queries |
| bm25 | Fastest | Exact keyword matching |
| graph | Moderate | Entity relationships |