
Skill
tanstack-ai-memory-in-memory
wire TanStack AI in-memory adapter
Description
Use when wiring inMemory() from @tanstack/ai-memory/in-memory — explains setup, options (embedder, extract, topK/minScore), when to pick it (dev/tests/single-process demos), and what NOT to use it for (multi-process or persistent).
SKILL.md
In-Memory Memory Adapter
Zero-dependency recall/save adapter backed by a Map. Records vanish on process
restart.
When to use it
- Local development.
- Vitest / Playwright tests.
- Single-process demos where users don't need persistence.
When NOT to use it
- Production multi-process deployments — every worker has its own
Map; users get inconsistent memory. - Anything that needs survival across restarts.
For production, use redis() (see the tanstack-ai-memory-redis skill).
Setup
import { memoryMiddleware } from '@tanstack/ai-memory'
import { inMemory } from '@tanstack/ai-memory/in-memory'
const memory = inMemory()
memoryMiddleware({ adapter: memory, scope })
Options
inMemory(options?) accepts:
topK(default 6),minScore(default 0.15),kinds— recall tuning.embedder: { embed(text): Promise<number[]> }— enable semantic scoring (bothrecallandsaveembed through it).extract(turn, scope)— return derived facts to persist alongside the raw turn (e.g. call an LLM to pull out preferences). Without it,savestores the raw user/assistant messages andrecallscores them lexically + by recency.render(hits)— replace the built-in prompt renderer.
Capacity
The adapter scans every record in a scope per recall. Fine up to ~100k records; beyond
that, switch to Redis.
More skills from the ai repository
View all 19 skillsai-code-mode
execute sandboxed TypeScript code with LLMs
Jul 16AI SDKCode ExecutionSandboxingTanStack +1ai-core
configure TanStack AI agent features
Jul 17AgentsAIMiddlewareai-core/adapter-configuration
configure AI provider adapters
Jul 16AI SDKConfigurationLLMTanStackai-core/ag-ui-protocol
implement TanStack AI streaming protocol
Jul 16API DevelopmentLLMTanStackai-core/chat-experience
implement chat experiences with TanStack AI
Jul 23API DevelopmentFrontendLLMTanStackai-core/custom-backend-integration
integrate custom backends with TanStack AI
Jul 17AIAPI DevelopmentBackendTanStack
More from TanStack
View publisheraggregation
perform data aggregation in TanStack Table
table
Jul 26Data AnalysisFrontendTanStackapi-not-found
diagnose TanStack Table API errors
table
Jul 26DebuggingFrontendTanStackcell-selection
select rectangular cell ranges in tables
table
Jul 26Data AnalysisTanStackUI Componentsclient-vs-server
manage TanStack Table data pipelines
table
Jul 26Data PipelineFrontendPerformanceTanStackcolumn-faceting
build faceted filter UIs
table
Jul 26Data VisualizationFrontendTanStackcolumn-filtering
implement column filtering in TanStack Table
table
Jul 26Data AnalysisFrontendTanStack