documentation update
This commit is contained in:
@@ -205,6 +205,9 @@ Returns `503` if llama-server is unreachable.
|
||||
| `scoreThreshold` | float | 0–1 | Minimum similarity score for Qdrant results |
|
||||
| `semanticWeight` | float | 0–5 | RRF weight for Qdrant semantic results |
|
||||
| `keywordWeight` | float | 0–5 | RRF weight for FTS5 keyword results (`0` = disabled) |
|
||||
| `contextBudget` | integer | — | Token budget for context assembly (char/4 estimation) |
|
||||
| `entityWeight` | float | — | Scoring bonus for entity-linked episodes in the context pool |
|
||||
| `minRecentEpisodes` | integer | — | Guaranteed floor of recent episodes always included in context |
|
||||
| `modelsFolderPath` | string | — | Path to folder containing .gguf files |
|
||||
| `temperature` | float | 0–2 | Inference randomness |
|
||||
| `repeatPenalty` | float | 1–2 | Repeat token penalty |
|
||||
@@ -253,6 +256,7 @@ orchestration.
|
||||
| GET | /sessions/by-external/:externalId | Get session by external ID |
|
||||
| PATCH | /sessions/by-external/:externalId | Update session fields |
|
||||
| DELETE | /sessions/by-external/:externalId | Delete session (cascades to episodes) |
|
||||
| GET | /sessions/:id/entity-ids | Entity IDs linked to this session's episodes (non-project memory isolation scoping) |
|
||||
|
||||
> Route ordering: `by-external/:externalId` must be defined before `/:id`
|
||||
> to prevent `by-external` being captured as an ID param.
|
||||
@@ -279,6 +283,8 @@ Both fields are optional. Only provided fields are updated.
|
||||
| GET | /sessions/:id/episodes?limit=&offset= | Paginated episodes for a session |
|
||||
| GET | /sessions/:id/episode-stats | Aggregate: count, total tokens, max id (summarization threshold check) |
|
||||
| GET | /sessions/:id/episodes/since/:afterId | Episodes newer than :afterId, chronological (un-summarized tail) |
|
||||
| POST | /episodes/touch | Batch access-tracking bump — increments `access_count`, sets `last_accessed_at` |
|
||||
| GET | /sessions/:id/consolidation-candidates | Dry-run consolidation scoring (aging score, floors applied) |
|
||||
| DELETE | /episodes/:id | Delete episode (SQLite + Qdrant cleanup) |
|
||||
|
||||
> Route ordering: `/episodes/search` must be defined before `/episodes/:id`.
|
||||
@@ -293,6 +299,21 @@ Both fields are optional. Only provided fields are updated.
|
||||
}
|
||||
```
|
||||
|
||||
**POST /episodes/touch — body:**
|
||||
```json
|
||||
{ "ids": [54, 55, 56] }
|
||||
```
|
||||
Returns `{ "touched": 3 }`. Called fire-and-forget by orchestration after
|
||||
budget selection. Nonexistent IDs are silently skipped; `touched` echoes the
|
||||
request count, not rows matched.
|
||||
|
||||
**GET /sessions/:id/consolidation-candidates** — returns
|
||||
`{ eligible, reason?, candidates: [...] }` where each candidate is
|
||||
`{ id, access_count, created_at, last_accessed_at, preview, aging_score }`,
|
||||
sorted by `aging_score` ascending (most eligible first). Sessions under
|
||||
`CONSOLIDATION.MIN_SESSION_EPISODES` return `eligible: false` with a `reason`.
|
||||
Observe-only — nothing is modified.
|
||||
|
||||
### Projects
|
||||
|
||||
| Method | Path | Description |
|
||||
|
||||
@@ -18,6 +18,7 @@ npm test # = node --test (discovers test/*.test.js at the repo root)
|
||||
| `test/summarization.test.js` | Summarization decision logic | `maybeSummarize` (orchestration) |
|
||||
| `test/entity-extraction.test.js` | Greeting + regurgitation guards | `mentionedIn`, `isIgnoredName` (memory-service) |
|
||||
| `test/schema.test.js` | Fresh-DB schema completeness | `schema.js` string (memory-service) |
|
||||
| `test/trivial-turn.test.js` | Greeting/trivial-turn detection | `isTrivialTurn` (shared) |
|
||||
| `test/migrations.test.js` | Migration version-stepping | `migrate` (memory-service) |
|
||||
|
||||
Tests import the **real** functions rather than reimplementing logic — the
|
||||
@@ -44,3 +45,10 @@ Keep the pattern: export the real function, import it, mock I/O at the boundary
|
||||
logic (ranking, tokenizing, version-stepping, decision branches) over wiring.
|
||||
Several of these tests were written *after* a bug slipped through — each new
|
||||
class of mistake is worth a case so it can't recur silently.
|
||||
|
||||
When a mocked service call changes shape (e.g. the `utilityInference` refactor
|
||||
moving summarization from Ollama's `/api/generate` to the inference service's
|
||||
`/utility/complete`), the mock URL router must move with it — an "unexpected
|
||||
fetch" throw in these tests usually means the code under test evolved, not
|
||||
broke. Runner-contract tests (migrations) inject stub no-op migration arrays
|
||||
rather than letting the real SQL-bearing migrations hit the minimal fake db.
|
||||
|
||||
Reference in New Issue
Block a user