@mnexium/core 0.1.0 โ†’ 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: publish-npm-${{ github.ref }}
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ publish:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Setup Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: 20
28
+ registry-url: https://registry.npmjs.org
29
+ cache: npm
30
+
31
+ - name: Upgrade npm for Trusted Publisher
32
+ run: |
33
+ npm install -g npm@latest
34
+ npm --version
35
+
36
+ - name: Install dependencies
37
+ run: npm ci
38
+
39
+ - name: Resolve package metadata
40
+ id: meta
41
+ run: |
42
+ echo "name=$(node -p 'require(\"./package.json\").name')" >> "$GITHUB_OUTPUT"
43
+ echo "version=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
44
+
45
+ - name: Check if version already exists
46
+ id: check
47
+ run: |
48
+ if npm view "${{ steps.meta.outputs.name }}@${{ steps.meta.outputs.version }}" version >/dev/null 2>&1; then
49
+ echo "should_publish=false" >> "$GITHUB_OUTPUT"
50
+ echo "Version already exists on npm; skipping publish."
51
+ else
52
+ echo "should_publish=true" >> "$GITHUB_OUTPUT"
53
+ echo "Version not found on npm; publishing."
54
+ fi
55
+
56
+ - name: Publish package
57
+ if: steps.check.outputs.should_publish == 'true'
58
+ run: npm publish --access public --provenance
package/README.md CHANGED
@@ -1,37 +1,86 @@
1
- # CORE
1
+ # ๐Ÿง  CORE
2
2
 
3
- CORE is Mnexium's memory engine service: a Postgres-backed HTTP API for storing memories, extracting claims, resolving truth state, and retrieving relevant context for downstream applications.
3
+ CORE is Mnexium's memory engine: a Postgres-backed HTTP service for durable memory, claim extraction, truth-state resolution, and retrieval for LLM applications.
4
4
 
5
- It is designed as an integration-first core service that can run standalone and plug into existing auth, tenancy, and platform controls.
5
+ It is built to run standalone and integrate cleanly into existing platform stacks.
6
6
 
7
- ## What CORE does
7
+ ## โœจ Why LLM App Teams Use CORE
8
8
 
9
- - Stores subject-scoped memories and supports lifecycle operations (create, update, soft-delete, restore).
10
- - Extracts structured claims from natural language and persists claim assertions.
11
- - Maintains slot-based truth state (`slot_state`) to track active winners and retractions.
12
- - Supports retrieval with vector + lexical fallback and optional LLM-powered query expansion/reranking.
13
- - Streams memory lifecycle events over SSE for real-time consumers.
9
+ - **Grounded outputs:** retrieve durable user memory instead of relying only on short chat context.
10
+ - **Persistent personalization:** keep preferences, history, and decisions across sessions/channels.
11
+ - **Lower hallucination risk:** combine memory retrieval with claim/slot truth state.
12
+ - **Context-window relief:** recall important memory on demand without re-prompting everything.
13
+ - **Faster shipping:** use a ready memory/truth backend instead of building custom memory infra.
14
14
 
15
- ## Why it is powerful
15
+ ## ๐Ÿ”ฉ What CORE Provides
16
16
 
17
- - Better grounding for responses: LLMs can retrieve durable, user-specific memory instead of relying only on short chat context.
18
- - Lower hallucination risk on known facts: retrieval and claim state give the model a concrete memory substrate to reference.
19
- - Personalization that persists: preferences, history, and prior decisions survive across sessions and channels.
20
- - Works beyond context-window limits: important memory is stored and recalled on demand instead of repeatedly reprompted.
21
- - Faster LLM product development: app teams get a ready memory/truth backend rather than building custom memory pipelines from scratch.
17
+ - Memory lifecycle APIs: create, list, search, update, soft-delete, restore.
18
+ - Memory extraction from text (`/api/v1/memories/extract`) with optional learning writes.
19
+ - Claim APIs with slot-based truth resolution and retraction workflows.
20
+ - Retrieval engine with vector + lexical search and LLM-expanded modes.
21
+ - SSE stream for memory events (`memory.created`, `memory.superseded`, `memory.updated`, `memory.deleted`).
22
22
 
23
- ## Intended use
23
+ ## ๐Ÿงฑ Core Concepts
24
24
 
25
- CORE is intended to be the memory and truth substrate behind apps, agents, and workflows that need:
25
+ - **Memory:** user-scoped durable facts/context.
26
+ - **Claim:** structured assertion (`predicate`, `object_value`, metadata).
27
+ - **Slot state (`slot_state`):** active winner for a semantic slot.
28
+ - **Supersession:** medium-similarity memories can be marked superseded by newer memories.
26
29
 
27
- - long-lived user memory,
28
- - auditable claim history,
29
- - query-time recall,
30
- - and deterministic APIs backed by Postgres.
30
+ ## ๐Ÿ”Ž Retrieval Intelligence
31
31
 
32
- ## Documentation map
32
+ When LLM retrieval expansion is enabled, search classifies queries into:
33
33
 
34
- - Setup and initialization: [docs/SETUP.md](docs/SETUP.md)
35
- - Runtime behavior and decision logic: [docs/BEHAVIOR.md](docs/BEHAVIOR.md)
36
- - HTTP endpoints and contracts: [docs/API.md](docs/API.md)
37
- - Production hardening checklist: [docs/OPERATIONS.md](docs/OPERATIONS.md)
34
+ - **`broad`**: profile/summary recall (importance + recency weighted).
35
+ - **`direct`**: specific fact lookup with truth/claim-aware boosts.
36
+ - **`indirect`**: advice/planning prompts with expanded query set + rerank.
37
+
38
+ Fallback behavior is built in:
39
+
40
+ - missing LLM provider keys -> simple retrieval/extraction mode
41
+ - missing embedding key -> non-vector lexical path still works
42
+
43
+ ## โš™๏ธ Runtime Modes
44
+
45
+ `CORE_AI_MODE` supports:
46
+
47
+ - `auto` (default): `cerebras -> openai -> simple`
48
+ - `cerebras`: requires `CEREBRAS_API` (else falls back to simple)
49
+ - `openai`: requires `OPENAI_API_KEY` (else falls back to simple)
50
+ - `simple`: no LLM client
51
+
52
+ `USE_RETRIEVAL_EXPAND` controls search-time classify/expand/rerank behavior.
53
+
54
+ ## ๐Ÿš€ Quick Start
55
+
56
+ Use the setup guide for the complete runbook, Docker path, and environment reference:
57
+
58
+ - [Setup and initialization](https://github.com/mnexium/core-mnx/blob/main/docs/SETUP.md)
59
+
60
+ ## ๐Ÿงช API Surface
61
+
62
+ Key route groups:
63
+
64
+ - health: `GET /health`
65
+ - memories: `/api/v1/memories*`
66
+ - claims/truth: `/api/v1/claims*`
67
+ - events: `GET /api/v1/events/memories`
68
+
69
+ Full endpoint contracts:
70
+
71
+ - [HTTP endpoints and contracts](https://github.com/mnexium/core-mnx/blob/main/docs/API.md)
72
+
73
+ ## ๐Ÿ›ก๏ธ Production Posture
74
+
75
+ CORE is integration-first. Auth, tenancy policy, idempotency strategy, and event bus scaling are intentionally externalized so you can fit CORE into your existing platform controls.
76
+
77
+ Production checklist:
78
+
79
+ - [Production hardening checklist](https://github.com/mnexium/core-mnx/blob/main/docs/OPERATIONS.md)
80
+
81
+ ## ๐Ÿ“š Documentation Map
82
+
83
+ - โš™๏ธ Setup and initialization: [docs/SETUP.md](https://github.com/mnexium/core-mnx/blob/main/docs/SETUP.md)
84
+ - ๐Ÿง  Runtime behavior and decision logic: [docs/BEHAVIOR.md](https://github.com/mnexium/core-mnx/blob/main/docs/BEHAVIOR.md)
85
+ - ๐Ÿ“˜ HTTP endpoints and contracts: [docs/API.md](https://github.com/mnexium/core-mnx/blob/main/docs/API.md)
86
+ - ๐Ÿ› ๏ธ Production hardening checklist: [docs/OPERATIONS.md](https://github.com/mnexium/core-mnx/blob/main/docs/OPERATIONS.md)
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@mnexium/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/mnexium/core-mnx"
8
+ },
9
+ "homepage": "https://github.com/mnexium/core-mnx",
10
+ "bugs": {
11
+ "url": "https://github.com/mnexium/core-mnx/issues"
12
+ },
5
13
  "publishConfig": {
6
14
  "access": "public"
7
15
  },