Skip to content
imranrkhan13Public

About

Upload a README or architecture document, and it automatically builds a visual map of the system, explains every component in plain English, generates project-specific interview questions, and even creates AI-narrated walkthrough videos.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Mindflow / Code

For the complete application guide, see How Mindflow works.

Explore a public GitHub repository through code search, source-linked answers and a clickable import map. Documentation mode remains at /docs.

How it works

  1. The backend pins the default branch to a commit and downloads that repository archive.
  2. Every supported UTF-8 source, test, config and documentation file is indexed, with no per-file truncation. Excluded files and reasons are visible in Coverage.
  3. Each question searches the full indexed snapshot using identifier-aware lexical retrieval. Relevant source excerpts, not the entire repository, go to the model.
  4. Answers stream from a fixed, zero-priced openrouter/free route. Model IDs cannot be selected by callers. The backend checks the provider catalog's prompt and completion prices before generation. There is no paid fallback.
  5. Source IDs point to exact line ranges in the pinned commit. The model is instructed to cite claims and acknowledge missing evidence. Citation IDs are validated, but this is not a proof that every generated statement is correct.
  6. The graph shows static imports detected with Python AST parsing and JS/TS import matching. Clicking a node opens the actual file. It is not an observed runtime trace or a generated call-chain claim.

Honest boundaries

  • Public repositories only. No token is attached to imports. No source code is executed.
  • Repository root URLs only. Default branch snapshot, no automatic commit watching.
  • Generated directories, dependencies, lockfiles, assets, likely credential files, binary and non-UTF-8 files are excluded and listed. Symlinks are not followed. Git history and submodule contents are not imported.
  • The deployed importer keeps large files intact under the repository text budget and spools large archive downloads to disk. Repositories exceeding 250 MB compressed / 1 GB expanded, 50,000 supported files, 192 MB indexed text are rejected rather than silently reduced. Up to 200,000 archive entries are inspected.
  • The model sees at most 16 relevant source excerpts. Oversized/minified windows remain in the file browser but may not fit the model context. Retrieval can miss relevant evidence, especially across languages, aliases or dynamic imports.
  • Follow-ups include a bounded excerpt of the last four completed messages in the search question. This is session-local context, not persistent memory. Each question still searches the full supported-source index.
  • Each answer retains a question-to-evidence graph in session memory. Evidence links connect to retrieved source files; separate file edges show static imports. Evidence links do not claim a runtime sequence.
  • Free model capacity is shared and rate-limited. Key validation is not a guarantee that the next generation succeeds. Failure never switches to a paid route.
  • Free model providers receive retrieved public source excerpts. Do not paste private code or secrets into questions.
  • Snapshot cache is disposable, capped at 20 projects and seven days, and may be lost on a backend rebuild. This is demo hosting, not durable storage.

Development

Frontend: React 18, Vite, React Flow. npm ci && npm run dev.

Existing FastAPI backend: https://huggingface.co/spaces/phineas8/mindflow-backend. The frontend defaults to its application origin, https://phineas8-mindflow-backend.hf.space. Local Vite proxies /api to the same hosted backend. To run against a local backend, set API_PROXY_TARGET=http://127.0.0.1:8000. To use a different hosted backend, set VITE_API_URL to its origin and rebuild. Trailing slashes and an optional /api suffix are normalized.

New API namespace: /api/repository. Import, snapshot coverage, exact source file, search-only, provider status and streamed ask endpoints are separate from legacy documentation endpoints.

Restored learning tools and voice

The original landing design is the main entry again. Public repository imports now open a source-backed workspace with Ask, Explain (including Analogy, Questions and Mistakes), Architecture, Interview and Video tabs. All text tools use the same supported-source index, retrieved evidence, clickable citations and static import map. Uploaded documents still open the document-based workspace, which does not inspect unavailable source files.

Listen buttons and video narration use the Apache-licensed Kokoro-82M model hosted on the existing CPU backend. No external paid TTS route or silent-audio fallback is enabled. CPU work is shared and can take time.

The Video tab offers two distinct outputs: animated source walkthroughs with local Kokoro narration, and AI visual clips generated by Lightricks LTX 0.9.8 distilled through its official public ZeroGPU demo. The latter are actual 2-second, 512 x 384 silent model-generated clips, not diagrams or proof of code behavior. Only the visual prompt is sent to that demo; no repository or account token is sent. The shared public demo can queue, exhaust its free quota or disable access. There is no paid fallback or availability promise. The walkthrough and generative-clip options are clearly labeled separately. Video scripts use a bounded free-model call. Invalid scripts and voice failures are shown as errors, never replaced with invented generic narration or silence. Generated media is temporary.

Official generative video demo: https://huggingface.co/spaces/Lightricks/ltx-video-distilled . Free shared ZeroGPU use: https://huggingface.co/docs/hub/spaces-zerogpu . Voice model: https://huggingface.co/hexgrad/Kokoro-82M .

Narration controls

Answer narration removes display-only Markdown, citations, URLs and fenced code before speech synthesis. The browser applies gentle dynamics compression and peak normalization to answer audio and voice samples, then exports PCM WAV. Silent recordings are rejected. These steps balance levels; they do not upgrade Kokoro’s voice model. Audio and video preview pace controls preserve pitch and do not alter downloaded MP4s. The server-rendered MP4 quality, narration mix, resolution and LTX generation remain controlled by the external backend, whose source is not in this repository.

Repository documentation and source exports

The workspace header offers Docs (Markdown) and Source ZIP. Documentation includes the pinned commit, coverage, languages, directory counts, package manifests and scripts, dependency versions, complete indexed Markdown/text documentation, a source-linked inventory of every indexed file, detected static import connections, and explicit exclusions. It is generated from source rather than model guesses and does not claim to prove runtime behavior. The ZIP includes that document, coverage and graph JSON, plus every indexed source file. Excluded credentials, generated files and assets are not bundled.

Snapshot JSON is compressed in SQLite; existing uncompressed snapshots remain readable. Large archive downloads spill to disk. Import parsing, snapshot compression, search and export generation run outside the API event loop. File browsing is paginated without reducing search coverage.

Faster project loading

Importing an unchanged commit reuses its saved snapshot instead of downloading the archive again. A separate lightweight summary lets saved workspaces open without decompressing the full repository source. Summary responses use gzip when the browser supports it and send an import-connection count instead of the entire graph; individual answer graphs still include their actual edges. New repositories still need an initial download and indexing pass.

About

Upload a README or architecture document, and it automatically builds a visual map of the system, explains every component in plain English, generates project-specific interview questions, and even creates AI-narrated walkthrough videos.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages