@elizaos/plugin-memory 1.1.0 → 1.1.2

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.
Files changed (36) hide show
  1. package/README.md +230 -330
  2. package/dist/actions/remember.d.ts +11 -0
  3. package/dist/browser/index.browser.js +205 -348
  4. package/dist/browser/index.browser.js.map +13 -23
  5. package/dist/cjs/index.node.cjs +936 -2193
  6. package/dist/cjs/index.node.js.map +13 -23
  7. package/dist/evaluators/long-term-extraction.d.ts +8 -0
  8. package/dist/evaluators/summarization.d.ts +25 -6
  9. package/dist/index.d.ts +32 -152
  10. package/dist/node/index.node.js +944 -2210
  11. package/dist/node/index.node.js.map +13 -23
  12. package/dist/providers/context-summary.d.ts +12 -0
  13. package/dist/providers/long-term-memory.d.ts +11 -18
  14. package/dist/schemas/index.d.ts +6 -16
  15. package/dist/schemas/long-term-memories.d.ts +70 -308
  16. package/dist/schemas/memory-access-logs.d.ts +154 -0
  17. package/dist/schemas/session-summaries.d.ts +283 -0
  18. package/dist/services/memory-service.d.ts +51 -95
  19. package/dist/types/index.d.ts +53 -298
  20. package/package.json +2 -84
  21. package/dist/evaluators/consolidation.d.ts +0 -19
  22. package/dist/prompts/consolidation.d.ts +0 -35
  23. package/dist/prompts/summarization.d.ts +0 -25
  24. package/dist/providers/action-results.d.ts +0 -2
  25. package/dist/providers/recent-conversation-summary.d.ts +0 -2
  26. package/dist/repositories/conversation-summary.d.ts +0 -33
  27. package/dist/repositories/index.d.ts +0 -17
  28. package/dist/repositories/long-term-memory.d.ts +0 -53
  29. package/dist/schemas/conversation-summaries.d.ts +0 -494
  30. package/dist/utils/db-mapping.d.ts +0 -20
  31. package/dist/utils/decay-scoring.d.ts +0 -41
  32. package/dist/utils/embedding.d.ts +0 -21
  33. package/dist/utils/formatting.d.ts +0 -17
  34. package/dist/utils/index.d.ts +0 -17
  35. package/dist/utils/search-merging.d.ts +0 -18
  36. package/dist/utils/token-counter.d.ts +0 -53
@@ -1,53 +0,0 @@
1
- /**
2
- * Token Counter Utility
3
- *
4
- * Research: Section 5.1.3 "Token Budget Enforcement"
5
- *
6
- * This utility provides token counting for memory content to enforce
7
- * token budgets during retrieval. Uses a simplified estimation based on
8
- * GPT tokenization rules (1 token ≈ 4 characters for English text).
9
- *
10
- * For more precise counting, this can be replaced with a full tokenizer
11
- * library (e.g., tiktoken), but the estimation is sufficient for budget
12
- * enforcement in most cases.
13
- */
14
- /**
15
- * Estimate token count for a given text
16
- *
17
- * This is a simplified heuristic that works well for most content:
18
- * - 1 token ≈ 4 characters for English text
19
- * - Punctuation and whitespace are included
20
- * - Non-English text may have different ratios
21
- *
22
- * @param text - The text to count tokens for
23
- * @returns Estimated token count
24
- */
25
- export declare function estimateTokenCount(text: string): number;
26
- /**
27
- * Calculate token count for multiple text segments
28
- *
29
- * @param texts - Array of text strings
30
- * @returns Total estimated token count
31
- */
32
- export declare function estimateTokenCountForArray(texts: string[]): number;
33
- /**
34
- * Trim an array of items to fit within a token budget
35
- *
36
- * This function takes an array of items with text content and trims it
37
- * to fit within the specified token budget. Items are assumed to be
38
- * already sorted by priority/score (highest first).
39
- *
40
- * @param items - Array of items (with getText function)
41
- * @param budget - Maximum token budget
42
- * @param getText - Function to extract text from an item
43
- * @param includeOverhead - Additional tokens per item (formatting overhead)
44
- * @returns Trimmed array of items that fit within budget
45
- */
46
- export declare function trimToTokenBudget<T>(items: T[], budget: number, getText: (item: T) => string, includeOverhead?: number): T[];
47
- /**
48
- * Format token count for human-readable display
49
- *
50
- * @param count - Token count
51
- * @returns Formatted string (e.g., "1.2K tokens")
52
- */
53
- export declare function formatTokenCount(count: number): string;