# SkillFoundry v5.5.0 Release Notes

**Release Date:** 2026-04-19
**Codename:** Hermes Intelligence
**Inspired by:** [NousResearch/hermes-agent](https://github.com/NousResearch/hermes-agent)

---

## Overview

v5.5.0 adapts three key innovations from NousResearch's Hermes Agent framework into SkillFoundry's MCP architecture: LLM-powered context summarization, agent-curated memory with nudges, and full-text session search. These features close gaps in context preservation, selective memory recording, and history retrieval.

---

## New Features

### LLM Context Summarizer

When conversation context is compacted (sliding window), pruned messages are now summarized by Haiku instead of replaced with a generic placeholder.

- **Before:** `[12 earlier messages omitted. The conversation has been compacted...]`
- **After:** A 150-200 token summary preserving decisions, tool results, file changes, and error resolutions

**Cost:** ~$0.0003 per call (Haiku is 60x cheaper than Opus for this task).

**Graceful degradation:**
- < 4 messages pruned: mechanical summary (no LLM call)
- No API key: mechanical summary with note
- LLM call fails: mechanical summary with error detail

### Memory Nudge System

After tool invocations that find issues, the framework suggests patterns worth recording:

```
---
**Memory Nudge** — Consider recording this pattern:
> Security scan found 3 vulnerability(ies). Review findings and record the fix pattern.
> *Why:* Security findings often recur across projects. Recording the fix pattern prevents the same vulnerability in future projects.
> *To record:* Use `sf_session_record` with entryType="pattern", scope="universal", tags=["security","vulnerability"]
```

**13 nudge-worthy tools monitored:** security scans, builds, tests, linters, contract checks, import validators, dependency checks, secret guard.

**Limits:** Max 10 nudges per session. Only triggers on error results with meaningful content.

### `sf_memory_search` — Full-Text Session Search

SQLite FTS5-powered search across all session history:

```
sf_memory_search({ query: "prisma migration error" })
sf_memory_search({ query: '"contract mismatch"', scope: "tools" })
sf_memory_search({ query: "auth* AND session", appName: "luxcompliancesuite" })
```

**Query syntax (FTS5):**
- Simple words: `prisma migration` — matches both
- Quoted phrases: `"contract mismatch"` — exact phrase
- Prefix: `auth*` — matches auth, authentication, authorize
- Boolean: `prisma AND migration NOT seed`

**Searches across:**
- Tool response history (every tool invocation is indexed)
- Session recordings (decisions, corrections, errors, facts, patterns)

**Features:**
- Porter stemming for intelligent matching
- Relevance-ranked results with snippet extraction
- Filter by scope, tool name, or app name

---

## Files Added

| File | Purpose |
|------|---------|
| `mcp-server/src/mcp/context-summarizer.ts` | LLM-powered summarization of pruned context |
| `mcp-server/src/mcp/memory-nudge.ts` | Post-invocation pattern detection and nudge generation |
| `mcp-server/src/mcp/session-search.ts` | FTS5 indexing and search across session history |
| `docs/V5.5.0-RELEASE-NOTES.md` | This file |

## Files Modified

| File | Change |
|------|--------|
| `mcp-server/src/mcp/handler.ts` | FTS indexing in tracked(), memory nudge injection, sf_memory_search tool |
| `mcp-server/src/server.ts` | FTS5 table initialization at startup |
| Version files (8 locations) | 5.4.0 -> 5.5.0 |
| `README.md` | What's New section |
| `CHANGELOG.md` | v5.5.0 entry |
| `site/index.html` | Version badge, hero, footer |
| `site/pages/resources-changelog.html` | Version references |

---

## Database Changes

**New table:**
```sql
CREATE TABLE IF NOT EXISTS tool_response_log (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  session_id TEXT NOT NULL,
  tool_name TEXT NOT NULL,
  response_summary TEXT NOT NULL,  -- first 2000 chars
  is_error INTEGER NOT NULL DEFAULT 0,
  created_at TEXT NOT NULL DEFAULT (datetime('now'))
);
```

**New FTS5 virtual tables:**
```sql
CREATE VIRTUAL TABLE IF NOT EXISTS tool_response_fts USING fts5(
  tool_name, response_summary,
  content='tool_response_log', content_rowid='id',
  tokenize='porter unicode61'
);

CREATE VIRTUAL TABLE IF NOT EXISTS session_recordings_fts USING fts5(
  content, context, tags, app_name,
  content='session_recordings', content_rowid='id',
  tokenize='porter unicode61'
);
```

Auto-sync triggers maintain FTS indexes on INSERT.

**Migration:** None required. All tables are auto-created at startup.

---

## Upgrade Instructions

```bash
git pull
cd mcp-server && npm run build
pm2 restart skillfoundry-mcp
```

---

## Compatibility

- No breaking changes
- Memory nudges are informational only (appended text, not schema changes)
- FTS5 requires SQLite 3.9.0+ (standard on all modern systems)
- Context summarizer requires `ANTHROPIC_API_KEY` for LLM summaries; falls back gracefully without it
