HUSK

Memory Tools

Tools for searching, storing, listing, and deleting memories.

Search memories by semantic similarity. Returns the most relevant memories for a given query.

Cost: Embedding call + DB read (no LLM)

Parameters

ParameterTypeRequiredDescription
querystringYesThe search query
scope"session" | "project" | "global"NoFilter by scope
projectstringNoFilter by git remote / project
limitinteger (1–50)NoMax results. Default: 10
max_tokensinteger (1–100,000)NoToken budget — returns memories until budget is exhausted. Overrides limit.

Token budgeting

When max_tokens is set, HUSK fetches up to 50 results internally and returns as many as fit within the token budget. This lets the AI client say "give me as much context as you can in 2000 tokens" without having to guess a limit.

Token estimates use ~4 characters per token.

Example

{
  "query": "how do we handle date parsing",
  "scope": "project",
  "max_tokens": 2000
}

remember

Store a new memory. Checks for duplicates automatically — if a similar memory already exists, returns it instead of creating a new one.

Cost: Embedding call + vector search + DB write (no LLM)

Parameters

ParameterTypeRequiredDescription
contentstringYesThe content to remember
scope"session" | "project" | "global"NoMemory scope. Default: "session"
projectstringNoGit remote / project identifier
forcebooleanNoSkip duplicate check and store anyway
replacestringNoID of an existing memory to overwrite
ttlintegerNoTTL in seconds. 0 or omitted = scope default

Dedup behavior

When storing, HUSK embeds the content and searches for existing memories from the same user. If the closest match scores above the dedup threshold (default 0.92), the existing memory is returned with duplicate: true.

Use force: true to skip this check, or replace: "id" to explicitly overwrite a specific memory.

TTL defaults

ScopeDefault TTL
session30 days (2,592,000s)
project90 days (7,776,000s)
globalForever

Example

{
  "content": "This project uses dayjs for date parsing, not moment",
  "scope": "project",
  "project": "git@github.com:example/repo.git"
}

forget

Delete a memory by ID. Use search or list_memories first to find the ID.

Cost: DB write + vector delete (no LLM)

Parameters

ParameterTypeRequiredDescription
idstringYesThe memory ID to delete

Example

{
  "id": "550e8400-e29b-41d4-a716-446655440000"
}

list_memories

List all memories with optional filters. Returns full memory objects including IDs — useful for auditing, cleanup, or bulk review.

Cost: DB read only (no LLM)

Parameters

ParameterTypeRequiredDescription
projectstringNoFilter by git remote / project
scope"session" | "project" | "global"NoFilter by scope
limitinteger (1–200)NoMax results. Default: 50
offsetintegerNoPagination offset. Default: 0

Example

{
  "project": "git@github.com:example/repo.git",
  "scope": "project",
  "limit": 20
}

On this page