
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@hazeljs/memory
Advanced tools
Pluggable user memory for HazelJS - profile, preferences, behavioral patterns, emotional state, episodic and semantic memory with multi-store support
Pluggable user memory for HazelJS. Profile, preferences, behavioral patterns, emotional state, episodic and semantic memory β one interface, multiple backends. Share the same store between RAG and agents in-process.
Storage: By default the package uses in-memory storage (no dependencies). For durable persistence, use the Prisma store (same pattern as @hazeljs/flow) or plug in Postgres, Redis, or vector backends.
createHazelMemoryStoreAdapter from @hazeljs/rag/memory-hazel to back MemoryManager; share one store across RAGPipelineWithMemory and AgentRuntimepnpm add @hazeljs/memory
No database or env vars are required for the default in-memory mode.
import { createDefaultMemoryStore, MemoryService } from '@hazeljs/memory';
const store = createDefaultMemoryStore();
const service = new MemoryService(store);
await service.initialize();
// Use service to get/set memory by userId, category, etc.
When you use Prisma in your app (e.g. like @hazeljs/flow and @hazeljs/flow-runtime), use the Prisma store:
import { createPrismaMemoryStore, getMemoryPrismaClient } from '@hazeljs/memory/prisma';
import { MemoryService } from '@hazeljs/memory';
const prisma = getMemoryPrismaClient(process.env.DATABASE_URL);
const store = createPrismaMemoryStore(prisma);
const service = new MemoryService(store);
await service.initialize();
Build: Run pnpm prisma:generate (or prisma generate) before pnpm build so the Prisma client is generated. Migrate with pnpm prisma:migrate from the package directory.
| Backend | Module / Factory | Use case |
|---|---|---|
| In-memory | createDefaultMemoryStore() | Development, tests, no DB |
| Prisma | createPrismaMemoryStore(prisma) from @hazeljs/memory/prisma | Production, same app DB as flow/core |
| Postgres (raw) | PostgresStore β pass a pg pool with a query method (see postgres.store.ts) | Existing Postgres without Prisma |
| Redis | RedisStore β pass an ioredis-style client | High-throughput, shared across processes |
| Vector episodic | VectorEpisodicStore | Episodic/semantic vector search |
| Composite | CompositeMemoryStore | Route by category to primary + optional episodic store |
| Category | Description |
|---|---|
profile | User identity and static attributes |
preference | Stated preferences (e.g. language, theme) |
behavioral | Inferred behavior patterns |
emotional | Emotional state (often with TTL) |
episodic | Event-based memories (what happened when) |
semantic_summary | Summarized or semantic facts |
See types in src/types/.
To back RAG (and agent) memory with @hazeljs/memory so RAG and agents share the same user context in-process:
pnpm add @hazeljs/rag @hazeljs/memory
import { MemoryManager, RAGPipelineWithMemory } from '@hazeljs/rag';
import { createHazelMemoryStoreAdapter } from '@hazeljs/rag/memory-hazel';
import { MemoryService, createDefaultMemoryStore } from '@hazeljs/memory';
const hazelStore = createDefaultMemoryStore();
const memoryService = new MemoryService(hazelStore);
const ragStore = createHazelMemoryStoreAdapter(memoryService);
const memoryManager = new MemoryManager(ragStore);
// Pass the same MemoryManager to RAG and to every AgentRuntime
const rag = new RAGPipelineWithMemory(config, memoryManager, llmFunction);
// agentRuntime = new AgentRuntime({ ..., memoryManager });
See @hazeljs/rag README (Memory System / Using @hazeljs/memory as the backend) for full details.
prisma:generate β Generate Prisma clientprisma:migrate β Run migrations (dev)prisma:deploy β Deploy migrations (prod)prisma:studio β Open Prisma Studio (when using Prisma store)test β Run testsApache 2.0 Β© HazelJS
Contributions are welcome! See CONTRIBUTING.md for details.
FAQs
Pluggable user memory for HazelJS - profile, preferences, behavioral patterns, emotional state, episodic and semantic memory with multi-store support
The npm package @hazeljs/memory receives a total of 31 weekly downloads. As such, @hazeljs/memory popularity was classified as not popular.
We found that @hazeljs/memory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.