New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@hviana/sema

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hviana/sema

Sema: a non-parametric, instance-based reasoning system.

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm version

███████╗ ███████╗ ███╗   ███╗  █████╗
██╔════╝ ██╔════╝ ████╗ ████║ ██╔══██╗
███████╗ █████╗   ██╔████╔██║ ███████║
╚════██║ ██╔══╝   ██║╚██╔╝██║ ██╔══██║
███████║ ███████╗ ██║ ╚═╝ ██║ ██║  ██║
╚══════╝ ╚══════╝ ╚═╝     ╚═╝ ╚═╝  ╚═╝

The mind without weights.

A reasoning engine grounded in a vector-symbolic architecture and instance-based memory — not in billions of trained parameters.

No weights. No gradients. No training loop. No neural network. No GPU.

Deterministic · Auditable · CPU-only

— ⬡ — ⬡ — ⬡ —

[!IMPORTANT] © Sema is not a large language model. Today's LLMs compress the world into opaque floating-point weights and answer by sampling from them. Sema does the opposite: it keeps your knowledge as knowledge — content-addressed, inspectable, exact — and reasons over it on demand. The store is the model. What it knows, you can read. Why it answered, you can trace.

The difference is not a matter of degree. A trained model's meanings are real, but nothing in it records where they came from — provenance is diffused across an entire training run rather than kept. Sema's meanings are assembled from enumerable events, and the record is the mechanism: for any concept it holds, you can list what taught it, and in what role.

Formally, Sema is a non-parametric, instance-based reasoning system: a Vector Symbolic Architecture (Plate 1995; Kanerva 2009) over a content-addressable memory, with inference by weighted automated deduction (Knuth 1977; Felzenszwalb & McAllester 2007). Each term is grounded in docs/INDEX.md.

✦ It chooses how to think

A question can be answered in more than one way, and the ways are not interchangeable. Sema holds several, lets them compete, and takes the one that leaves the least of your question unaccounted for.

What Sema claims about your question
"I can build this answer out of pieces I already know."
"You've woven two things I know — let me carry structure between them."
"You gave me two conditions; the answer is where they meet."
"I've seen this shape of question before — let me read yours the same way."
"You've begun something I know the whole of."
"Part of this answer is your words, in a place my memory keeps open."
"The nearest thing I hold is this — and I'm telling you it's near, not derived."
"Nothing I hold bears on this."
                 ┌──────────────────────────────────────┐
 your question   │  every route prices its own answer   │
       │         └──────────────────┬───────────────────┘
       ▼                            ▼
┌─────────────┐        one price, one question:
│  route  ·   │        "how much of what you asked
│  route  ·   │  ───▶   did this route fail to
│  route  ·   │         account for?"
│  route  ·   │                     │
└─────────────┘                     ▼
                         ┌─────────────────────────┐
                         │  the lightest answer    │
                         │  wins — and arrives     │
                         │  tagged with the route  │
                         │  that produced it       │
                         └─────────────────────────┘

Because the price is unexplained question — not speed, not confidence — the winner is the route that accounts for most of what you actually asked, rather than the one most eager to answer. It is also why the last line of that table is a legitimate outcome and not a failure: when no route can account for what you asked, silence is a first-class answer. A system that must always produce something will always, eventually, produce fiction.

✦ Why Sema

🧩 Symbolic, not statistical

Everything stored carries a vector for what it is made of; anything that takes part in a fact carries a second for the company it keeps. The first makes colour close to colours; the second makes colour close to hue, two words whose spellings have nothing to do with each other. Meaning here is assembled and readable, not smeared across a weight matrix.

🔍 Fully auditable

Every answer is a derivation over explicit facts. No black box. Trace any output back to the exact deposits that produced it — a hard requirement for regulated, high-stakes, and safety-critical deployments.

♻️ Deterministic & reproducible

Same seed + same bytes → identical result, every time. No temperature, no sampling, no drift between runs. Reproducibility is a property of the architecture, not a flag you toggle.

📐 Nothing tuned

No threshold is a chosen number. Every bar the system decides on is derived from the representation's own geometry — its dimension, its perception window, how much it has learned. Nothing was fitted to a benchmark, so there is no dev set to overfit and no calibration that silently expires when your data stops resembling someone else's.

⚡ Instant training

Training is depositing — one pass, no epochs, no gradient descent, no fine-tuning jobs. Teach it a fact and it knows the fact. Now.

🔒 Total data sovereignty

Runs entirely on your hardware. No API calls, no telemetry, no weights to leak. Everything a trained mind knows lives in a few files on your disk.

[!TIP] No GPU. No cluster. No cloud bill. Sema runs on an ordinary CPU, because it never multiplies a weight matrix — it walks a graph. Its resident memory is capped by configuration rather than by how much it has learned, so a large store does not become a large machine. The economics of deploying intelligence change completely.

✦ See it think

Give Sema four plain notes — the way you'd jot them down — then ask things no note answers. From three worked examples it learns the shape of "X was painted by Y", lifts the painter out of a sentence it has never seen, and — in the same pass — reasons onward to a separate fact about that painter. The reply contains no word from the question: it is retrieval, generalization, and reasoning composing as a single act.

// demo.ts — one short session that drives the WHOLE pipeline from one memory.
//
// We give Sema a handful of plain notes, then ask things that no single note
// answers. The headline query is the third one: from three worked examples Sema
// learns the shape of "X was painted by Y", lifts the painter out of a sentence
// it has NEVER seen, and then — in the same pass — reasons forward to a separate
// fact about that painter. The reply contains no word from the question. That is
// retrieval, generalization, and reasoning composing as a single act, with every
// step traceable back to the notes behind it.

import { Mind } from "../src/index.js";
import { SQliteStore } from "../src/store-sqlite.js";

async function main(): Promise<void> {
  const mind = new Mind({ store: new SQliteStore({ path: ":memory:" }) });
  const ask = async (q: string) => (await mind.respondText(q)).trim();

  // ── Jot down what we know. Each line is just (context → what follows). ──
  await mind.ingest([
    // One relation, shown three times — a pattern taught purely by example:
    ["The Mona Lisa was painted by Leonardo da Vinci.", "Leonardo da Vinci"],
    ["The Starry Night was painted by Vincent van Gogh.", "Vincent van Gogh"],
    [
      "The Night Watch was painted by Rembrandt van Rijn.",
      "Rembrandt van Rijn",
    ],
    // One stray fact, keyed on a name none of the examples mention:
    ["Pablo Picasso", "Pablo Picasso co-founded the Cubist movement"],
  ]);

  // 1) GENERALIZE — apply the learned pattern to an unseen sentence and read out
  //    the painter. "Pablo Picasso" was never given as an answer; Sema locates it
  //    by analogy to the three examples.
  console.log(await ask("The Weeping Woman was painted by Pablo Picasso."));
  // → "Pablo Picasso co-founded the Cubist movement"
  //   …and, having found the painter, it KEEPS GOING: the name bridges into the
  //   one fact it holds about him. The answer appears in no word of the question.

  // 2) COMPUTE — exact arithmetic, grounded right where the notes go silent.
  console.log(await ask("a museum charges 12*4 for a family ticket"));
  // → "48"

  await mind.store.close();
}

main();
Pablo Picasso co-founded the Cubist movement
48

[!NOTE] This is example/demo.ts, verbatim — run it yourself with npm run demo. Look closely at the first answer: the question names a painting Sema was never shown and asks nothing explicit, yet the reply is a fact about Picasso that appears nowhere in the question. Sema generalized "painted by" from three examples to recognize Pablo Picasso as the answer slot, then followed that name to the one thing it knows about him — retrieval, an analogy, and a reasoning hop, in one query. The second answer is exact, not a plausible-looking guess. Every step traces back to the four notes above.

✦ Learn it in one pass

There is no training phase distinct from using it. Depositing is learning, and a fact is available the instant it lands.

📥 To teach itHand it the fact. One pass. No epochs, no GPU, no fine-tuning window.
✏️ To correct itDeposit the correction — a write, not a retraining run. Nothing is erased; the evidence is weighed.
🔁 To repeat itTeaching the same thing twice creates nothing new — identity is content.
📦 To scale itStorage grows with distinct content, never with volume.

[!TIP] It does not learn by repetition and does not need an enormous corpus. What it needs is coverage of fundamental patterns — conversation, logic, relationships, quantities — not the same pattern ten thousand times. A small, well-chosen curriculum teaches it more than a scraped ocean.

✦ Where it matters

Not "faster than an LLM" — possible where an LLM is not. Each of these sectors is blocked by a requirement no sampled model can meet.

SectorThe blockerWhat Sema puts on the table
🏥 HealthcarePatient data cannot leave; a recommendation must be explicableRuns in the building, cites the record behind every answer
🏦 Finance & creditAn adverse decision must be justified, and reproduced on demandThe same inputs give the same decision, with the reasoning attached
⚖️ Legal & complianceA cited authority that does not exist is a career-ending eventNothing is invented: every answer is a derivation over what was deposited
🛡️ Defense & intelligenceAir-gapped, no external inference, no telemetryOne binary, no network, no API key, no weights to exfiltrate
🏭 Industrial & safetyCertification requires deterministic, auditable behaviourDeterminism is architectural, and every answer is a replayable derivation
🏛️ Public sectorDecisions about citizens must be contestableA citizen can be shown exactly which rules and records produced the outcome
🛰️ Edge & roboticsNo datacenter, tight power budget, knowledge changes in the fieldCPU-only, memory capped by configuration; new knowledge is a write, not a build

[!NOTE] The common thread: these are settings where "I don't know" is worth more than a confident guess — and where a wrong answer is not an inconvenience but a liability. Sema is built to say it.

✦ Try it — one file, zero setup

A self-contained app that opens a web chat with Sema. Download, run, start talking — no install, no runtime, no API key.

Your machineDownload
🪟 WindowsDownload · 85 MB
🍎 Mac — M1–M4Download · 73 MB
🍎 Mac — IntelDownload · 85 MB
🐧 Linux — Intel/AMDDownload · 113 MB
🐧 Linux — ARMDownload · 114 MB

[!TIP] Not sure which Mac you have? Anything sold from 2020 onward is almost certainly M1–M4. On Linux, if you're on a regular desktop or server, pick Intel/AMD; ARM is for boards like the Raspberry Pi and ARM cloud instances. All builds are browsable at 🤗 sema-binary-examples.

✦ Research it — one skill

[!TIP] start-research pulls the trained memory into data/, builds a fast harness and a gate harness over it, then loops brainstorm → hypothesis → Arbor → measure — admitting a change only when it clears every gate and Sema's quality criteria.

The skills are versioned in .agents/skills/; your .claude/ stays yours. Link them in, once:

mkdir -p .claude/skills && for s in .agents/skills/*/; do ln -sfn "../../${s%/}" ".claude/skills/$(basename "$s")"; done

✦ Learn more

DocumentWhat's inside
📘 docs/INDEX.mdArchitecture docs: single-system laws (docs/architecture/), mechanisms, invariants, and harness gates — the entry point for theory and implementation.
🛠️ AGENTS.mdThe development manual: repo layout, build/test, internals, invariants, and recipes for extending the system.
🎓 CITATION.cffHow to cite Sema in academic work.
⚖️ LICENSE.mdPolyForm Noncommercial License 1.0.0.
📚 DATASETS.mdTraining corpora: provenance, per-corpus attribution, and how a trained memory file is licensed.
💼 COMMERCIAL-LICENSE.mdCommercial licensing terms and contact.
🤗 Trained examplesPre-trained memory files you can download and use directly.
💿 Binary examplesReady-to-run web chat apps for Windows, Mac, and Linux — one file, no install.

⚖️ Licensing & compliance — please read

[!WARNING] Sema is the product of serious, sustained research — and it is protected. It is released under the PolyForm Noncommercial License 1.0.0. Personal study, academic research, experimentation, and use by noncommercial organizations are welcome and explicitly permitted.

[!CAUTION] Commercial use requires a separate paid license. This includes — but is not limited to — use by a company; use to provide paid services or serve clients; use inside a SaaS, hosted product, or any revenue-generating platform; and use to reduce business costs or support business operations.

Operating Sema commercially (artifacts and algorithmic logic) without a license is a violation of its terms. See COMMERCIAL-LICENSE.md to obtain one, and TRADEMARKS.md — the Sema name, logos, and brand are not covered by the source license.

[!NOTE] Trained memory files are licensed in two layers. Sema is non-parametric, so a trained store retains its training text verbatim — it is a database that contains its corpora, not a weight file. The engine (algorithms, geometry, deduction, indexes, formats, and all code) is under PolyForm Noncommercial with a separate commercial license. The corpus content inside a store stays under each corpus's own upstream license, and Sema's license is not extended over it. If you distribute a store, ship DATASETS.md with it — it carries the attribution and modification statement those licenses require.

Respecting these terms funds the research that makes work like this possible. If Sema creates value for your business, license it — and help keep independent, weight-free AI research alive.

© Sema Author — Henrique Viana (creator).

Academic purpose:

hv5088@gmail.com

Commercial licensing:

reis.marcelo@gmail.com

© Sema Supporters — Marcelo Oliveira dos Reis

— ⬡ — ⬡ — ⬡ —

FAQs

Package last updated on 20 Oct 2026

Related posts