Skip to main content

Keyed facts/logic memory for Seren. The left brain - addressable, deterministic, one live value per key.

Project description

SerenLoci

The left brain. A keyed facts-and-logic store for the Seren constellation - addressable, deterministic, exactly one live value per key.

Where SerenMemory (the right brain) holds fuzzy, episodic memory - "we ground on the embedder migration for a week, it was a slog" - Loci holds facts:

{ project, key, value, why }

camelCase is life. braces on a new line in posh. GGML_CUDA_NO_VMM=ON must be set at compile time - because the env var isn't honored at runtime on Jetson. A locus has an address. You go to it and get the thing - you don't grope around for something that rhymes.


Why it's shaped like this

One live value per key, enforced by the database. Set a new value for a key and the old one is superseded - kept as history, pointed at by the new row, never blended. A vibed-together fact is worse than no fact, so the rule is strict, and it's not enforced by hope: a PARTIAL UNIQUE INDEX makes sqlite physically refuse a second live row per (project, key).

Two tiers. A reserved project of * is the fundamentals tier - cross-project truths. A concrete project name (seren-memory) is the per-project tier - the targeted override. Same split as nano/xavier/dgx prebuilts: the platform-wide truth and the per-board variant.

The why is the point. A logic store without rationale is just a dictionary. The value tells you what; the why is what stops you re-learning it the painful way - and it's searchable, so "that CUDA thing" finds a fact whose reason mentions CUDA even when the key doesn't.


The floor is free

Three access rungs, cheapest first:

  1. Exact - get_fact(project, key) returns the live value, deterministically. No embedding, no ranking. You know the address, you get the thing.
  2. Lexical - FTS5 full-text over (key, value, why) of the live rows. The "I sort of remember the words" path.
  3. Vector (additive) - a sqlite-vec index for the "this smells like that CUDA thing" associative jump. Built only when you name an embedder.

Rungs 1 and 2 need nothing but sqlite (stdlib) and the web stack - no torch, no GPU, the 4GB-laptop floor. The vector finder is the ceiling, opted into by install, never required. Where does it sit? How much does it need? - the floor needs almost nothing.


Install

pip install seren-loci                 # the floor: exact + FTS5 lexical
pip install seren-loci[vector]         # + the sqlite-vec associative finder (pulls torch)
pip install seren-loci[mcp]            # + the MCP surface (model reaches facts directly)
pip install seren-loci[corp]           # + OS-trust-store TLS for corp-proxied boxes

Extras stack: pip install seren-loci[vector,mcp].

Run

seren-loci                             # or: python -m seren_loci
seren-loci --config ./seren-loci.yaml

Listens on 7422 by default (neighbor convention: memory 7420, margin 7421, loci 7422).

# set a fundamental truth
curl -X POST localhost:7422/fact -H 'content-type: application/json' \
  -d '{"key":"posh.brace_style","value":"curly brackets on a new line","why":"readability"}'

# get it back, deterministically
curl 'localhost:7422/fact?key=posh.brace_style'

# discovery search (exact-key first, then the finder)
curl -X POST localhost:7422/search -H 'content-type: application/json' \
  -d '{"query":"cuda runtime"}'

API

Method Path What
POST /fact Set/replace a fact (strict supersede). Names the superseded id, or null.
GET /fact The live value for ?project=&key= (project defaults to *). 404 if none.
GET /fact/history Every value a key has held, newest first.
DELETE /fact Retire (soft-supersede) the live value for a key.
GET /facts List facts in scope (?project=&include_superseded=).
GET /counts {live, history, projects}.
POST /search Exact + finder discovery, ranked.
GET / /health Service info / liveness.

Every search hit carries a normalized 0-1 score (exact->1.0, vector->1/(1+distance), lexical->bm25 mapped above 0). That's the common currency a future SerenCorpusCallosum uses to merge left-brain and right-brain results on one axis instead of comparing cosines to key-hits.


Config

seren-loci.yaml (all optional - defaults are a working zero-config dev setup). Env vars (SEREN_LOCI_*) override the file.

server:
  host: 0.0.0.0
  port: 7422
  bearer_token: ""        # empty = no auth (trusted LAN)
storage:
  db_path: ~/.seren-loci/loci.db
  embedding_model:        # null = floor (no torch). name one to light the vector finder.
  embedding_device: cpu
tls:
  trust_system_store: false   # true (+ [corp]) for TLS-intercepting corp proxies

Where it sits in the constellation

  • SerenMemory - the right brain. Fuzzy, consolidated, episodic. General-purpose AI memory protocol.
  • SerenLoci - this. The left brain. Keyed facts, deterministic, strict-supersede.
  • SerenCorpusCallosum (planned) - fans a query across both hemispheres and merges on the shared score currency.

Build for the floor, not the ceiling. The Nano is the floor, not the cap. GPL-3.0-or-later. Rip it and win.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seren_loci-1.0.1.tar.gz (67.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seren_loci-1.0.1-py3-none-any.whl (62.8 kB view details)

Uploaded Python 3

File details

Details for the file seren_loci-1.0.1.tar.gz.

File metadata

  • Download URL: seren_loci-1.0.1.tar.gz
  • Upload date:
  • Size: 67.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for seren_loci-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8cfd6e5296601da1e1861a6fb797662cc4889d1c948adba1827006910bdc79b2
MD5 080032bbab4fb0f2b82917d69fa031d1
BLAKE2b-256 c453e86d63659a586a9039d977132918ffd87e6cc9a74a444c6a3ccff4e57b73

See more details on using hashes here.

Provenance

The following attestation bundles were made for seren_loci-1.0.1.tar.gz:

Publisher: release.yml on ChadRoesler/SerenLoci

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file seren_loci-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: seren_loci-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 62.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for seren_loci-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2fdc177eae1f69918bc907cbf41a26b32f192d5836bb9aa8a94311ed9643b36
MD5 535f43d6fae82a2a78ba17c8cc64e838
BLAKE2b-256 4f82cdd04dcdeebec87da01ca35baf3466aada09f37825886a5200fd24f3f7f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for seren_loci-1.0.1-py3-none-any.whl:

Publisher: release.yml on ChadRoesler/SerenLoci

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page