
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
@cellstate/convex
Advanced tools
Convex component for CELLSTATE — hierarchical memory for AI agents with trajectories, scopes, artifacts, notes, and multi-agent coordination
Convex component for CELLSTATE — hierarchical memory for AI agents with trajectories, scopes, artifacts, notes, and multi-agent coordination.
CELLSTATE is a hierarchical memory framework for AI agents that provides:
┌─────────────────────────────────────────────────────────────┐
│ Your Convex App │
│ │
│ ┌─────────────────┐ ┌──────────────────────────────────┐ │
│ │ Frontend │ │ Convex Backend │ │
│ │ (React/etc) │──│ Queries, Mutations, Actions │ │
│ │ │ │ │ │
│ │ Real-time subs │ │ ┌────────────────────────────┐ │ │
│ │ via useQuery() │ │ │ @cellstate/convex │ │ │
│ └─────────────────┘ │ │ (CELLSTATE Component) │ │ │
│ │ │ │ │ │
│ │ │ Trajectories, Scopes, │ │ │
│ │ │ Turns, Artifacts, Notes, │ │ │
│ │ │ Agents, Tool Executions │ │ │
│ │ └────────────────────────────┘ │ │
│ └──────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Data lives entirely inside Convex — no external API calls needed. You get real-time subscriptions, transactional consistency, and zero-latency reads for free.
bun add @cellstate/convex
// convex/convex.config.ts
import { defineApp } from "convex/server";
import cellstate from "@cellstate/convex/convex.config";
const app = defineApp();
app.use(cellstate);
export default app;
// convex/myAgent.ts
import { CellstateMemory } from "@cellstate/convex";
import { components } from "./_generated/api";
import { internalAction } from "./_generated/server";
import { v } from "convex/values";
const memory = new CellstateMemory(components.cellstate);
export const runTask = internalAction({
args: { prompt: v.string() },
handler: async (ctx, { prompt }) => {
// Start a task (creates trajectory + scope)
const { trajectoryId, scopeId } = await memory.startTask(ctx, {
name: "User query",
description: prompt,
tokenBudget: 8000,
});
// Record the user's message
await memory.addTurn(ctx, {
scopeId,
trajectoryId,
role: "user",
content: prompt,
});
// Search existing knowledge
const notes = await memory.searchNotes(ctx, {
query: prompt,
limit: 5,
});
// ... do LLM inference with notes as context ...
// Extract valuable output as an artifact
await memory.createArtifact(ctx, {
trajectoryId,
scopeId,
name: "Analysis Result",
content: "...",
artifactType: "document",
sourceTurn: 1,
});
// Save learned knowledge as a cross-trajectory note
await memory.createNote(ctx, {
noteType: "fact",
title: "Discovered pattern",
content: "...",
sourceTrajectoryIds: [trajectoryId],
});
// Complete the task
await memory.completeTask(ctx, {
trajectoryId,
scopeId,
outcomeStatus: "success",
outcomeSummary: "Analyzed user query successfully",
});
},
});
| Method | Description |
|---|---|
startTask({ name, description?, tokenBudget? }) | Create a trajectory + scope in one call |
completeTask({ trajectoryId, scopeId, outcomeStatus?, outcomeSummary? }) | Close scope and mark trajectory complete |
| Method | Description |
|---|---|
createTrajectory({ name, description?, agentId? }) | Create a task container |
updateTrajectoryStatus({ trajectoryId, status }) | Update status (active/completed/failed/suspended) |
getTrajectory(trajectoryId) | Get trajectory by ID |
listTrajectories(status?) | List trajectories, optionally filtered by status |
| Method | Description |
|---|---|
createScope({ trajectoryId, name, tokenBudget? }) | Create a new context window |
closeScope(scopeId) | Close a scope (triggers budget reclaim) |
getOpenScopes(trajectoryId) | Get all open scopes for a trajectory |
| Method | Description |
|---|---|
addTurn({ scopeId, trajectoryId, role, content }) | Add a message (auto-tracks token usage) |
getTurns(scopeId) | Get all turns in a scope, ordered by turn number |
| Method | Description |
|---|---|
createArtifact({ trajectoryId, scopeId, name, content, artifactType, sourceTurn }) | Save a persistent output |
listArtifacts(trajectoryId, artifactType?) | List artifacts, optionally filtered by type |
Artifact types: fact, code, document, data, config, log, summary, decision, plan
| Method | Description |
|---|---|
createNote({ noteType, title, content, sourceTrajectoryIds }) | Create long-term knowledge |
searchNotes({ query, noteType?, limit? }) | Full-text search across notes |
listNotes(noteType?, activeOnly?) | List notes by type |
deactivateNote(noteId) | Soft-delete a note |
Note types: convention, strategy, gotcha, fact, preference, relationship, procedure, meta
| Method | Description |
|---|---|
registerAgent({ agentType, capabilities, canDelegateTo? }) | Register an agent |
updateAgentStatus(agentId, status) | Update status (active/idle/busy/offline) |
agentHeartbeat(agentId) | Heartbeat ping |
listAgents(status?) | List agents by status |
| Method | Description |
|---|---|
startToolExecution({ toolName, agentId?, trajectoryId? }) | Record tool invocation start |
completeToolExecution({ executionId, status, durationMs }) | Record tool completion |
Tenant (your Convex app)
├── Notes (cross-trajectory knowledge, persists forever)
├── Agents (registered agents with capabilities)
└── Trajectory (task container)
├── Scope (context window with token budget)
│ └── Turns (individual messages)
├── Artifacts (extracted values from this task)
└── Tool Executions (audit trail)
The component creates 7 tables isolated within the component boundary:
| Table | Purpose | Key Indexes |
|---|---|---|
trajectories | Task containers | by_status, by_agent, by_parent |
scopes | Context windows | by_trajectory, by_open |
turns | Conversation messages | by_scope, by_trajectory |
artifacts | Persistent outputs | by_trajectory, by_type |
notes | Cross-trajectory knowledge | by_type, by_active, search_content (full-text) |
agents | Agent registry | by_type, by_status |
toolExecutions | Tool audit trail | by_trajectory, by_tool, by_agent |
Apache-2.0 — See the main CELLSTATE repository for details.
FAQs
Convex component for CELLSTATE — hierarchical memory for AI agents with trajectories, scopes, artifacts, notes, and multi-agent coordination
We found that @cellstate/convex 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 compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.