Commit Graph

102 Commits

Author SHA1 Message Date
Menci df1e1fc917 feat(memory): add Spaces support, platform/group annotation, and bot name to Nowledge Mem
- Use Nowledge Mem Spaces for per-bot memory isolation (space name: memoh:{botID})
- Auto-ensure space on first use with sync.Map cache
- Add platform/conversation context header to stored text: (Telegram 群组「开发讨论」)
- Replace [我] with bot's actual display name [小助手]
- Thread ConversationType, ConversationName, Platform, BotName through AfterChatRequest
- Add resolveBotDisplayName to resolver for DB lookup
2026-04-12 15:15:14 +08:00
Menci fefbc155c6 feat(memory): add Nowledge Mem provider integration
Add a new memory provider that delegates to a local Nowledge Mem instance
for memory storage, retrieval, and knowledge graph building.

Key design decisions:
- User messages tagged as [DisplayName], bot messages as [我]
- Per-message display name parsed from YAML front-matter headers
- Let Nowledge Mem handle entity extraction and graph building
- 6-way hybrid search (semantic + full-text + entity + community + label + graph)

New files:
- internal/memory/adapters/nowledgemem/client.go (REST API client)
- internal/memory/adapters/nowledgemem/nowledgemem.go (Provider impl)
- docs/nowledge-mem.md (design document with research and decisions)

Modified: types.go, service.go, serve.go (provider registration),
frontend (add-memory-provider.vue, types.gen.ts, i18n locales)
2026-04-08 10:23:24 +08:00
Acbox a91d6304c6 release: v0.7.0-beta.1 2026-04-04 21:10:00 +08:00
Acbox 49e5f3d8ae release: v0.6.3 2026-04-03 01:16:47 +08:00
Acbox 574bc1fb59 release: v0.6.2 2026-04-02 01:52:40 +08:00
Acbox 2d55c385a4 release: v0.6.1 2026-03-31 15:19:53 +08:00
Ran 49613a283b release: v0.6.0 2026-03-30 15:23:26 +08:00
AlexMa233 dd13e89469 Enhance Matrix bot setup documentation (#308)
* Enhance Matrix bot setup documentation

Added instructions for obtaining an access token using the Matrix Client Login API and clarified the importance of keeping it secret. Updated details on bot capabilities and linked to the roadmap for future features.

* Add warning about access token security

Added important note about keeping the access token secret.
2026-03-29 21:26:22 +08:00
Acbox Liu 5f42fed8e0 docs: v0.6 (#304)
* docs: v0.6

* docs: update readme
2026-03-29 20:30:21 +08:00
Acbox bff9055d28 release: v0.6.0-beta.5 2026-03-29 20:16:17 +08:00
Acbox aad8724642 release: v0.6.0-beta.4 2026-03-29 16:30:15 +08:00
Acbox 7626816b73 release: v0.6.0-beta.3 2026-03-29 04:03:34 +08:00
Acbox 057ebd0a1a release: v0.6.0-beta.2 2026-03-29 02:46:08 +08:00
Acbox c5f1477539 release: v0.6.0-beta.1 2026-03-29 00:09:05 +08:00
Kevin Hill (Bosso) eb4cbaa26b Update bot settings instructions in Discord guide (#283)
Added additional Privileged Gateway Intents - otherwise enable will not work on Memoh
2026-03-28 01:12:49 +08:00
Yiming Qi 03ba13e7e5 feat: add timezone support for schedule and user runtime (#282) 2026-03-26 01:32:02 +08:00
Acbox dd1b588e95 chore: remove @memohai/cli 2026-03-24 21:34:04 +08:00
Acbox ff764d53ac refactor: change npm package from @memoh to @memohai 2026-03-24 21:30:25 +08:00
Menci d5b410d7e3 refactor(workspace): new workspace v3 container architecture (#244)
* feat(mcp): workspace container with bridge architecture

Migrate MCP containers to use UDS-based bridge communication instead of
TCP gRPC. Containers now mount runtime binaries and Unix domain sockets
from the host, eliminating the need for a dedicated MCP Docker image.

- Remove Dockerfile.mcp and entrypoint.sh in favor of standard base images
- Add toolkit Dockerfile for building MCP binary separately
- Containers use bind mounts for /opt/memoh (runtime) and /run/memoh (UDS)
- Update all config files with new runtime_path and socket_dir settings
- Support custom base images per bot (debian, alpine, ubuntu, etc.)
- Legacy container detection and TCP fallback for pre-bridge containers
- Frontend: add base image selector in container creation UI

* feat(container): SSE progress bar for container creation

Add real-time progress feedback during container image pull and creation
using Server-Sent Events, without breaking the existing synchronous JSON
API (content negotiation via Accept header).

Backend:
- Add PullProgress/LayerStatus types and OnProgress callback to
  PullImageOptions (containerd service layer)
- DefaultService.PullImage polls ContentStore.ListStatuses every 500ms
  when OnProgress is set; AppleService ignores it
- CreateContainer handler checks Accept: text/event-stream and switches
  to SSE branch: pulling → pull_progress → creating → complete/error

Frontend:
- handleCreateContainer/handleRecreateContainer use fetch + SSE instead
  of the SDK's synchronous postBotsByBotIdContainer
- Progress bar shows layer-level pull progress (offset/total) during
  pulling phase and indeterminate animation during creating phase
- i18n keys added for pullingImage and creatingContainer (en/zh)

* fix(container): clear stale legacy route and type create SSE

* fix(ci): resolve lint errors and arm64 musl node.js download

- Fix unused-receiver lint: rename `s` to `_` on stub methods in
  manager_legacy_test.go
- Fix sloglint: use slog.DiscardHandler instead of
  slog.NewTextHandler(io.Discard, nil)
- Handle missing arm64 musl Node.js builds: unofficial-builds.nodejs.org
  does not provide arm64 musl binaries, fall back to glibc build

* fix(lint): address errcheck, staticcheck, and gosec findings

- Discard os.Setenv/os.Remove return values explicitly with _
- Use omitted receiver name instead of _ (staticcheck ST1006)
- Tighten directory permissions from 0o755 to 0o750 (gosec G301)

* fix(lint): sanitize socket path to satisfy gosec G703

filepath.Clean the env-sourced socket path before os.Remove
to avoid path-traversal taint warning.

* fix(lint): use nolint directive for gosec G703 on socket path

filepath.Clean does not satisfy gosec's taint analysis. The socket
path comes from MCP_SOCKET_PATH env (operator-configured) or a
compiled-in default, not from end-user input.

* refactor: rename MCP container/bridge to workspace/bridge

Split internal/mcp/ to separate container lifecycle management from
Model Context Protocol connections, eliminating naming confusion:

- internal/mcp/ (container mgmt) → internal/workspace/
- internal/mcp/mcpclient/ → internal/workspace/bridge/
- internal/mcp/mcpcontainer/ → internal/workspace/bridgepb/
- cmd/mcp/ → cmd/bridge/
- config: MCPConfig → WorkspaceConfig, [mcp] → [workspace]
- container prefix: mcp-{id} → workspace-{id}
- labels: mcp.bot_id → memoh.bot_id, add memoh.workspace=v1
- socket: mcp.sock → bridge.sock, env BRIDGE_SOCKET_PATH
- runtime: /opt/memoh/runtime/mcp → /opt/memoh/runtime/bridge
- devenv: mcp-build.sh → bridge-build.sh

Legacy containers (mcp- prefix) detected by container name prefix
and handled via existing fallback path.

* fix(container): use memoh.workspace=v3 label value

* refactor(container): drop LegacyBotLabelKey, infer bot ID from container name

Legacy containers use mcp-{botID} naming, so bot ID can be derived
via TrimPrefix instead of looking up the mcp.bot_id label.

* fix(workspace): resolve containers via manager and drop gateway container ID

* docs: fix stale mcp references in AGENTS.md and DEPLOYMENT.md

* refactor(workspace): move container lifecycle ownership into manager

* dev: isolate local devenv from prod config

* toolkit: support musl node runtime

* containerd: fix fallback resolv.conf permissions

* web: preserve container create progress on completion

* web: add bot creation wait hint

* fix(workspace): preserve image selection across recreate

* feat(web): shorten default docker hub image refs

* fix(container): address code review findings

- Remove synchronous CreateContainer path (SSE-only now)
- Move flusher check before WriteHeader to avoid committed 200 on error
- Fix legacy container IP not cached via ensureContainerAndTask path
- Add atomic guard to prevent stale pull_progress after PullImage returns
- Defensive copy for tzEnv slice to avoid mutating shared backing array
- Restore network failure severity in restartContainer (return + Error)
- Extract duplicate progress bar into ContainerCreateProgress component
- Fix codesync comments to use repo-relative paths
- Add SaaS image validation note and kernel version comment on reaper

* refactor(devenv): extract toolkit install into shared script

Unify the Node.js + uv download logic into docker/toolkit/install.sh,
used by the production Dockerfile and runnable locally for dev.

Dev environment no longer bakes toolkit into the Docker image — it is
volume-mounted from .toolkit/ instead, so wrapper script changes take
effect immediately without rebuilding. The entrypoint checks for the
toolkit directory and prints a clear error if missing.

* fix(ci): address go ci failures

* chore(docker): remove unused containerd image

* refactor(config): rename workspace image key

* fix(workspace): fix legacy container data loss on migration and stop swallowing errors

Three root causes were identified and fixed:

1. Delete() used hardcoded "workspace-" prefix to look up legacy "mcp-"
   containers, causing GetContainer to return NotFound. CleanupBotContainer
   then silently skipped the error and deleted the DB record without ever
   calling PreserveData. Fix: resolve the actual container ID via
   ContainerID() (DB → label → scan) before operating.

2. Multiple restore error paths were silently swallowed (logged as Warn
   but not returned), so the user saw HTTP 200/204 with no data and no
   error. Fix: all errors in the preserve/restore chain now block the
   workflow and propagate to the caller.

3. tarGzDir used cached DirEntry.Info() for tar header size, which on
   overlayfs can differ from the actual file size, causing "archive/tar:
   write too long". Fix: open the file first, Fstat the fd for a
   race-free size, and use LimitReader as a safeguard.

Also adds a "restoring" SSE phase so the frontend shows a progress
indicator ("Restoring data, this may take a while...") during data
migration on container recreation.

* refactor(workspace): single-point container ID resolution

Replace the `containerID func(string) string` field with a single
`resolveContainerID(ctx, botID)` method that resolves the actual
container ID via DB → label → scan → fallback. All ~16 lookup
callsites across manager.go, dataio.go, versioning.go, and
manager_lifecycle.go now go through this single resolver, which
correctly handles both legacy "mcp-" and new "workspace-" containers.

Only `ensureBotWithImage` inlines `ContainerPrefix + botID` for
creating brand-new containers — every other path resolves dynamically.

* fix(web): show progress during data backup phase of container recreate

The recreate flow (delete with preserve_data + create with restore_data)
blocked on the DELETE call while backing up /data with no progress
indication. Add a 'preserving' phase to the progress component so
users see "正在备份数据..." instead of an unexplained hang.

* chore: remove [MYDEBUG] debug logging

Clean up all 112 temporary debug log statements added during the
legacy container migration investigation. Kept only meaningful
warn-level logs for non-fatal errors (network teardown, rename
failures).
2026-03-18 15:19:09 +08:00
Acbox 49bc2c868b release: v0.5.0 2026-03-17 00:07:06 +08:00
Acbox be2bbaf74f docs: update to v0.5 2026-03-14 23:11:29 +08:00
Acbox e7844dfa89 release: v0.5.0-beta.1 2026-03-14 17:30:48 +08:00
晨苒 627b673a5c refactor: multi-provider memory adapters with scan-based builtin (#227)
* refactor: restructure memory into multi-provider adapters, remove manifest.json dependency

- Rename internal/memory/provider to internal/memory/adapters with per-provider subdirectories (builtin, mem0, openviking)
- Replace manifest.json-based delete/update with scan-based index from daily files
- Add mem0 and openviking provider adapters with HTTP client, chat hooks, MCP tools, and CRUD
- Wire provider lifecycle into registry (auto-instantiate on create, evict on update/delete)
- Split docker-compose into base stack + optional overlays (qdrant, browser, mem0, openviking)
- Update admin UI to support dynamic provider config schema rendering

* chore(lint): fix all golangci-lint issues for clean CI

* refactor(docker): replace compose overlay files with profiles

* feat(memory): add built-in memory multi modes

* fix(ci): golangci lint

* feat(memory): edit built-in memory sparse design
2026-03-14 06:04:13 +08:00
Yao Siqian 7904de87bd docs(deploy): fix variable passing (#236) 2026-03-13 01:14:37 +08:00
Acbox fe04c5722b release: v0.4.3 2026-03-11 20:57:52 +08:00
Ringo.Typowriter f8bfd7c107 docs(channels): add QQ channel configuration guide (#219) 2026-03-09 23:37:28 +08:00
Acbox de68022d3c script: remove cn mirror notice 2026-03-07 19:26:08 +08:00
Acbox 0ca3d35fa0 script: update version management 2026-03-07 19:18:13 +08:00
Acbox 99114d2521 Merge branch 'v0.4' 2026-03-07 18:26:46 +08:00
Acbox c70d452238 release: v0.4.2 2026-03-07 18:20:46 +08:00
Acbox 05d2240c16 docs: update memory and browser 2026-03-07 16:58:56 +08:00
Acbox 7f3f8ce2e5 release: v0.4.1 2026-03-07 16:02:53 +08:00
Acbox d4749ab322 release: v0.4.0 2026-03-07 15:33:43 +08:00
Acbox 387ac50030 release: v0.3.1 2026-03-05 00:44:50 +08:00
Acbox 1ccf6fd80e release: v0.3.0 2026-03-04 23:56:46 +08:00
Acbox dc6f9bee89 release: v0.2.0 2026-03-01 18:04:54 +08:00
Acbox Liu e16304d065 docs: v0.2 (#155)
* docs: rewrite getting started documentation

- Overhauled getting started guide to align with current frontend UI and logic.
- Split getting started documentation into modular chapters covering providers, models, bots, containers, files, skills, MCP, channels, memory, subagents, heartbeats, and search/email providers.
- Updated sidebar and index page to reflect the new documentation structure.

Made-with: Cursor

* docs: fix lint error in en.ts

Made-with: Cursor

* docs: add Channels documentation category

- Created a new top-level documentation category 'Channels'.
- Added detailed configuration guides for Telegram, Feishu (Lark), and Discord.
- Included official documentation references for bot creation on each platform.
- Updated 'Getting Started' channel page and main index with links to the new guides.

Made-with: Cursor

* refactor: docs to v0.2

* docs: add Scheduled Tasks chapter to getting started

- Created schedule.md covering cron-based automation, fields, pattern reference, and execution flow.
- Added comparison table between Schedule and Heartbeat features.
- Updated sidebar navigation to include the new chapter.

Made-with: Cursor
2026-03-01 18:01:03 +08:00
Acbox d69daeff68 release: v0.2.0-beta.1 2026-03-01 16:31:06 +08:00
BBQ cedac8dbf6 chore: require config.toml for deployment, update docs (#139)
- docker-compose.yml now defaults to ./config.toml instead of
  conf/app.docker.toml, enforcing explicit configuration for
  production deployments (dev environment still uses conf/ directly)
- Update DEPLOYMENT.md and docs with clear instructions to copy
  config template before starting
- Update config-toml.md: add registry/cni fields, remove obsolete
  [brave] section (search providers are now managed via web UI),
  fix default values
- Add China mainland mirror documentation
2026-02-26 20:20:29 +08:00
Fodesu 989b3e9c93 docs: move IPA to docs 2026-02-26 12:27:27 +08:00
Acbox e2678ff0a1 chore(docs): change install scripts to short domain 2026-02-25 16:32:52 +08:00
Ran d92993e56e release: v0.1.2 2026-02-24 23:39:52 +08:00
Ran 6f392cbb90 release: v0.1.1 2026-02-24 20:55:52 +08:00
Acbox bd28c624b9 release: v0.1.0 2026-02-24 03:47:07 +08:00
Ran 5e12b5a53f fix: ensure unifying on hardcoded /data mount path 2026-02-24 03:35:27 +08:00
Acbox 6cb80d30be docs: remove documentation about cli 2026-02-24 03:18:37 +08:00
Acbox 7ada20967a release: v0.1.0-beta.7 2026-02-23 14:49:18 +08:00
Ran efbf7be0da release: v0.1.0-beta.6 2026-02-23 06:29:08 +08:00
Acbox 2c6b5e5565 release: v0.1.0-beta.5 2026-02-21 23:10:02 +08:00
Acbox 654d51a142 release: v0.1.0-beta.4 2026-02-20 22:19:50 +08:00