AgentMem is a VS Code extension that introduces feature/bug scoped persistent memory for coding agents.
Instead of relying only on one chat history, each namespace stores shared context in your workspace so any new agent can resume work across sessions and providers.
- Feature/Bug namespace creation with persistent workspace files under
.agentmem/. - Multiple agents per namespace with provider/model metadata.
- Provider abstraction with OpenAI + Anthropic implementations.
- API key management via VS Code
SecretStorage. - Provider + model selection in agent creation flow and Agent Runner dropdowns.
- Sidebar tree view with Features/Bugs, Agents, Memory Files, and Tasks.
- Chat-style Agent Runner webview (Copilot/Codex-style layout) to execute tasks and persist session updates.
- Namespace Dashboard webview for quick inspection and actions.
- Context assembly service that builds structured prompt context from namespace + workspace state.
- Append-only run logs and session summary files.
.agentmem/
features/
feature-<id>/
metadata.json
agents.json
shared-context.md
decisions.md
progress.md
files-touched.json
tasks.json
run-logs.ndjson
session-summaries/
artifacts/
bugs/
bug-<id>/
... same files ...
AgentMem: Create FeatureAgentMem: Create BugAgentMem: Create AgentAgentMem: Run Agent TaskAgentMem: Open Namespace DashboardAgentMem: Set OpenAI API KeyAgentMem: Set Anthropic API KeyAgentMem: Clear OpenAI API KeyAgentMem: Clear Anthropic API KeyAgentMem: Refresh
Context-menu actions are also available in the sidebar for namespace-specific operations.
API keys are stored in SecretStorage only.
Models are configurable in VS Code settings:
agentMem.models.openaiagentMem.models.anthropic
Default static registry for MVP (no dynamic fetch):
- OpenAI:
GPT-5(gpt-5),GPT-5 mini(gpt-5-mini),Codex-style model(codex-1) - Anthropic:
Claude Sonnet(claude-sonnet-4-5),Claude Opus(claude-opus-4-1)
Each entry supports:
{
"id": "model-id",
"label": "Display Name",
"description": "Optional",
"maxTokens": 1200
}- User picks namespace + agent + task prompt in Agent Runner.
- Extension assembles context from namespace memory, tasks, recent summaries, active editor context, and workspace file map.
- Provider receives system prompt + user prompt + structured context.
- Model returns structured JSON result.
- Extension persists updates to memory files:
- session summary file
- decisions append (architecture decisions, rejected approaches, tradeoffs)
- progress append (completed work, remaining work, blockers)
- shared-context append (durable summary, confirmed facts, speculations)
- files-touched merge
- tasks merge
- run log append (
run-logs.ndjson)
src/
extension.ts
constants.ts
models/
namespace.ts
agent.ts
task.ts
memory.ts
provider.ts
services/
storageService.ts
secretService.ts
namespaceService.ts
agentService.ts
memoryService.ts
contextAssembler.ts
agentExecutionService.ts
providers/
baseProvider.ts
openaiProvider.ts
anthropicProvider.ts
providerRegistry.ts
commands/
index.ts
types.ts
helpers.ts
apiKeyCommands.ts
namespaceCommands.ts
agentCommands.ts
runCommands.ts
tree/
treeTypes.ts
featureMemoryTreeProvider.ts
webview/
agentRunnerPanel.ts
namespaceDashboardPanel.ts
utils/
id.ts
time.ts
error.ts
json.ts
templates.ts
templates/
namespace/
shared-context.md
decisions.md
progress.md
files-touched.json
tasks.json
session-summary.md
- API keys are never written to workspace files.
- API keys are never logged.
- Error text is redacted for common secret patterns.
npm install
npm run lint
npm run compileThen in VS Code:
- Open this project.
- Press
F5(Run Extension). - In the Extension Development Host, open a workspace folder.
- Open the
AgentMemsidebar and run commands.
npm run lint: passingnpm run compile: passing
- Add streaming token output in Agent Runner.
- Add cancellation support for in-flight provider requests.
- Add per-namespace embeddings/vector retrieval.
- Add Git-aware checkpoints and diffs.
- Add multi-agent orchestration and handoff queues.
- Add task dependency graph and richer status transitions.
- Add model capability metadata (tool use, context window, cost hints).
- Add tests (unit + integration + webview message handling).
- Add automatic migration/versioning for namespace schema.
Reference templates are in templates/namespace/ for inspection and customization.
Runtime files are generated per workspace namespace under .agentmem/.