← Back to home@IvenKooLab

loci-dsh

🧠 loci second brain as a DeepSeek Harness (dsh) web plugin β€” search / ask / remember your local knowledge base from the sidebar

Stars
0
Language
TypeScript
Created
Sep 19, 2026
Updated
Sep 19, 2026

Introduction

loci-dsh

[!TIP] 🧠 Your loci second brain, living in the DeepSeek Harness (dsh) web UI sidebar.

δΈ­ζ–‡ζ–‡ζ‘£οΌšREADME.zh-CN.md

CI License: MIT Node

loci-dsh is a UI-layer plugin for dsh ("everything is a plugin"): it mounts a 🧠 loci memory tab in the web sidebar where you can search, ask questions, jot down memories, and inspect your loci knowledge base β€” without leaving the conversation.

SearchAsk
searchask
MemoriesStatus
memoriesstatus

How it works

Pure UI layer β€” no Python embedded, no core fork. The plugin's host half (Node) mounts /loci-dsh/api/* routes on the dsh web server and proxies them to a local loci serve-http instance (REST + Bearer auth). The client half (React) registers the sidebar tab via dsh-better-sidebar and talks to the host half same-origin β€” so loci never needs CORS.

loci-dsh architecture

  • Search β€” hybrid retrieval with result count, memories-only (tag=memory) and path filters
  • Ask β€” LLM answers from your knowledge base with citation chips, optional claim-by-claim verification
  • Memories β€” keyword-driven memory retrieval grouped by day, plus quick capture (title / text / tags)
  • Status β€” connection state, store summary, per-source chunk counts

loci's HTTP API answers in plain-text envelopes, so the host half re-derives structure (search blocks, stats, citations, memory timestamps from filenames). Parsers live in src/parse.ts and track loci's de-facto wire format.

Requirements

  1. Node.js β‰₯ 24 (dsh's launcher uses import.meta.main; Node 20/22 exit silently)

  2. dsh: npm i -g @deepseek-ai/dsh

  3. The sidebar host: dsh plugin --profile web add dsh-better-sidebar

  4. loci β‰₯ v0.6.2 with its HTTP server running and a fixed token in loci's config.toml:

    [http]
    token = "<a random string>"
    
    loci serve-http   # defaults to 127.0.0.1:8765; --host/--port or the [http] section override
    

Install

# from npm (once published)
dsh plugin --profile web add loci-dsh

# or straight from git (lib/ artifacts are committed β€” no local build needed)
dsh plugin --profile web add github:IvenKooLab/loci-dsh

Then point the plugin at your loci instance. Edit ~/.dsh/profiles/web/cordis.patch.yml and add an id-targeted override row (no insert β€” the bundle is already mounted by dsh plugin add; a second insert of the same id fails the boot with a duplicate-entry error):

- id: loci-dsh
  config:
    baseUrl: 'http://127.0.0.1:8765'
    token: '<same value as [http] token in loci config.toml>'

dsh patch rows replace config wholesale (no deep merge) β€” restate every key you care about.

Alternatively use the LOCI_URL / LOCI_TOKEN environment variables before starting dsh web.

Launch dsh web β€” the 🧠 loci memory tab appears in the bottom workbench sidebar.

Configuration

KeyDefaultDescription
baseUrlhttp://127.0.0.1:8765loci serve-http address
token(empty)Bearer token, matching loci's [http] token
timeoutMs20000Short-request timeout (health/stats/search/remember)
askTimeoutMs180000/ask timeout β€” a full LLM round-trip (~21 s with glm-4.6)

Development

pnpm install
pnpm build        # tsc typecheck + tsdown dual-entry bundle β†’ lib/
pnpm watch        # rebuild on change

# mount into a profile as a live link (rebuild + browser hard-refresh to apply)
cd ~/.dsh && dsh plugin --profile web add /absolute/path/to/loci-dsh
  • src/index.ts β€” host half: route mounting, loci proxy, error mapping
  • src/loci-client.ts β€” loci HTTP client (fetch + AbortSignal timeouts)
  • src/parse.ts β€” plain-text β†’ structured parsers (search blocks / stats / citations)
  • src/trust-fence.ts β€” Host-header loopback fence (same semantics as dsh's /api gateway)
  • src/client/ β€” client half: tab registration, views, zh/en dictionaries

Structured after the dsh-better-sidebar external-plugin guide and dsh-sentinel's standalone build.

Related

License

MIT