{
  "interval": {
    "intervalStart": "2026-01-10T00:00:00.000Z",
    "intervalEnd": "2026-01-11T00:00:00.000Z",
    "intervalType": "day"
  },
  "repository": "elizaos/eliza",
  "overview": "From 2026-01-10 to 2026-01-11, elizaos/eliza had 0 new PRs (0 merged), 0 new issues, and 2 active contributors.",
  "topIssues": [],
  "topPRs": [
    {
      "id": "PR_kwDOMT5cIs67jFlF",
      "title": "feat(plugin-sql): add CachedDatabaseAdapter with LRU caching and serv…",
      "author": "0xbbjoker",
      "number": 6329,
      "body": "DRAFT PR. DO NOT MERGE. \n\n<!-- CURSOR_SUMMARY -->\n---\n\n> [!NOTE]\n> Introduces a caching wrapper and runtime optimization to reduce DB and model calls.\n> \n> - **New `CachedDatabaseAdapter`**: L1 in-memory LRU with optional L2 external cache; read-through on misses, targeted invalidation on mutations; supports agents, entities, rooms, worlds, participants, components, relationships, tasks; passthrough for high-volume memory ops; exposed via `index.ts`.\n> - **External cache support**: Pluggable adapter interface with key prefixing; factory `createCachedAdapter`.\n> - **Runtime optimization**: `AgentRuntime` now caches embedding dimension; adds `getEmbeddingDimension()`/`setEmbeddingDimension()` (validated against `VECTOR_DIMS`); init uses pre-set dimension or falls back to probing when embedding model exists.\n> - **Tests**: Extensive integration coverage (TTL expiry, invalidation paths, batch ops, external cache) in `cached-adapter.test.ts`.\n> \n> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0ca8e4e8afb9838c82f799ca1afd450cb67eac91. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>\n<!-- /CURSOR_SUMMARY -->\n\n<!-- greptile_comment -->\n\n<h3>Greptile Summary</h3>\n\n\nThis PR adds a `CachedDatabaseAdapter` wrapper that provides LRU caching with optional external cache support (Redis/Upstash) for serverless environments, plus embedding dimension caching in the runtime to avoid redundant model calls.\n\n**Key Changes:**\n- New `CachedDatabaseAdapter` class implementing two-tier caching strategy (in-memory L1 + optional external L2)\n- Runtime embedding dimension is now cached and can be pre-configured via `setEmbeddingDimension()`\n- Automatic cache invalidation on mutations (updates, deletes, creates)\n- Comprehensive test coverage (1,530 lines) covering all caching scenarios, TTL expiration, and external cache integration\n- Smart invalidation strategy: individual entity caches are updated on mutation, while aggregate caches (like `entitiesForRoom`) are cleared\n\n**Cache Strategy:**\n- Read-through caching: Check L1 → L2 → Database, populating caches on miss\n- Write-through invalidation: Mutations invalidate affected cache entries\n- Configurable TTL per cache type with LRU eviction\n- Memory operations (high volume) are NOT cached to avoid excessive memory usage\n\n**Note:** This is marked as a DRAFT PR and should NOT be merged yet.\n\n<h3>Confidence Score: 3/5</h3>\n\n\n- This PR introduces significant caching infrastructure but has syntax issues and potential logic bugs that need resolution before merging\n- Score reflects excellent test coverage and well-designed caching architecture, but is reduced due to: (1) syntax errors in optional method declarations that will cause TypeScript compilation issues, (2) unsafe type casting in `createAgent` that could cache incomplete data, and (3) this being a DRAFT PR explicitly marked \"DO NOT MERGE\". The core caching logic is sound and thoroughly tested, but the syntax issues must be fixed for production readiness.\n- `packages/plugin-sql/src/cached-adapter.ts` requires syntax fixes for optional method declarations (lines 870-909) and logic review for type casting on line 297\n\n<h3>Important Files Changed</h3>\n\n\n\n\n| Filename | Overview |\n|----------|----------|\n| packages/core/src/runtime.ts | Added embedding dimension caching with getter/setter methods to optimize serverless environments by avoiding redundant model calls |\n| packages/plugin-sql/src/cached-adapter.ts | New LRU cache wrapper for database adapter with two-tier caching (in-memory + optional external cache like Redis/Upstash) for serverless optimization |\n| packages/plugin-sql/src/__tests__/integration/cached-adapter.test.ts | Comprehensive integration tests covering all caching scenarios, invalidation logic, TTL expiration, and external cache adapter support |\n| packages/plugin-sql/src/index.ts | Exported new cached adapter types and factory function for public API |\n\n</details>\n\n\n\n<h3>Sequence Diagram</h3>\n\n```mermaid\nsequenceDiagram\n    participant Runtime as AgentRuntime\n    participant CachedAdapter as CachedDatabaseAdapter\n    participant L1Cache as In-Memory LRU Cache\n    participant L2Cache as External Cache (Redis/Upstash)\n    participant BaseAdapter as Base Database Adapter\n    participant DB as PostgreSQL/PGLite\n\n    Note over Runtime: Initialization\n    Runtime->>Runtime: Check embeddingDimension cache\n    alt Pre-configured dimension\n        Runtime->>CachedAdapter: ensureEmbeddingDimension(dimension)\n        CachedAdapter->>BaseAdapter: ensureEmbeddingDimension(dimension)\n        BaseAdapter->>DB: Configure vector dimension\n    else Dimension not cached\n        Runtime->>Runtime: getModel(TEXT_EMBEDDING)\n        Runtime->>Runtime: Generate test embedding\n        Runtime->>Runtime: Cache embedding.length\n        Runtime->>CachedAdapter: ensureEmbeddingDimension(embedding.length)\n        CachedAdapter->>BaseAdapter: ensureEmbeddingDimension(embedding.length)\n        BaseAdapter->>DB: Configure vector dimension\n    end\n\n    Note over Runtime,DB: Read Operations (Cache Hit)\n    Runtime->>CachedAdapter: getAgent(agentId)\n    CachedAdapter->>L1Cache: get(agentId)\n    L1Cache-->>CachedAdapter: Agent data\n    CachedAdapter-->>Runtime: Agent data\n\n    Note over Runtime,DB: Read Operations (L1 Miss, L2 Hit)\n    Runtime->>CachedAdapter: getRoom(roomId)\n    CachedAdapter->>L1Cache: get(roomId)\n    L1Cache-->>CachedAdapter: undefined\n    CachedAdapter->>L2Cache: get(cacheKey)\n    L2Cache-->>CachedAdapter: Room data\n    CachedAdapter->>L1Cache: set(roomId, room)\n    CachedAdapter-->>Runtime: Room data\n\n    Note over Runtime,DB: Read Operations (Cache Miss)\n    Runtime->>CachedAdapter: getEntity(entityId)\n    CachedAdapter->>L1Cache: get(entityId)\n    L1Cache-->>CachedAdapter: undefined\n    CachedAdapter->>L2Cache: get(cacheKey)\n    L2Cache-->>CachedAdapter: undefined\n    CachedAdapter->>BaseAdapter: getEntity(entityId)\n    BaseAdapter->>DB: SELECT entity\n    DB-->>BaseAdapter: Entity data\n    BaseAdapter-->>CachedAdapter: Entity data\n    CachedAdapter->>L1Cache: set(entityId, entity)\n    CachedAdapter->>L2Cache: set(cacheKey, entity, ttl)\n    CachedAdapter-->>Runtime: Entity data\n\n    Note over Runtime,DB: Write Operations (Cache Invalidation)\n    Runtime->>CachedAdapter: updateAgent(agentId, updates)\n    CachedAdapter->>BaseAdapter: updateAgent(agentId, updates)\n    BaseAdapter->>DB: UPDATE agent\n    DB-->>BaseAdapter: Success\n    BaseAdapter-->>CachedAdapter: Success\n    CachedAdapter->>L1Cache: delete(agentId)\n    CachedAdapter->>L2Cache: delete(cacheKey)\n    CachedAdapter-->>Runtime: Success\n\n    Note over Runtime,DB: Batch Operations\n    Runtime->>CachedAdapter: getRoomsByIds([id1, id2, id3])\n    CachedAdapter->>L1Cache: get(id1)\n    L1Cache-->>CachedAdapter: Room1\n    CachedAdapter->>L1Cache: get(id2)\n    L1Cache-->>CachedAdapter: undefined\n    CachedAdapter->>L1Cache: get(id3)\n    L1Cache-->>CachedAdapter: undefined\n    CachedAdapter->>BaseAdapter: getRoomsByIds([id2, id3])\n    BaseAdapter->>DB: SELECT rooms WHERE id IN (...)\n    DB-->>BaseAdapter: [Room2, Room3]\n    BaseAdapter-->>CachedAdapter: [Room2, Room3]\n    CachedAdapter->>L1Cache: set(id2, Room2)\n    CachedAdapter->>L1Cache: set(id3, Room3)\n    CachedAdapter-->>Runtime: [Room1, Room2, Room3]\n```\n\n<!-- greptile_other_comments_section -->\n\n<!-- /greptile_comment -->",
      "repository": "elizaos/eliza",
      "createdAt": "2026-01-05T14:54:36Z",
      "mergedAt": null,
      "additions": 2594,
      "deletions": 7
    }
  ],
  "codeChanges": {
    "additions": 0,
    "deletions": 0,
    "files": 0,
    "commitCount": 12
  },
  "completedItems": [],
  "topContributors": [
    {
      "username": "madjin",
      "avatarUrl": "https://avatars.githubusercontent.com/u/32600939?u=cdcf89f44c7a50906c7a80d889efa85023af2049&v=4",
      "totalScore": 0.2,
      "prScore": 0,
      "issueScore": 0,
      "reviewScore": 0,
      "commentScore": 0.2,
      "summary": "madjin: Focused on significant feature development and bug fixes, modifying 47 files with substantial code changes (+3776/-348 lines) across 11 commits, and also provided a PR comment."
    }
  ],
  "newPRs": 0,
  "mergedPRs": 0,
  "newIssues": 0,
  "closedIssues": 0,
  "activeContributors": 2
}