Skip to content

feat(ts): add Nowledge Mem resource - #159

Draft
wey-gu wants to merge 3 commits into
strukto-ai:mainfrom
wey-gu:feat/nowledge-mem-resource
Draft

feat(ts): add Nowledge Mem resource#159
wey-gu wants to merge 3 commits into
strukto-ai:mainfrom
wey-gu:feat/nowledge-mem-resource

Conversation

@wey-gu

@wey-gu wey-gu commented Jun 4, 2026

Copy link
Copy Markdown

Summary

Adds a read-only TypeScript resource for Nowledge Mem backed directly by the Nowledge FS API (/fs/*). Nowledge FS is a knowledge tree, not a memory-note folder: a Mirage workspace can mount it at /mem and browse memories, threads, parsed sources, wiki pages, guidance context, Working Memory, feed events, artifacts, and skills through familiar shell-shaped commands.

  • ls, cat, and stat for tree discovery and targeted reads; ls and stat now delegate to Mirage's shared generic helpers.
  • cat --line/--lines for small evidence windows from large thread/source files.
  • find for Nowledge metadata filters.
  • grep for exact text search across rendered content.
  • recall for semantic recall through Nowledge Mem.

This is intentionally API-only. It does not shell out to the nmem CLI and does not require the CLI to be installed.

Notes

  • Requires a Nowledge Mem server that exposes the Nowledge FS API, expected in Nowledge Mem 0.9.0+.
  • Rebased on the current TypeScript generic-command refactor in main.
  • The resource is read-only; Nowledge Mem remains the source of truth.
  • Browser docs recommend a same-origin proxy or short-lived token instead of embedding a long-lived personal API key.
  • This PR is draft until the Nowledge Mem 0.9.0 /fs/* API is release-stable.

Validation

Validated with Homebrew node@22 (v22.22.3) because local Node 26 rejects Mirage's --experimental-wasm-jspi test flag.

  • pnpm --dir typescript --filter @struktoai/mirage-core exec vitest run src/resource/nowledge_mem/nowledge_mem.test.ts src/types.test.ts
  • pnpm --dir typescript --filter @struktoai/mirage-core typecheck
  • pnpm --dir typescript --filter @struktoai/mirage-node exec vitest run src/resource/registry.test.ts
  • pnpm --dir typescript --filter @struktoai/mirage-browser exec vitest run src/resource/registry.test.ts
  • pnpm --dir typescript --filter @struktoai/mirage-core build
  • pnpm --dir typescript --filter @struktoai/mirage-node build
  • pnpm --dir typescript --filter @struktoai/mirage-browser build
  • git diff --check
  • Live local Nowledge Mem smoke against http://127.0.0.1:14242 through built @struktoai/mirage-node output: ls /mem, stat /mem/context, and recall "Nowledge Mem" --in /mem/memories -k 2.

@wey-gu
wey-gu force-pushed the feat/nowledge-mem-resource branch from ed70617 to 3458d30 Compare June 4, 2026 09:34
@zechengz

zechengz commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

I am doing some refactoring for the ts. Will take a look at this soon :)

@wey-gu
wey-gu force-pushed the feat/nowledge-mem-resource branch from 3458d30 to cb8dcaf Compare June 6, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants