{"slug": "contextvault-own-your-ai-context-across-models-agents-and-time", "title": "ContextVault: Own Your AI Context Across Models, Agents, and Time", "summary": "ContextVault 1.3 unifies browser conversations, terminal sessions, and coding-agent decisions into a single searchable local context engine. The tool, built by developer Ali Abd, captures context from multiple LLM platforms and development tools without a backend, tracking, or hidden AI calls. It uses a hybrid DOM and network capture strategy for browser conversations and a Node.js CLI for terminal sessions, storing everything locally in IndexedDB.", "body_md": "**How ContextVault 1.3 unifies browser conversations, terminal sessions, and coding-agent decisions in one searchable local context engine — without a backend, tracking, or hidden AI calls.**\n\nYou spend forty-five minutes walking a coding agent through a Redis connection bug. Together, you find the root cause, test a fix, and uncover a configuration detail that is not documented anywhere. Then the context window fills up. Two weeks later, the same bug appears in staging. The original session is gone, the browser conversation is buried, and the next agent knows nothing about what you already discovered. You start again. This is context fragmentation: project knowledge scattered across ChatGPT conversations, coding-agent sessions, terminals, accounts, models, and limited context windows. It creates a quiet tax on every AI-assisted workflow.\n\nExporting conversations helps, but only partially. A directory full of Markdown exports is still a directory full of disconnected files. The information is preserved, but it is not organized as project memory. That distinction changed the direction of ContextVault. What began as a browser conversation recorder evolved into a local-first context engine designed around a broader idea:\n\nGit tracks code. ContextVault tracks context.\n\nI originally built ContextVault as a Chrome extension for capturing conversations across multiple LLM platforms. The extension solved an immediate problem: preserving complete conversations locally and exporting them in portable formats.\n\nBut capturing browser conversations addressed only one surface.\n\nThe decisions that shaped a project were also happening inside Codex sessions, Claude Code investigations, Cursor workflows, terminal debugging, human notes, failed experiments, and task discussions. Those sessions often disappeared when a terminal closed or an agent reached its context limit.\n\nI did not need another folder of exports. I needed a way to preserve what happened, classify it, search it, and prepare it for the next agent.\n\nThat led to three connected layers:\n\nBrowser Capture is the original ContextVault surface. It is a Chrome Manifest V3 extension that captures conversations from ChatGPT, Claude, Gemini, Perplexity, Poe, DeepSeek, and Copilot.\n\nThe extension uses a hybrid DOM and network capture strategy. It watches provider DOM mutations, observes supported network responses, assembles streamed messages in the content-capture layer, and sends finalized messages to the background service worker for local storage.\n\nThis hybrid approach matters because LLM interfaces are dynamic. Assistant responses arrive incrementally, DOM elements change while streaming, and provider implementations differ.\n\nOnce captured, conversations remain in IndexedDB by default. Users can export them as individual Markdown files or bulk ZIP archives. Each exported conversation includes YAML frontmatter containing metadata such as platform, model, date, conversation ID, and tags.\n\nThe data flow is intentionally contained:\n\n```\nProvider page\n    ↓\nDOM and supported network capture\n    ↓\nStream assembly\n    ↓\nBackground service worker\n    ↓\nLocal IndexedDB storage\n    ↓\nExplicit Markdown or ZIP export\n```\n\nThe extension does not send captured conversations to a ContextVault server because no ContextVault server exists. It does not require an account, collect telemetry, or call an external AI API.\n\nBrowser Capture solved the first problem: preserving conversations. It did not yet solve project memory.\n\nBrowser conversations are only part of an AI development workflow. Important context also appears while working with coding agents and terminals: a failed authentication fix, a decision about middleware boundaries, an unresolved production problem, a task discovered during debugging, a note explaining why one approach was rejected.\n\nVault Terminal provides an explicit way to record those moments. It is a Node.js CLI published on npm as `@aliabdm/contextvault`\n\n.\n\nRun it directly without installing anything globally:\n\n```\nnpx @aliabdm/contextvault init\n```\n\nOr install globally:\n\n```\nnpm install -g @aliabdm/contextvault\ncontextvault init\n```\n\nTo start recording:\n\n```\ncontextvault record\n```\n\nInside the recorder, context is entered using typed commands:\n\n```\n/source codex\n/title Fix auth middleware\n\n/user The login redirect is broken.\n\n/agent I found the issue in middleware order.\n\n/decision Keep auth checks in middleware and policy checks in controllers.\n\n/task Add a regression test for the redirect loop.\n\n/problem The session cookie is missing on callback.\n\n/end\n```\n\nThese commands become structured context events. Each session is saved as a local Markdown file under `.contextvault/sessions/`\n\n. The files are human-readable, inspectable, searchable with standard tools, easy to archive, and ignored by Git by default.\n\nThere is no automatic summarization, rewriting, or external model call. Vault Terminal records what you explicitly provide. It does not intercept every terminal process or automatically capture complete Codex, Claude Code, or Cursor sessions. That limitation is deliberate and visible.\n\nThe CLI also supports:\n\n```\ncontextvault list\ncontextvault search \"Redis\"\ncontextvault export\n```\n\nVault Terminal solved the second problem: preserving agent work, decisions, tasks, problems, and notes outside the browser.\n\nThe next challenge was connecting both capture surfaces.\n\nThe Unified Context Engine turns separate captures into searchable project context. It imports Browser Capture exports, reads Vault Terminal sessions, normalizes both sources into shared models, and builds a local index.\n\nBrowser exports can be imported from Markdown files, ZIP archives, or directories:\n\n```\ncontextvault import ./chatgpt-export.md\ncontextvault import ./contextvault-export.zip\ncontextvault import ./browser-exports/\n```\n\nThe importer reads Markdown entries in memory, validates ContextVault frontmatter, sanitizes filenames, prevents unsafe archive extraction, applies deterministic duplicate detection, and enforces safety limits.\n\nCurrent limits:\n\n`conversation_id`\n\n, the existing source is updated rather than duplicated.Browser chats and terminal sessions do not begin with the same structure. The normalization layer maps both into two shared models: `ContextSession`\n\nand `ContextEvent`\n\n.\n\nBrowser messages are mapped as user and agent events, with platform and role metadata preserved. Terminal events retain their explicit types: `user`\n\n, `agent`\n\n, `decision`\n\n, `task`\n\n, `problem`\n\n, and `note`\n\n.\n\nThe normalizer also supports legacy `snake_case`\n\nmetadata fields — `started_at`\n\n, `ended_at`\n\n, `git_branch`\n\n— alongside current camelCase fields. This keeps existing Markdown sessions readable without requiring a destructive migration.\n\nAfter importing or recording context, rebuild the index with:\n\n```\ncontextvault index\n```\n\nThe engine reads terminal sessions and imported browser conversations, normalizes them, and writes a local JSON index to `.contextvault/index/context-index.json`\n\n.\n\nMarkdown remains the source of truth. The JSON index is derived data. If it becomes corrupted or outdated, delete it and rebuild from the original Markdown files:\n\n```\nLocal Markdown\n    ↓\nNormalize\n    ↓\nRebuildable JSON index\n```\n\nThere is no proprietary database format and no dependency on a hosted service. Users can inspect, edit, archive, or process their context without ContextVault.\n\nOnce indexed, context can be queried across both surfaces:\n\n```\ncontextvault history --since 2w\ncontextvault decisions auth --source codex\ncontextvault problems redis --since 30d\ncontextvault retrieve \"auth middleware\" --type decision,task\n```\n\nSupported filters: `--type`\n\n, `--source`\n\n, `--since`\n\n, `--limit`\n\n.\n\nRetrieval is local and deterministic. Ranking considers phrase matches, token matches, event-type boosts, and recency. It does not use embeddings, vector databases, semantic search, external models, or hidden AI calls.\n\nThe engine answers: *What have I captured about this topic?*\n\nIt does not claim to answer: *What does all my project data mean?*\n\nThe first question is grounded and testable. The second requires a semantic retrieval layer that ContextVault does not currently include.\n\nThe `prepare`\n\ncommand creates a focused context package:\n\n```\ncontextvault prepare \"auth middleware\"\n```\n\nThe generated file is written to `.contextvault/exports/prepared-context.md`\n\n. It can include project memory, relevant sessions, decisions, tasks, problems, and source metadata — portable Markdown that can be handed directly to Codex, Claude Code, Cursor, or another AI tool.\n\nContextVault does not call those tools. It prepares grounded context for the user to move explicitly.\n\nThe architecture separates four responsibilities:\n\nIntegrations are adapters. The engine is the product.\n\nProject context should remain usable without the application that created it. A proprietary database can be fast, but it also creates dependency and obscures the raw material.\n\nMarkdown provides different guarantees: it opens in any editor, works with standard search tools, can be archived directly, remains readable if ContextVault disappears, and can be transformed with scripts or moved between tools.\n\nThe JSON index exists for retrieval performance. It is disposable. The Markdown is not.\n\nGit tracks code history. ContextVault preserves the discussions, failed attempts, decisions, and discoveries surrounding that code.\n\nContextVault follows a local-first model. No captured data is sent to a ContextVault backend because there is no backend.\n\n`.contextvault/`\n\ndirectory is ignored by Git by default. This matters because raw sessions may contain prompts, local paths, environment details, logs, debugging output, and potential secrets. Automatically committing that material would be an irresponsible default.Users can choose how to archive or back up their files. ContextVault does not make that choice for them.\n\nA useful technical project should make its boundaries as visible as its features.\n\n**No automatic terminal-agent interception.** Vault Terminal captures what the user explicitly records. It does not hook into every shell process or capture complete Codex, Claude Code, or Cursor sessions.\n\n**No semantic search.** Retrieval is lexical and deterministic. Optional local semantic indexing is future work.\n\n**No built-in natural-language answers.** ContextVault retrieves evidence and prepares context packages. It does not synthesize answers. Users provide the prepared Markdown to the model they choose.\n\n**No automatic IndexedDB synchronization.** Browser conversations enter the Context Engine through explicit Markdown or ZIP export and import. The extension does not automatically synchronize with `.contextvault/`\n\n.\n\n**Browser adapters can change.** LLM providers regularly modify their interfaces. Provider changes may require adapter updates, and the generic adapter remains best-effort.\n\nThese are not hidden limitations. They are the honest boundaries of ContextVault 1.3.\n\nContextVault is useful when:\n\nNotes applications are useful for polished summaries. They are less effective at preserving raw working context: the failed attempt before the fix, the partial command output that revealed the bug, the agent response that influenced a decision, the unresolved problem discovered during another task, the reason an architectural approach was rejected.\n\nContextVault preserves that intermediate state. An `/agent`\n\nevent records what the agent said — not what you later remember. A `/decision`\n\nevent captures an explicit project decision. A `/problem`\n\nevent keeps an unresolved issue available for future retrieval.\n\nContextVault is not a replacement for documentation. It is the context layer that makes future documentation easier to produce because the underlying evidence remains searchable.\n\nThe Unified Context Engine now exists. The next phase is reducing manual handoffs and improving retrieval without weakening the local-first model.\n\n**MCP Server** — Expose project context through the Model Context Protocol so compatible agents can query it through an explicit integration.\n\n**VS Code Extension** — Surface project decisions, tasks, problems, and related sessions directly inside the editor.\n\n**Agent Integrations** — Build adapters for Codex, Claude Code, Cursor, and similar tools that can emit the shared context structure automatically.\n\n**Optional Local Semantic Indexing** — Improve ranking with optional local embeddings while preserving the existing deterministic retrieval path.\n\n**Encrypted Backups and Optional Self-Hosted Sync** — Support off-machine durability without requiring a third-party hosted service.\n\nThese are roadmap items, not implemented features. The current architecture provides the shared models, normalization layer, index schema, and adapter boundaries needed to build them incrementally.\n\nContextVault is fully open source and available today under the MIT License.\n\nInitialize Vault Terminal directly from npm:\n\n```\nnpx @aliabdm/contextvault init\n```\n\nOr install it globally:\n\n```\nnpm install -g @aliabdm/contextvault\ncontextvault init\n```\n\nStart recording:\n\n```\ncontextvault record\n```\n\nBuild and query the local context index:\n\n```\ncontextvault index\ncontextvault history --since 2w\ncontextvault retrieve \"auth middleware\"\n```\n\nCapture browser conversations, record coding-agent sessions, build a local context index, and prepare grounded context packages — all while keeping your data on your own machine.\n\n**Project links:**\n\nFeel free to open an issue, submit a pull request, or connect with me on [LinkedIn](https://www.linkedin.com/in/mohammad-ali-abdul-wahed/).\n\nMohammad Ali Abdul Wahed is a Senior Software Engineer specializing in backend systems, Laravel, distributed applications, and AI developer tooling. He is the creator of ContextVault, an open-source local-first context platform that combines a Chrome Extension and an npm CLI to preserve browser conversations, coding-agent sessions, project decisions, and developer workflows across AI tools.", "url": "https://wpnews.pro/news/contextvault-own-your-ai-context-across-models-agents-and-time", "canonical_source": "https://dev.to/maliano63717738/contextvault-own-your-ai-context-across-models-agents-and-time-555i", "published_at": "2026-06-27 20:00:42+00:00", "updated_at": "2026-06-27 20:33:42.094111+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-agents", "ai-tools", "ai-infrastructure"], "entities": ["ContextVault", "Ali Abd", "Chrome", "ChatGPT", "Claude", "Gemini", "Perplexity", "Copilot"], "alternates": {"html": "https://wpnews.pro/news/contextvault-own-your-ai-context-across-models-agents-and-time", "markdown": "https://wpnews.pro/news/contextvault-own-your-ai-context-across-models-agents-and-time.md", "text": "https://wpnews.pro/news/contextvault-own-your-ai-context-across-models-agents-and-time.txt", "jsonld": "https://wpnews.pro/news/contextvault-own-your-ai-context-across-models-agents-and-time.jsonld"}}