kyp-mem 0.6.4 → 0.6.5
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/kyp_mem/hooks.py +4 -0
- package/kyp_mem/ui.py +2 -0
- package/kyp_mem/vault.py +8 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/kyp_mem/hooks.py
CHANGED
|
@@ -157,6 +157,10 @@ def handle_session_start():
|
|
|
157
157
|
stats_line = _build_stats_line(project_name, len("\n".join(parts)), session_ids)
|
|
158
158
|
if stats_line:
|
|
159
159
|
parts.append(stats_line)
|
|
160
|
+
|
|
161
|
+
parts.append("")
|
|
162
|
+
parts.append("**INSTRUCTION:** Display the session summaries and token savings above to the user as your first message at session start. Format it cleanly.")
|
|
163
|
+
|
|
160
164
|
output = "\n".join(parts)
|
|
161
165
|
|
|
162
166
|
try:
|
package/kyp_mem/ui.py
CHANGED
|
@@ -27,6 +27,7 @@ def create_app(vault_path: str = None) -> FastAPI:
|
|
|
27
27
|
|
|
28
28
|
@app.get("/api/stats")
|
|
29
29
|
def stats():
|
|
30
|
+
vault.refresh_if_stale()
|
|
30
31
|
return JSONResponse(vault.get_stats())
|
|
31
32
|
|
|
32
33
|
@app.get("/api/graph")
|
|
@@ -199,6 +200,7 @@ def create_app(vault_path: str = None) -> FastAPI:
|
|
|
199
200
|
|
|
200
201
|
@app.get("/api/sessions")
|
|
201
202
|
def list_sessions(project: str = ""):
|
|
203
|
+
vault.refresh_if_stale()
|
|
202
204
|
sessions = {}
|
|
203
205
|
for path, note in vault.index.notes.items():
|
|
204
206
|
if "/Sessions/" not in path and not path.startswith("Sessions/"):
|
package/kyp_mem/vault.py
CHANGED
|
@@ -211,6 +211,14 @@ class Vault:
|
|
|
211
211
|
self._load_all()
|
|
212
212
|
self._sync_vector_db()
|
|
213
213
|
|
|
214
|
+
def _disk_note_paths(self) -> set[str]:
|
|
215
|
+
return {str(f.relative_to(self.root)) for f in self.root.rglob("*.md")}
|
|
216
|
+
|
|
217
|
+
def refresh_if_stale(self):
|
|
218
|
+
if self._disk_note_paths() != set(self.index.notes.keys()):
|
|
219
|
+
self._load_all()
|
|
220
|
+
self._sync_vector_db()
|
|
221
|
+
|
|
214
222
|
def _sync_vector_db(self):
|
|
215
223
|
mem = get_session_memory()
|
|
216
224
|
for path, note in self.index.notes.items():
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kyp-mem",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Know Your Project — Persistent & Session level knowledge base for AI agents. MCP-powered with wikilinks, backlinks, auto-learning, and neon web UI.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"kyp-mem": "bin/cli.mjs"
|
package/pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kyp-mem"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.5"
|
|
8
8
|
description = "Know Your Project — Persistent knowledge base for AI agents. MCP-powered with wikilinks, backlinks, auto-learning, and neon web UI."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|