Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/memos-local-plugin/core/pipeline/memory-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3362,7 +3362,7 @@ export function createMemoryCore(
includeAllNamespaces?: boolean;
}): Promise<number> {
ensureLive();
return handle.repos.skills.list({ status: input?.status, limit: 5_000 }).filter((r) =>
return handle.repos.skills.list({ status: input?.status, limit: 100_000 }).filter((r) =>
(input?.includeAllNamespaces || visibleToCurrent(r)) && matchesNamespaceFilter(r, input)
).length;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/memos-local-plugin/core/storage/repos/_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function buildPageClauses(opts: PageOptions | undefined, tsColumn: string

export function clampLimit(n: number): number {
if (!Number.isFinite(n) || n <= 0) return 50;
return Math.min(Math.trunc(n), 10_000);
return Math.min(Math.trunc(n), 100_000);
}

export function timeRangeWhere(
Expand Down
55 changes: 31 additions & 24 deletions apps/memos-local-plugin/server/routes/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,49 @@ export function registerOverviewRoutes(routes: Routes, deps: ServerDeps): void {
// headless callers. Routing the ping through the viewer's mount
// hook keeps the semantics honest (a browser actually opened
// the page) and is naturally deduped by browser tab lifetime.
const [health, episodeIds, skills, policies, worldModels, metrics] =
await Promise.all([
deps.core.health(),
deps.core.listEpisodes({ limit: 5_000 }),
deps.core.listSkills({ limit: 500 }),
// Core only exposes `listPolicies({ status? })`; the viewer wants
// the grand total + per-status so we request the biggest page and
// break it down here. 500 is plenty — fresh installs have dozens.
deps.core.listPolicies({ limit: 500 }),
deps.core.listWorldModels({ limit: 500 }),
// `metrics.total` is the grand total of traces — cheaper than a
// dedicated count RPC and already cached by the core.
deps.core.metrics({ days: 1 }),
]);
const [
health,
episodeCount,
skillActive, skillCandidate, skillArchived,
policyActive, policyCandidate, policyArchived,
worldModelCount,
metrics,
] = await Promise.all([
deps.core.health(),
deps.core.countEpisodes(),
deps.core.countSkills({ status: "active" }),
deps.core.countSkills({ status: "candidate" }),
deps.core.countSkills({ status: "archived" }),
deps.core.countPolicies({ status: "active" }),
deps.core.countPolicies({ status: "candidate" }),
deps.core.countPolicies({ status: "archived" }),
deps.core.countWorldModels(),
// `metrics.total` is the grand total of traces — cheaper than a
// dedicated count RPC and already cached by the core.
deps.core.metrics({ days: 1 }),
]);

const skillStats = {
total: skills.length,
active: skills.filter((s) => s.status === "active").length,
candidate: skills.filter((s) => s.status === "candidate").length,
archived: skills.filter((s) => s.status === "archived").length,
total: skillActive + skillCandidate + skillArchived,
active: skillActive,
candidate: skillCandidate,
archived: skillArchived,
};
const policyStats = {
total: policies.length,
active: policies.filter((p) => p.status === "active").length,
candidate: policies.filter((p) => p.status === "candidate").length,
archived: policies.filter((p) => p.status === "archived").length,
total: policyActive + policyCandidate + policyArchived,
active: policyActive,
candidate: policyCandidate,
archived: policyArchived,
};

return {
ok: health.ok,
version: health.version,
episodes: episodeIds.length,
episodes: episodeCount,
traces: metrics.total,
skills: skillStats,
policies: policyStats,
worldModels: worldModels.length,
worldModels: worldModelCount,
llm: health.llm,
embedder: health.embedder,
skillEvolver: health.skillEvolver,
Expand Down