@cdmbase/wiki-browser 12.0.18-alpha.41 → 12.0.18-alpha.42
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.
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": [
|
|
3
|
+
{
|
|
4
|
+
"contentId": "botinstruction-tunnel-setup",
|
|
5
|
+
"slug": "tunnel-setup",
|
|
6
|
+
"filePath": "/content/docs/BotInstruction/TUNNEL-SETUP.md",
|
|
7
|
+
"relativePath": "BotInstruction/TUNNEL-SETUP.md",
|
|
8
|
+
"categoryId": "BotInstruction",
|
|
9
|
+
"title": "TUNNEL SETUP",
|
|
10
|
+
"description": "",
|
|
11
|
+
"author": "Documentation",
|
|
12
|
+
"updatedAt": "Recently",
|
|
13
|
+
"frontmatter": {}
|
|
14
|
+
},
|
|
3
15
|
{
|
|
4
16
|
"contentId": "botinstruction-zep_neo4j_knowledge_graph_guide",
|
|
5
17
|
"slug": "zep_neo4j_knowledge_graph_guide",
|
|
@@ -33,6 +45,18 @@
|
|
|
33
45
|
"Cache-Control": "no-cache"
|
|
34
46
|
}
|
|
35
47
|
},
|
|
48
|
+
{
|
|
49
|
+
"contentId": "llm-contextmemorydeveloperguide",
|
|
50
|
+
"slug": "contextmemorydeveloperguide",
|
|
51
|
+
"filePath": "/content/docs/LLM/ContextMemoryDeveloperGuide.md",
|
|
52
|
+
"relativePath": "LLM/ContextMemoryDeveloperGuide.md",
|
|
53
|
+
"categoryId": "LLM",
|
|
54
|
+
"title": "ContextMemoryDeveloperGuide",
|
|
55
|
+
"description": "",
|
|
56
|
+
"author": "Documentation",
|
|
57
|
+
"updatedAt": "Recently",
|
|
58
|
+
"frontmatter": {}
|
|
59
|
+
},
|
|
36
60
|
{
|
|
37
61
|
"contentId": "llm-logger.llm",
|
|
38
62
|
"slug": "logger.llm",
|
|
@@ -3575,6 +3599,15 @@
|
|
|
3575
3599
|
"description": "BotInstruction Documentation",
|
|
3576
3600
|
"iconType": "Documentation",
|
|
3577
3601
|
"articles": [
|
|
3602
|
+
{
|
|
3603
|
+
"id": "botinstruction-tunnel-setup",
|
|
3604
|
+
"title": "TUNNEL SETUP",
|
|
3605
|
+
"description": "",
|
|
3606
|
+
"slug": "tunnel-setup",
|
|
3607
|
+
"author": "Documentation",
|
|
3608
|
+
"updatedAt": "Recently",
|
|
3609
|
+
"categoryId": "BotInstruction"
|
|
3610
|
+
},
|
|
3578
3611
|
{
|
|
3579
3612
|
"id": "botinstruction-zep_neo4j_knowledge_graph_guide",
|
|
3580
3613
|
"title": "ZEP_NEO4J_KNOWLEDGE_GRAPH_GUIDE",
|
|
@@ -3627,6 +3660,15 @@
|
|
|
3627
3660
|
"updatedAt": "Recently",
|
|
3628
3661
|
"categoryId": "LLM"
|
|
3629
3662
|
},
|
|
3663
|
+
{
|
|
3664
|
+
"id": "llm-contextmemorydeveloperguide",
|
|
3665
|
+
"title": "ContextMemoryDeveloperGuide",
|
|
3666
|
+
"description": "",
|
|
3667
|
+
"slug": "contextmemorydeveloperguide",
|
|
3668
|
+
"author": "Documentation",
|
|
3669
|
+
"updatedAt": "Recently",
|
|
3670
|
+
"categoryId": "LLM"
|
|
3671
|
+
},
|
|
3630
3672
|
{
|
|
3631
3673
|
"id": "llm-db_migration_llm",
|
|
3632
3674
|
"title": "Db_migration_llm",
|
|
@@ -5430,8 +5472,10 @@
|
|
|
5430
5472
|
}
|
|
5431
5473
|
},
|
|
5432
5474
|
"contentPathMap": {
|
|
5475
|
+
"botinstruction-tunnel-setup": "/content/docs/BotInstruction/TUNNEL-SETUP.md",
|
|
5433
5476
|
"botinstruction-zep_neo4j_knowledge_graph_guide": "/content/docs/BotInstruction/ZEP_NEO4J_KNOWLEDGE_GRAPH_GUIDE.md",
|
|
5434
5477
|
"generators-project-generate-fullproject": "/content/docs/Generators/Project/generate-fullproject.md",
|
|
5478
|
+
"llm-contextmemorydeveloperguide": "/content/docs/LLM/ContextMemoryDeveloperGuide.md",
|
|
5435
5479
|
"llm-logger.llm": "/content/docs/LLM/Logger.llm.md",
|
|
5436
5480
|
"llm-templates_folder_and_codegen_guide": "/content/docs/LLM/TEMPLATES_FOLDER_AND_CODEGEN_GUIDE.md",
|
|
5437
5481
|
"llm-backend-proxies-services-llm": "/content/docs/LLM/backend-proxies-services-llm.md",
|
|
@@ -6392,6 +6436,21 @@
|
|
|
6392
6436
|
"name": "BotInstruction",
|
|
6393
6437
|
"path": "BotInstruction",
|
|
6394
6438
|
"children": [
|
|
6439
|
+
{
|
|
6440
|
+
"type": "file",
|
|
6441
|
+
"name": "TUNNEL-SETUP",
|
|
6442
|
+
"title": "TUNNEL SETUP",
|
|
6443
|
+
"path": "BotInstruction/TUNNEL-SETUP.md",
|
|
6444
|
+
"contentId": "botinstruction-tunnel-setup",
|
|
6445
|
+
"slug": "tunnel-setup",
|
|
6446
|
+
"categoryId": "BotInstruction",
|
|
6447
|
+
"filePath": "/content/docs/BotInstruction/TUNNEL-SETUP.md",
|
|
6448
|
+
"relativePath": "BotInstruction/TUNNEL-SETUP.md",
|
|
6449
|
+
"description": "",
|
|
6450
|
+
"author": "Documentation",
|
|
6451
|
+
"updatedAt": "Recently",
|
|
6452
|
+
"frontmatter": {}
|
|
6453
|
+
},
|
|
6395
6454
|
{
|
|
6396
6455
|
"type": "file",
|
|
6397
6456
|
"name": "ZEP_NEO4J_KNOWLEDGE_GRAPH_GUIDE",
|
|
@@ -8505,6 +8564,21 @@
|
|
|
8505
8564
|
"updatedAt": "Recently",
|
|
8506
8565
|
"frontmatter": {}
|
|
8507
8566
|
},
|
|
8567
|
+
{
|
|
8568
|
+
"type": "file",
|
|
8569
|
+
"name": "ContextMemoryDeveloperGuide",
|
|
8570
|
+
"title": "ContextMemoryDeveloperGuide",
|
|
8571
|
+
"path": "LLM/ContextMemoryDeveloperGuide.md",
|
|
8572
|
+
"contentId": "llm-contextmemorydeveloperguide",
|
|
8573
|
+
"slug": "contextmemorydeveloperguide",
|
|
8574
|
+
"categoryId": "LLM",
|
|
8575
|
+
"filePath": "/content/docs/LLM/ContextMemoryDeveloperGuide.md",
|
|
8576
|
+
"relativePath": "LLM/ContextMemoryDeveloperGuide.md",
|
|
8577
|
+
"description": "",
|
|
8578
|
+
"author": "Documentation",
|
|
8579
|
+
"updatedAt": "Recently",
|
|
8580
|
+
"frontmatter": {}
|
|
8581
|
+
},
|
|
8508
8582
|
{
|
|
8509
8583
|
"type": "file",
|
|
8510
8584
|
"name": "db_migration_llm",
|
|
@@ -10418,6 +10492,12 @@
|
|
|
10418
10492
|
"title": "BotInstruction",
|
|
10419
10493
|
"path": null,
|
|
10420
10494
|
"children": [
|
|
10495
|
+
{
|
|
10496
|
+
"title": "TUNNEL SETUP",
|
|
10497
|
+
"path": "/help/BotInstruction/tunnel-setup",
|
|
10498
|
+
"children": [],
|
|
10499
|
+
"isFile": true
|
|
10500
|
+
},
|
|
10421
10501
|
{
|
|
10422
10502
|
"title": "ZEP_NEO4J_KNOWLEDGE_GRAPH_GUIDE",
|
|
10423
10503
|
"path": "/help/BotInstruction/zep_neo4j_knowledge_graph_guide",
|
|
@@ -11082,6 +11162,12 @@
|
|
|
11082
11162
|
"children": [],
|
|
11083
11163
|
"isFile": true
|
|
11084
11164
|
},
|
|
11165
|
+
{
|
|
11166
|
+
"title": "ContextMemoryDeveloperGuide",
|
|
11167
|
+
"path": "/help/LLM/contextmemorydeveloperguide",
|
|
11168
|
+
"children": [],
|
|
11169
|
+
"isFile": true
|
|
11170
|
+
},
|
|
11085
11171
|
{
|
|
11086
11172
|
"title": "Db_migration_llm",
|
|
11087
11173
|
"path": "/help/LLM/db_migration_llm",
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# Tunnel Setup Guide (Cloudflare Tunnel)
|
|
2
|
+
|
|
3
|
+
Expose the local messenger-box dev environment to the internet using Cloudflare Tunnel (`cloudflared`).
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
brew install cloudflared
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Step 1: Start the Frontend Tunnel
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
nohup cloudflared tunnel --url http://localhost:3030 >/tmp/cf-frontend.log 2>&1 &
|
|
15
|
+
sleep 3
|
|
16
|
+
grep -o 'https://[a-z\-]*.trycloudflare.com' /tmp/cf-frontend.log
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This gives you a random URL like `https://abc-xyz.trycloudflare.com`. Copy it.
|
|
20
|
+
|
|
21
|
+
> **Note:** You do NOT need a backend tunnel. The frontend proxies `/graphql` to the backend via Vite proxy.
|
|
22
|
+
|
|
23
|
+
## Step 2: Update `config/development/dev.env`
|
|
24
|
+
|
|
25
|
+
**Enable tunnel mode** by setting `ENABLE_TUNNEL=true`:
|
|
26
|
+
|
|
27
|
+
```env
|
|
28
|
+
# Enable tunnel mode - this configures HMR to work through the tunnel
|
|
29
|
+
ENABLE_TUNNEL=true
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then replace the URLs with your tunnel URL. Keep `LOCAL_*` and `BACKEND_URL` as localhost:
|
|
33
|
+
|
|
34
|
+
```env
|
|
35
|
+
GRAPHQL_URL=https://<YOUR-TUNNEL-URL>/graphql
|
|
36
|
+
BACKEND_URL=http://localhost:9010
|
|
37
|
+
LOCAL_GRAPHQL_URL=http://localhost:9010/graphql
|
|
38
|
+
LOCAL_BACKEND_URL=http://localhost:9010
|
|
39
|
+
CLIENT_URL=https://<YOUR-TUNNEL-URL>
|
|
40
|
+
APP_URL=https://<YOUR-TUNNEL-URL>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Why this layout?**
|
|
44
|
+
|
|
45
|
+
- `GRAPHQL_URL` points to the **frontend** tunnel (not backend) so the browser sends GraphQL requests to the same origin
|
|
46
|
+
- The Vite proxy forwards `/graphql` to `localhost:9010` (the backend)
|
|
47
|
+
- This keeps session cookies on the same domain — no cross-origin issues
|
|
48
|
+
- `LOCAL_*` vars stay as localhost for server-side (SSR) requests that don't need the tunnel
|
|
49
|
+
|
|
50
|
+
## Step 3: Vite Config Changes
|
|
51
|
+
|
|
52
|
+
### File: `servers/frontend-server/vite.config.ts`
|
|
53
|
+
|
|
54
|
+
**3a. Allow all hosts** (line ~46):
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
server: {
|
|
58
|
+
allowedHosts: true,
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**3b. GraphQL proxy** — add inside `server`:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
proxy: {
|
|
65
|
+
'/graphql': {
|
|
66
|
+
target: 'http://localhost:9010',
|
|
67
|
+
changeOrigin: true,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This forwards browser GraphQL requests through the frontend to the backend. Without this, the browser would need to talk to a separate backend domain and cookies wouldn't be sent cross-origin.
|
|
73
|
+
|
|
74
|
+
**3c. HMR config** — keep default (no changes needed):
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
hmr: {
|
|
78
|
+
port: Number(config.buildConfig.__WEB_DEV_SERVER_PORT__) + 1,
|
|
79
|
+
},
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
HMR is handled via `server.js` (see Step 4).
|
|
83
|
+
|
|
84
|
+
### File: `servers/frontend-server/server.js`
|
|
85
|
+
|
|
86
|
+
**3d. HMR through the tunnel** — the Express server shares its HTTP server with Vite so HMR WebSocket runs on the same port (3030) and goes through the tunnel:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
// Create HTTP server first so Vite HMR can share the same port
|
|
90
|
+
const http = await import('http');
|
|
91
|
+
const app = express();
|
|
92
|
+
const httpServer = http.createServer(app);
|
|
93
|
+
|
|
94
|
+
const viteDevServer =
|
|
95
|
+
process.env.NODE_ENV === 'production'
|
|
96
|
+
? undefined
|
|
97
|
+
: await import('vite').then((vite) => {
|
|
98
|
+
return vite.createServer({
|
|
99
|
+
server: {
|
|
100
|
+
middlewareMode: true,
|
|
101
|
+
hmr: {
|
|
102
|
+
server: httpServer, // Attach HMR WebSocket to Express HTTP server
|
|
103
|
+
clientPort: 443, // Browser connects on 443 (tunnel uses HTTPS)
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// ... Express middleware setup ...
|
|
110
|
+
|
|
111
|
+
// Use httpServer.listen instead of app.listen
|
|
112
|
+
const port = config.buildConfig.__WEB_DEV_SERVER_PORT__ || 3030;
|
|
113
|
+
httpServer.listen(port, () => console.log(`Express server listening at http://localhost:${port}`));
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Why `hmr.server`?** Vite docs: _"When `server.hmr.server` is defined, Vite will process HMR connection requests through the provided server."_ This means HMR WebSocket shares port 3030 with Express — no separate port 3031 needed, so it works through the single Cloudflare tunnel.
|
|
117
|
+
|
|
118
|
+
**Why `clientPort: 443`?** The Cloudflare tunnel serves HTTPS on port 443. The browser's HMR client needs to connect on 443, not 3030.
|
|
119
|
+
|
|
120
|
+
### Summary of all config changes
|
|
121
|
+
|
|
122
|
+
| File | Change | Purpose |
|
|
123
|
+
| ---------------- | ----------------------------------------------- | --------------------------------------------- |
|
|
124
|
+
| `dev.env` | `ENABLE_TUNNEL=true` | Enable tunnel mode for HMR through tunnel |
|
|
125
|
+
| `vite.config.ts` | `allowedHosts: true` | Allow tunnel hostname |
|
|
126
|
+
| `vite.config.ts` | `proxy: { '/graphql': ... }` | Same-origin GraphQL (fixes cookies) |
|
|
127
|
+
| `server.js` | Conditional HMR config based on `ENABLE_TUNNEL` | HMR WebSocket shares port 3030 when tunneling |
|
|
128
|
+
|
|
129
|
+
## Step 4: Update Auth0 Allowed URLs
|
|
130
|
+
|
|
131
|
+
Go to [Auth0 Dashboard](https://manage.auth0.com) → Applications → your app → Settings:
|
|
132
|
+
|
|
133
|
+
- **Allowed Callback URLs:** add `https://<YOUR-TUNNEL-URL>/callback/`
|
|
134
|
+
- **Allowed Logout URLs:** add `https://<YOUR-TUNNEL-URL>`
|
|
135
|
+
- **Allowed Web Origins:** add `https://<YOUR-TUNNEL-URL>`
|
|
136
|
+
|
|
137
|
+
## Step 5: Restart Both Servers
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Session 1 - Backend
|
|
141
|
+
lerna exec --scope="*backend-server" yarn watch
|
|
142
|
+
|
|
143
|
+
# Session 2 - Frontend (clear vite cache first)
|
|
144
|
+
rm -rf servers/frontend-server/node_modules/.vite
|
|
145
|
+
lerna exec --scope="*frontend-server" yarn watch
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Step 6: Access & Login
|
|
149
|
+
|
|
150
|
+
1. Open `https://<YOUR-TUNNEL-URL>` in your browser
|
|
151
|
+
2. You'll be redirected to Auth0 login — log in from the tunnel URL
|
|
152
|
+
3. Auth0 redirects back to `https://<YOUR-TUNNEL-URL>/callback/`
|
|
153
|
+
4. Session cookie is set for the tunnel domain → everything works
|
|
154
|
+
|
|
155
|
+
> **Important:** Always log in through the tunnel URL. Cookies set on `localhost` won't transfer to the tunnel domain.
|
|
156
|
+
|
|
157
|
+
## HMR Behavior
|
|
158
|
+
|
|
159
|
+
| Scenario | HMR works? | Notes |
|
|
160
|
+
| -------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
161
|
+
| Edit files in `servers/frontend-server/` | ✅ Yes | Vite watches these directly |
|
|
162
|
+
| Edit files in `packages-modules/slack-ui/` | ⚠️ Partial | Requires `yarn build` in slack-ui, then Vite detects lib/ change. Page may need full reload due to module graph invalidation |
|
|
163
|
+
| Edit files in `packages/messenger-platform/` | ⚠️ Partial | Same — requires package rebuild |
|
|
164
|
+
| Through tunnel | ✅ Yes | HMR WebSocket goes through tunnel via shared HTTP server |
|
|
165
|
+
| On localhost | ✅ Yes | Works normally |
|
|
166
|
+
|
|
167
|
+
**Note:** Library packages (slack-ui, platform-client) are pre-built to `lib/`. Rebuilding them regenerates `lib/index.js` which invalidates Vite's module graph, causing a full page reload. This is a Vite limitation, not a tunnel issue.
|
|
168
|
+
|
|
169
|
+
## Reverting to Local Development
|
|
170
|
+
|
|
171
|
+
Simply set `ENABLE_TUNNEL=false` in `config/development/dev.env`:
|
|
172
|
+
|
|
173
|
+
```env
|
|
174
|
+
# Disable tunnel mode for local development
|
|
175
|
+
ENABLE_TUNNEL=false
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
And restore the original env values:
|
|
179
|
+
|
|
180
|
+
```env
|
|
181
|
+
GRAPHQL_URL=http://localhost:9010/graphql
|
|
182
|
+
BACKEND_URL=http://localhost:9010
|
|
183
|
+
LOCAL_GRAPHQL_URL=http://localhost:9010/graphql
|
|
184
|
+
LOCAL_BACKEND_URL=http://localhost:9010
|
|
185
|
+
CLIENT_URL=http://localhost:3030
|
|
186
|
+
APP_URL=http://localhost:3030
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
No code changes are needed — the server.js and vite.config.ts automatically use the appropriate HMR configuration based on the `ENABLE_TUNNEL` environment variable.
|
|
190
|
+
|
|
191
|
+
## Troubleshooting
|
|
192
|
+
|
|
193
|
+
| Issue | Fix |
|
|
194
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
195
|
+
| "Blocked request" from Vite | Ensure `allowedHosts: true` in vite.config.ts |
|
|
196
|
+
| WebSocket errors in console | Check `hmr.server` is set in server.js and `clientPort: 443` |
|
|
197
|
+
| "User not authenticated" | Cookie cross-origin issue — make sure `GRAPHQL_URL` points to the frontend tunnel (same domain), not a separate backend tunnel |
|
|
198
|
+
| Org list empty | Log in through the tunnel URL, not localhost |
|
|
199
|
+
| `EADDRINUSE ::: 3030` | Don't set `hmr.port` to 3030 in vite.config.ts — use `hmr.server` in server.js instead |
|
|
200
|
+
| `EADDRNOTAVAIL` on HMR | Don't set `hmr.host` to the tunnel hostname — it tries to bind locally to a Cloudflare IP |
|
|
201
|
+
| Tunnel URL changed | Quick tunnels get random URLs on restart. Update dev.env and Auth0 each time |
|
|
202
|
+
| "Failed to load url" after rebuild | Normal — rebuilding a library package invalidates Vite's module graph. Reload the page. |
|
|
203
|
+
|
|
204
|
+
## Optional: Stable URLs with ytunnel
|
|
205
|
+
|
|
206
|
+
For persistent tunnel URLs using your own Cloudflare domain:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
brew install yetidevworks/ytunnel
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Requires a Cloudflare account, API token, and a domain managed by Cloudflare. See https://github.com/yetidevworks/ytunnel
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Zep Memory — Developer Guide for AI-Assisted Coding
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
We use a shared **Zep memory server** (`https://zep.cdebase.dev`) as a team-wide knowledge base for GitHub Copilot (and any other LLM agent). When you solve a bug, document an architecture pattern, or figure out a non-obvious workflow, you should **store that context to Zep** so every developer (and their AI assistant) can retrieve it in future sessions.
|
|
6
|
+
|
|
7
|
+
Zep automatically extracts **facts** from stored messages and makes them searchable via semantic search — so the AI can recall project-specific knowledge without you pasting large docs into every chat.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Setup — Zep MCP Server
|
|
12
|
+
|
|
13
|
+
### 1.1 Install the MCP server (one-time)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create the MCP server directory
|
|
17
|
+
mkdir -p ~/.vscode/mcp-servers/zep-mcp
|
|
18
|
+
cd ~/.vscode/mcp-servers/zep-mcp
|
|
19
|
+
|
|
20
|
+
# Create package.json
|
|
21
|
+
cat > package.json << 'EOF'
|
|
22
|
+
{
|
|
23
|
+
"name": "zep-mcp",
|
|
24
|
+
"version": "1.0.0",
|
|
25
|
+
"private": true,
|
|
26
|
+
"type": "module",
|
|
27
|
+
"description": "MCP server for self-hosted Zep memory/knowledge API",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
EOF
|
|
33
|
+
|
|
34
|
+
npm install
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then copy the `server.mjs` file from the team shared location (ask your lead for the latest version).
|
|
38
|
+
|
|
39
|
+
### 1.2 Configure VS Code MCP
|
|
40
|
+
|
|
41
|
+
Add the Zep server to your **VS Code User MCP settings**:
|
|
42
|
+
|
|
43
|
+
**File:** `~/Library/Application Support/Code/User/mcp.json` (macOS)
|
|
44
|
+
**File:** `%APPDATA%\Code\User\mcp.json` (Windows)
|
|
45
|
+
|
|
46
|
+
```jsonc
|
|
47
|
+
{
|
|
48
|
+
"servers": {
|
|
49
|
+
"zep": {
|
|
50
|
+
"type": "stdio",
|
|
51
|
+
"command": "node",
|
|
52
|
+
"args": ["${userHome}/.vscode/mcp-servers/zep-mcp/server.mjs"],
|
|
53
|
+
"env": {
|
|
54
|
+
"ZEP_API_URL": "https://zep.cdebase.dev",
|
|
55
|
+
"ZEP_API_KEY": "emVwLXNlY3JldC1rZXktY2hhbmdlLW1lLWluLXByb2R1Y3Rpb24=",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
> **Note:** The API key is base64-encoded. The MCP server decodes it automatically.
|
|
63
|
+
|
|
64
|
+
### 1.3 Verify it works
|
|
65
|
+
|
|
66
|
+
In VS Code Copilot Chat (Agent mode), type:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Search Zep memory in session "cdebase-llm-guides" for "backend service creation"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If you get search results, you're set up correctly.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 2. Session Structure
|
|
77
|
+
|
|
78
|
+
We use a **single shared session** for team-wide knowledge:
|
|
79
|
+
|
|
80
|
+
| Session ID | Purpose |
|
|
81
|
+
| -------------------- | -------------------------------------------------------------- |
|
|
82
|
+
| `cdebase-llm-guides` | All project guides, patterns, architecture docs, bug fix notes |
|
|
83
|
+
|
|
84
|
+
> **Important:** Everyone reads from and writes to the same session. Zep handles deduplication via semantic similarity.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 3. Available MCP Tools
|
|
89
|
+
|
|
90
|
+
Your AI assistant (Copilot) has these Zep tools available:
|
|
91
|
+
|
|
92
|
+
| Tool | Description | When to Use |
|
|
93
|
+
| ---------------------- | --------------------------------------- | -------------------------------------------- |
|
|
94
|
+
| `search_memory` | Semantic search across stored knowledge | Finding existing patterns, architecture docs |
|
|
95
|
+
| `get_session_memory` | Get recent messages + extracted facts | Quick context at start of a session |
|
|
96
|
+
| `get_session_messages` | Get raw messages (paginated) | Browsing all stored guides |
|
|
97
|
+
| `add_memory` | Store new knowledge | **After completing meaningful work** |
|
|
98
|
+
| `list_sessions` | List all available sessions | Discovery |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 4. When to Store Context
|
|
103
|
+
|
|
104
|
+
Store context to Zep **after** you complete any of these:
|
|
105
|
+
|
|
106
|
+
### ✅ Always Store
|
|
107
|
+
|
|
108
|
+
- **Bug fixes** — Root cause, what was wrong, what you changed, why
|
|
109
|
+
- **Architecture decisions** — Component chains, data flow, state management patterns
|
|
110
|
+
- **Non-obvious patterns** — Things that took you time to figure out
|
|
111
|
+
- **Build/deploy workflows** — Commands, config file locations, gotchas
|
|
112
|
+
- **GraphQL schema changes** — New fragments, field additions, codegen steps
|
|
113
|
+
- **Data model documentation** — Types, relationships, optional vs required fields
|
|
114
|
+
- **Integration patterns** — How modules connect (Apollo cache, XState, Remix router, etc.)
|
|
115
|
+
|
|
116
|
+
### ❌ Don't Store
|
|
117
|
+
|
|
118
|
+
- Trivial one-line fixes
|
|
119
|
+
- Temporary debugging notes
|
|
120
|
+
- Personal preferences / IDE settings
|
|
121
|
+
- Sensitive credentials or secrets
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 5. How to Store Context
|
|
126
|
+
|
|
127
|
+
### Method 1: Ask Copilot Directly (Recommended)
|
|
128
|
+
|
|
129
|
+
At the end of your coding session, tell Copilot:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Store the following context to Zep memory session "cdebase-llm-guides":
|
|
133
|
+
|
|
134
|
+
[Describe what you worked on, the key files, patterns, and decisions]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Or more specifically:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
Save to Zep memory (session: cdebase-llm-guides) a guide about the
|
|
141
|
+
marketplace extension installation flow. Include the component chain,
|
|
142
|
+
key files, and the Apollo cache update pattern we use.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Copilot will use the `add_memory` MCP tool to store it.
|
|
146
|
+
|
|
147
|
+
### Method 2: Structured Prompt (Best for Complex Topics)
|
|
148
|
+
|
|
149
|
+
Ask Copilot to store in a structured format:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
Store the following to Zep session "cdebase-llm-guides" as a project guide:
|
|
153
|
+
|
|
154
|
+
TOPIC: [Module/Feature Name] - [Specific Aspect]
|
|
155
|
+
PROJECT: [forms-stack | adminIde-stack]
|
|
156
|
+
KEY FILES:
|
|
157
|
+
- path/to/file1.ts — what it does
|
|
158
|
+
- path/to/file2.ts — what it does
|
|
159
|
+
PATTERN/FIX:
|
|
160
|
+
[Describe the pattern, architecture, or fix in detail]
|
|
161
|
+
GOTCHAS:
|
|
162
|
+
[List any non-obvious things]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Method 3: Batch Store at End of Session
|
|
166
|
+
|
|
167
|
+
If you did significant work, tell Copilot:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
Review all the changes we made in this session and store the important
|
|
171
|
+
context to Zep memory session "cdebase-llm-guides". Include architecture
|
|
172
|
+
patterns, bug fixes, and key file locations.
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 6. Content Format Guidelines
|
|
178
|
+
|
|
179
|
+
### Keep entries focused and factual
|
|
180
|
+
|
|
181
|
+
**✅ Good:**
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
FORMS-STACK GUIDE: Apollo Cache Strategy.
|
|
185
|
+
Apollo Client auto-normalizes by __typename + id. The updateFormBuilderExtensionSchema
|
|
186
|
+
mutation returns the full FormBuilderExtension with id + metadataSchema, so Apollo
|
|
187
|
+
automatically updates the normalized cache entry. No manual readQuery/writeQuery needed.
|
|
188
|
+
SchemaBasedBuilderWrapper uses fetchPolicy: cache-only.
|
|
189
|
+
File: packages/form-builder/browser/src/components/FormBuilderV3/utils/extensionUtils.ts
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**❌ Bad:**
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
We tried a bunch of things and eventually figured out the cache was the problem.
|
|
196
|
+
I think maybe the Apollo stuff auto-updates? Not sure.
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Include file paths
|
|
200
|
+
|
|
201
|
+
Always include the **full relative path** from repo root so the AI can find files:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
File: packages/form-builder/browser/src/graphql/fragments/formBuilderExtension.gql
|
|
205
|
+
File: servers/backend-server/src/modules/form-builder-extension/form-builder-extension-repository.ts
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Use prefixes for discoverability
|
|
209
|
+
|
|
210
|
+
Start entries with a consistent prefix so semantic search works well:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
FORMS-STACK GUIDE: [Topic]
|
|
214
|
+
ADMINIDE-STACK GUIDE: [Topic]
|
|
215
|
+
DEPLOYMENT GUIDE: [Topic]
|
|
216
|
+
BUG FIX: [Module] - [Issue]
|
|
217
|
+
ARCHITECTURE: [System] - [Aspect]
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Keep entries focused
|
|
221
|
+
|
|
222
|
+
For very long guides, Copilot will split them into multiple messages automatically (up to 30 messages per request). Each message can be up to ~100K characters, so practical limits are generous.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 7. How to Retrieve Context
|
|
227
|
+
|
|
228
|
+
### At the start of a session
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
Search Zep memory in session "cdebase-llm-guides" for "form builder component chain"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### When debugging
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
Search Zep for any known issues or patterns related to "Apollo cache fetchPolicy
|
|
238
|
+
cache-only" in session "cdebase-llm-guides"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### For onboarding on a module
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
Get all Zep memory about "marketplace extension" from session "cdebase-llm-guides"
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Copilot will also search automatically
|
|
248
|
+
|
|
249
|
+
When you set up Copilot Instructions (see Section 8), the AI will automatically search Zep before answering questions about the codebase.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 8. Copilot Instructions (Optional but Recommended)
|
|
254
|
+
|
|
255
|
+
Create a `.github/copilot-instructions.md` in your repo root to tell Copilot to automatically use Zep:
|
|
256
|
+
|
|
257
|
+
```markdown
|
|
258
|
+
## Project Context
|
|
259
|
+
|
|
260
|
+
This is the [forms-stack | adminIde-stack] monorepo. Before answering questions
|
|
261
|
+
about architecture, patterns, or module-specific code, search Zep memory in session
|
|
262
|
+
"cdebase-llm-guides" for relevant context.
|
|
263
|
+
|
|
264
|
+
When completing significant work (bug fixes, new patterns, architecture changes),
|
|
265
|
+
offer to store the context to Zep memory session "cdebase-llm-guides" for the team.
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 9. Currently Stored Knowledge
|
|
271
|
+
|
|
272
|
+
As of now, the `cdebase-llm-guides` session contains **2,467+ messages** covering:
|
|
273
|
+
|
|
274
|
+
- Backend service creation patterns (Moleculer, Proxy Services, auto-generation)
|
|
275
|
+
- GraphQL schema design (module-prefixed naming, templates)
|
|
276
|
+
- Frontend Remix upgrade guide
|
|
277
|
+
- Container module patterns (Inversify DI)
|
|
278
|
+
- Forms-stack architecture (component chain, tab switching, Apollo cache, GraphQL fragments)
|
|
279
|
+
- Deployment & Jenkins pipeline patterns
|
|
280
|
+
- And more...
|
|
281
|
+
|
|
282
|
+
### Quick search examples
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
"backend proxy service auto generation"
|
|
286
|
+
"forms-stack FormBuilderV3 tab switching"
|
|
287
|
+
"GraphQL module-prefixed naming convention"
|
|
288
|
+
"Moleculer event handler decorator"
|
|
289
|
+
"Remix navigate vs replaceState"
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 10. Troubleshooting
|
|
295
|
+
|
|
296
|
+
| Issue | Fix |
|
|
297
|
+
| ---------------------------------- | -------------------------------------------------------------------------------------- |
|
|
298
|
+
| `Zep error: 401 Unauthorized` | Check your `ZEP_API_KEY` in mcp.json |
|
|
299
|
+
| MCP tools not showing | Restart VS Code, check `mcp.json` syntax |
|
|
300
|
+
| Search returns no results | Try broader search terms; facts are extracted asynchronously (wait ~30s after storing) |
|
|
301
|
+
| `add_memory` fails with size error | Split very large guides into multiple messages (max 30 per request) |
|
|
302
|
+
| Zep server unreachable | Verify VPN/network access to `https://zep.cdebase.dev` |
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Summary
|
|
307
|
+
|
|
308
|
+
1. **Setup** the Zep MCP server in your VS Code
|
|
309
|
+
2. **Search** Zep at the start of sessions for existing context
|
|
310
|
+
3. **Store** new knowledge after completing meaningful work
|
|
311
|
+
4. **Use prefixes** like `FORMS-STACK GUIDE:` or `ADMINIDE-STACK GUIDE:` for discoverability
|
|
312
|
+
5. **Include file paths** so the AI can locate code
|
|
313
|
+
6. **Keep entries factual** and focused
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdmbase/wiki-browser",
|
|
3
|
-
"version": "12.0.18-alpha.
|
|
3
|
+
"version": "12.0.18-alpha.42",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
}
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "5581cd005f724fe9685fc016e73f02848d08a328",
|
|
69
69
|
"typescript": {
|
|
70
70
|
"definition": "lib/index.d.ts"
|
|
71
71
|
}
|