Skip to content

Add memvid .mv2 export — portable AI memory layer for packed repos #1620

@fuleinist

Description

@fuleinist

Feature Request: Add memvid .mv2 export — portable AI memory layer for packed repos

Thank you for helping improve Repomix!

We appreciate your feedback and will review your request as soon as possible.

Description

Repomix currently outputs packed repos as XML, Markdown, or plain text. This is great for feeding code to LLMs in a single prompt — but once packed, the output is opaque to search and retrieval.

Proposed: Add an optional --output-format mv2 flag that pipes the packed output directly into a memvid .mv2 file.

Motivation

memvid is a single-file memory layer for AI agents that:

  • Packages data + embeddings + search index into one portable .mv2 file
  • Supports hybrid search (BM25 lexical + vector similarity) out of the box
  • Provides O(1) entity lookups via Memory Cards (SPO triplets)
  • Includes time-travel debugging — replay retrieval sessions
  • Works offline, no server, no Docker, no infrastructure

Repomix + memvid would enable:

  1. Portable semantic repo memoryrepomix --output-format mv2 --include "**/*.ts"repo.mv2 anyone can memvid find repo.mv2 --query "where is auth handled?"
  2. Zero-infrastructure RAG — commit .mv2 files to git, share with team, query with any LLM without rebuilding a vector index
  3. Versioned codebase snapshots — each .mv2 is a point-in-time memory of the repo that can be diffed via time-travel
  4. Multi-repo composite memory — pack multiple repos into one .mv2, query across all of them with hybrid search

Use Case

A developer clones a large repo they've never seen before. Instead of reading files manually:

# Pack and memorize
npx repomix --output-format mv2 --output repo-memory.mv2

# Ask questions instantly
memvid find repo-memory.mv2 --query "how does the auth middleware work?"
# → Returns relevant code chunks with BM25 + vector hybrid ranking

# Entity lookup
memvid state repo-memory.mv2 "JWTValidator"
# → { expiresIn: '24h', issuer: 'auth-service', algorithm: 'RS256' }

Technical Approach

  1. Add --output-format mv2 option in src/config.ts
  2. Use memvid SDK (Node.js @memvid/sdk or CLI memvid) after repomix completes the pack
  3. Repomix output (XML/MD/plain) becomes the text field in memvid.put()
  4. Repo file paths stored as metadata.path, line numbers as metadata.line
  5. Auto-generate entity candidates from function/class names and export declarations
// Example integration sketch
import { create } from '@memvid/sdk';
import { pack } from 'repomix';

const mem = await create('repo-memory.mv2', 'basic');
const packed = await pack({ directory: './src' });

for (const file of packed.files) {
  await mem.put({
    title: file.path,
    label: 'source',
    text: file.content,
    metadata: { path: file.path, lines: file.content.split('\n').length }
  });
}

Alternatives Considered

Approach Downsides
JSON Lines + ChromaDB Requires running a Chroma server; not portable
GitHub Co-Pilot memory Proprietary; requires login; not local
Pinecone / Weaviate Cloud-only or Docker required; not single-file
memvid Zero infrastructure, single .mv2 file, works offline

Labels

  • enhancement
  • triage

Checklist

  • Check existing issues for similar proposals (none found for memvid or mv2)
  • Verify @memvid/sdk is TypeScript-compatible (yes — official JS/TS SDK)
  • Consider CLI fallback: repomix --output-format mv2 shells out to memvid create

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestideaneeds discussionIssues needing discussion and a decision to be made before action can be taken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions