Files
librefang-registry/plugins/keyword-memory/README.md
T
Evan Hu afcb260554 feat: add 6 production-ready plugins
All plugins are stdlib-only Python with no external dependencies.

- auto-summarizer: extractive conversation summary for long context
  compression, persists per-agent summaries to disk
- conversation-logger: JSONL audit logs per agent with ISO 8601
  timestamps, auto-creates log directory tree
- guardrails: safety filter detecting PII (email, phone, SSN, CC),
  prompt injection patterns, and credential exposure via regex
- keyword-memory: extracts entities (emails, URLs, dates, technical
  terms like camelCase/snake_case/dotted identifiers) as memories
- sentiment-tracker: keyword-based sentiment scoring with intensifiers
  and negation handling, only injects context for non-neutral sentiment
- todo-tracker: detects action items via 7 task patterns, tracks
  completion, deduplicates, persists per-agent with 20-item FIFO limit
2026-03-21 02:51:58 +09:00

33 lines
1.2 KiB
Markdown

# keyword-memory
Extracts keywords and named entities from user messages and returns them as contextual memories. Gives agents awareness of conversation topics without requiring external NLP libraries.
## Extraction Techniques
- **Plain keywords**: Splits words, filters English stopwords (~50 words), removes short tokens
- **Capitalized phrases**: Detects multi-word proper nouns and mid-sentence capitalized words
- **Emails and URLs**: Regex pattern matching
- **Numbers with units**: e.g. 500ms, 10GB, 3.5GHz
- **Dates**: YYYY-MM-DD, MM/DD/YYYY, DD.MM.YYYY formats
- **Technical terms**: camelCase, snake_case, dotted identifiers (e.g. `os.path`)
Results are deduplicated and capped at 10 keywords.
## Hooks
| Hook | Script | Description |
|------|--------|-------------|
| ingest | `hooks/ingest.py` | Extracts keywords from the user message and returns them as a memory fragment |
## Example Output
```json
{"type": "ingest_result", "memories": [{"content": "[keyword-memory] Key topics: GPT-4, machine_learning, data pipeline, https://example.com"}]}
```
If no meaningful keywords are found, returns an empty memories list.
## Usage
Installed automatically when enabled in agent configuration. No external dependencies required (stdlib only).