nexo-brain 7.31.9 → 7.31.10

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,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "7.31.9",
3
+ "version": "7.31.10",
4
4
  "description": "Local cognitive runtime for Claude Code \u2014 persistent memory, overnight learning, doctor diagnostics, personal scripts, recovery-aware jobs, startup preflight, and optional dashboard/power helper.",
5
5
  "author": {
6
6
  "name": "NEXO Brain",
package/README.md CHANGED
@@ -18,7 +18,9 @@
18
18
 
19
19
  [Watch the overview video](https://nexo-brain.com/watch/) · [Watch on YouTube](https://www.youtube.com/watch?v=i2lkGhKyVqI) · [Open the infographic](https://nexo-brain.com/assets/nexo-brain-infographic-v5.png)
20
20
 
21
- Version `7.31.9` is the current packaged-runtime line. Patch release over v7.31.8 - UI release closeout now has to prove the original reported symptom was reopened with observable evidence before claiming the release is ready.
21
+ Version `7.31.10` is the current packaged-runtime line. Patch release over v7.31.9 - Local Memory search now downranks boilerplate emails when stronger documents match the same query.
22
+
23
+ Previously in `7.31.9`: patch release over v7.31.8 - UI release closeout now has to prove the original reported symptom was reopened with observable evidence before claiming the release is ready.
22
24
 
23
25
  Previously in `7.31.8`: patch release over v7.31.7 - email monitor debt scans no longer escalate intentionally waiting threads as unresolved commitments when recent resolution or hot-context state proves the thread is waiting on the user or a third party. Real unresolved commitments still surface.
24
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "7.31.9",
3
+ "version": "7.31.10",
4
4
  "mcpName": "io.github.wazionapps/nexo",
5
5
  "description": "NEXO Brain — Shared brain for AI agents. Persistent memory, semantic RAG, natural forgetting, metacognitive guard, trust scoring, 150+ MCP tools. Works with Claude Code, Codex, Claude Desktop & any MCP client. 100% local, free.",
6
6
  "homepage": "https://nexo-brain.com",
@@ -4101,6 +4101,118 @@ def _search_text_score(query: str, text: str) -> float:
4101
4101
  return len(q & tokens) / max(len(q), 1)
4102
4102
 
4103
4103
 
4104
+ _CONTEXT_STRONG_DOCUMENT_TERMS = {
4105
+ "acuerdo",
4106
+ "agreement",
4107
+ "balance",
4108
+ "certificado",
4109
+ "comunicado",
4110
+ "contract",
4111
+ "contrato",
4112
+ "declaracion",
4113
+ "declaración",
4114
+ "factura",
4115
+ "invoice",
4116
+ "nomina",
4117
+ "nómina",
4118
+ "payroll",
4119
+ "presupuesto",
4120
+ "quote",
4121
+ "transferencia",
4122
+ }
4123
+
4124
+
4125
+ _CONTEXT_BOILERPLATE_TERMS = {
4126
+ "-ms-text-size-adjust",
4127
+ "-webkit-text-size-adjust",
4128
+ "body, table",
4129
+ "cancelar suscripcion",
4130
+ "cancelar suscripción",
4131
+ "css",
4132
+ "newsletter",
4133
+ "no puedes ver el correo",
4134
+ "politica de privacidad",
4135
+ "política de privacidad",
4136
+ "unsubscribe",
4137
+ "version web",
4138
+ "versión web",
4139
+ }
4140
+
4141
+
4142
+ _CONTEXT_MARKETING_TERMS = {
4143
+ "bajan los precios",
4144
+ "campaña",
4145
+ "descuento",
4146
+ "encuesta satisfaccion",
4147
+ "encuesta satisfacción",
4148
+ "hazte con tu regalo",
4149
+ "oferta",
4150
+ "promocion",
4151
+ "promoción",
4152
+ "prueba gratis",
4153
+ "satisfaccion clientes",
4154
+ "satisfacción clientes",
4155
+ "view online",
4156
+ }
4157
+
4158
+
4159
+ _CONTEXT_LOW_SIGNAL_EMAIL_TERMS = {
4160
+ "acceso bloqueado",
4161
+ "actividad inusual",
4162
+ "bloqueada temporalmente",
4163
+ "cuenta esta en revision",
4164
+ "cuenta está en revisión",
4165
+ }
4166
+
4167
+
4168
+ def _contains_any_text(text: str, terms: set[str]) -> bool:
4169
+ if not text:
4170
+ return False
4171
+ return any(term in text for term in terms)
4172
+
4173
+
4174
+ def _context_quality_adjusted_score(score: float, row: Any) -> float:
4175
+ """Apply deterministic tie-breaks for local search candidates.
4176
+
4177
+ The base scorer is intentionally simple, which can make boilerplate emails
4178
+ tie with PDFs/contracts when a query has a few common terms. Keep this
4179
+ adjustment small and explainable: strong document signals stay high, while
4180
+ newsletter/CSS/legal-footer noise loses the tie.
4181
+ """
4182
+ try:
4183
+ path = str(row["path"] or "")
4184
+ file_type = str(row["file_type"] or "").strip().lower()
4185
+ text = str(row["text"] or "")
4186
+ summary = str(row["summary"] or "")
4187
+ except Exception:
4188
+ return max(0.0, min(float(score), 1.6))
4189
+
4190
+ haystack = f"{path}\n{summary}\n{text}".lower()
4191
+ suffix = Path(path).suffix.lower()
4192
+ adjustment = 0.0
4193
+
4194
+ if suffix in HIGH_VALUE_DOCUMENT_SUFFIXES or file_type in {"document", "spreadsheet", "presentation"}:
4195
+ adjustment += 0.12
4196
+ has_strong_document_signal = _contains_any_text(haystack, _CONTEXT_STRONG_DOCUMENT_TERMS)
4197
+ if has_strong_document_signal:
4198
+ adjustment += 0.12
4199
+
4200
+ if file_type == "email" or suffix in EMAIL_DOCUMENT_SUFFIXES:
4201
+ if _contains_any_text(haystack, _CONTEXT_BOILERPLATE_TERMS):
4202
+ adjustment -= 0.22
4203
+ if _contains_any_text(haystack, _CONTEXT_MARKETING_TERMS):
4204
+ adjustment -= 0.18
4205
+ if _contains_any_text(haystack, _CONTEXT_LOW_SIGNAL_EMAIL_TERMS):
4206
+ adjustment -= 0.16
4207
+ if has_strong_document_signal:
4208
+ adjustment += 0.08
4209
+ else:
4210
+ adjustment -= 0.22
4211
+
4212
+ base = min(float(score), 1.6)
4213
+ return max(0.0, min(base + adjustment, 1.6))
4214
+
4215
+
4104
4216
  _QUERY_STOPWORDS = {
4105
4217
  "about",
4106
4218
  "archivos",
@@ -4739,7 +4851,7 @@ def _context_query_conn(
4739
4851
  # unrelated chunks from a long document outrank direct evidence.
4740
4852
  score = max(score, min(0.48, 0.28 + entity_score * 0.2))
4741
4853
  if score > 0:
4742
- scored.append((min(float(score), 1.6), row))
4854
+ scored.append((_context_quality_adjusted_score(float(score), row), row))
4743
4855
  scored.sort(key=lambda item: item[0], reverse=True)
4744
4856
  scored = _rerank_scored_candidates(search_query, scored, limit=int(limit))
4745
4857
  assets = []