@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.
- package/.github/workflows/publish.yml +58 -0
- package/README.md +75 -26
- package/package.json +9 -1
|
@@ -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
|
|
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
|
|
5
|
+
It is built to run standalone and integrate cleanly into existing platform stacks.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## โจ Why LLM App Teams Use CORE
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
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
|
-
##
|
|
15
|
+
## ๐ฉ What CORE Provides
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
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
|
-
##
|
|
23
|
+
## ๐งฑ Core Concepts
|
|
24
24
|
|
|
25
|
-
|
|
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
|
-
|
|
28
|
-
- auditable claim history,
|
|
29
|
-
- query-time recall,
|
|
30
|
-
- and deterministic APIs backed by Postgres.
|
|
30
|
+
## ๐ Retrieval Intelligence
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
When LLM retrieval expansion is enabled, search classifies queries into:
|
|
33
33
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
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.
|
|
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
|
},
|