Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentMem

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.

MVP Delivered

  • 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.

Workspace Storage Layout

.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 ...

Commands

  • AgentMem: Create Feature
  • AgentMem: Create Bug
  • AgentMem: Create Agent
  • AgentMem: Run Agent Task
  • AgentMem: Open Namespace Dashboard
  • AgentMem: Set OpenAI API Key
  • AgentMem: Set Anthropic API Key
  • AgentMem: Clear OpenAI API Key
  • AgentMem: Clear Anthropic API Key
  • AgentMem: Refresh

Context-menu actions are also available in the sidebar for namespace-specific operations.

Provider Configuration

API keys are stored in SecretStorage only.

Models are configurable in VS Code settings:

  • agentMem.models.openai
  • agentMem.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
}

Agent Execution Flow (MVP)

  1. User picks namespace + agent + task prompt in Agent Runner.
  2. Extension assembles context from namespace memory, tasks, recent summaries, active editor context, and workspace file map.
  3. Provider receives system prompt + user prompt + structured context.
  4. Model returns structured JSON result.
  5. 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)

Architecture

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

Security Notes

  • API keys are never written to workspace files.
  • API keys are never logged.
  • Error text is redacted for common secret patterns.

Local Development

npm install
npm run lint
npm run compile

Then in VS Code:

  1. Open this project.
  2. Press F5 (Run Extension).
  3. In the Extension Development Host, open a workspace folder.
  4. Open the AgentMem sidebar and run commands.

Validation Status

  • npm run lint: passing
  • npm run compile: passing

TODOs / Next Iteration

  • 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.

Notes

Reference templates are in templates/namespace/ for inspection and customization. Runtime files are generated per workspace namespace under .agentmem/.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages