Local Flow
About
A minimal, local, GPU-accelerated RAG server for document ingestion and querying.
Details
- Author
- haelyons
- Categories
- Search, Knowledge Base, Other
Jump to
Setup
Install Local Flow in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/haelyons/local_flow
Follow the installation instructions in the repository README, then restart your MCP client.
Minimal, local, RAG with GPU acceleration. It actually works. Ships with more dependencies than the Vatican's import list. Runs on Windows and WSL.
MCP Server + FAISS + SentenceTransformers + LangChain + FastMCP
Vector database stored in./vector_db(or whereverRAG_DATA_DIRpoints). Don't delete it unless you enjoy re-indexing everything. The default is a directory in Windows. You should editRAG_DATA_DIRif using it with WSL because the argument doesn't always work.
JSON-RPC over stdin/stdout, but we log everything over stderr because we're not cowards.
Because slow start isn't good enough for all you accelerationists.
- Windows: Native Windows setup with CUDA toolkit → SeeINSTALL_WINDOWS.md
- WSL2: Used to have a guide for installing the CUDA stack on WSL2, but I'm thinking that's masochism -- now we have config which calls Windows Python from WSL
Assuming you already have CUDA Toolkit and CUDA Runtime installed. If you don't see,INSTALL_WINDOWS.md, again
git clone <repo_url> # shocking, I know python -m venv flow-env flow-env\Scripts\activate.bat pip install sentence-transformers langchain-community langchain-text-splitters faiss-cpu pdfplumber requests beautifulsoup4 gitpython nbformat pydantic fastmcp # PyTorch with CUDA (check https://pytorch.org/get-started/locally/ for your version) pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 # -- CUDA 12.9 (selected 12.8) I used cu128`
Note: Usingfaiss-cpubecausefaiss-gpuis allergic to recent CUDA versions.
Add this to yourmcp.jsonfile - also accessible via the "MCP settings" menu:
Windows(%APPDATA%\Cursor\User\globalStorage\cursor.mcp\mcp.json):
Adjust paths to your setup (or it won't work, unsurprisingly).
{ "mcpServers": { "LocalFlow": { "command": "C:\\Users\\user.name\\Documents\\git\\local_flow\\flow-env\\Scripts\\python.exe", "args": ["C:\\Users\\user.name\\Documents\\git\\local_flow\\rag_mcp_server.py"], "env": { "RAG_DATA_DIR": "C:\\Users\\user.name\\Documents\\flow_db" }, "scopes": ["rag_read", "rag_write"], "tools": ["add_source", "query_context", "list_sources", "remove_source"] } } }
{ "mcpServers": { "LocalFlow": { "command": "/mnt/c/Users/your.name/Documents/git/local_flow/flow-env/Scripts/python.exe", "args": [ "C:\\Users\\your.name\\Documents\\git\\local_flow\\rag_mcp_server.py" ], "env": { "RAG_DATA_DIR": "C:\\Users\\your.name\\Documents\\flow_db" } } } }
When using WSL confcannot execute binary fileindicates WSL interop is disabled. Fix it:
# Add to /etc/wsl.conf [interop] enabled = true appendWindowsPath = true
Then restart WSL from PowerShell:wsl --shutdown.UNC pathsnot supported is a related warning. If this is not persistent on restarts, you can manually register with the following from your target WSL2 distribution.
sudo sh -c 'echo ":WSLInterop:M::MZ::/init:PF" > /proc/sys/fs/binfmt_misc/register'
IfRAG_DATA_DIRisn't being picked up (vector_db path shows\\wsl.localhost\...in logs), hardcode the fallback inrag_mcp_server.py-- the curernt fallback is my local path:
VECTOR_DB_PATH = os.environ.get("RAG_DATA_DIR") or "C:\\Users\\your.name\\Documents\\flow_db"
Tell Cursor to use theadd_sourcetool, like magic, but with more dependencies.
- Source type:pdf/path/to/your/document.pdf
- Path:(Linux) orC:\path\to\document.pdf(Windows)
- Source ID: Whatever makes you happy (Optional)
- Source type:webpagehttps://stackoverflow.com/questions/definitely-not-copy-pasted
- URL:
- Source ID: Optional
- Source type:git_repohttps://github.com/someone/vibed/tree.git
- URL:or local path
- Source ID: Optional
- Query: "What does this thing actually do?"
- Top K: How many results you want (default: 5)
- Source IDs: Filter to specific sources (optional)
- list_sources- See what you've fed the machineremove_source
- - Pretend to delete things (metadata only)
"Tool not found": Did you restart Cursor? Restart Cursor."CUDA out of memory": Your GPU is having feelings. Try smaller batch sizes or less ambitious documents."It's not working": That's not a question. But yes, I agree.
Your prompts should indicate one of the following behaviours:
- Listing the sources currently available.
- Indexing a new source (given some local path)
- Removing a source (from metadata, not embeddings)
- Querying existing source(s) given some prompt, from which keywords/phrases are generated. You can modulate parameters such astop_k, requesting a greater sample of the top ranked return document chunks.
"What sources are available in the local Flow tool?"
Azure & Machine Learning
"Give me an example of a synthesis parameter I could edit in Vivado to improve my build speed?" -> Ran query_context:LocalFlow -> Query:
"query": "synthesis parameters settings options improve build speed runtime performance" "source_ids": [ "vivado_2019_1_synthesis_guide" ], "top_k": 10
-> Response (raw, this is used to inform the answer):
{ "results": [ { "content": "MAX_FANOUT option described in Chapter 2, Synthesis Attributes.\nNote: The -fanout_limit switch does not impact control signals (such as set, reset, clock\nenable): use MAX_FANOUT to replicate these signals if needed.\n-directive: Replaces the -effort_level option. When specified, this option runs\n°\nVivado synthesis with different optimizations. See Table 1-2 for a list of all\nstrategies and settings. Values are:\n- Default: Default settings. See Table 1-2.\n- RuntimeOptimized: Performs fewer timing optimizations and eliminates some\nRTL optimizations to reduce synthesis run time.\n- AreaOptimized_high: Performs general area optimizations including forcing\nternary adder implementation, applying new thresholds for use of carry chain in\ncomparators, and implementing area-optimized multiplexers.\nSynthesis 12\nSend Feedback\nUG901 (v2019.1) June 12, 2019 www.xilinx.com", "source": "C:\\Users\\helios.lyons\\Documents\\flow_src\\ug901-20191-vivado-synthesis.pdf", "metadata": { "source": "C:\\Users\\helios.lyons\\Documents\\flow_src\\ug901-20191-vivado-synthesis.pdf", "page": 12, "source_type": "pdf", "source_id": "vivado_2019_1_synthesis_guide" } [...]
-> Prompt completion (using chunks from the response):
Based on the Vivado Synthesis Guide (UG901), here's a great example: -directive RuntimeOptimized This is the most impactful single parameter for reducing synthesis time. It performs fewer timing optimizations and eliminates some RTL optimizations to reduce run time.`
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
Fetch, convert, and search AWS documentation pages, with recommendations for related content.
Search campgrounds around the world on campertunity, check availability, and provide booking links.
The Ferryhopper MCP Server exposes ferry routes, schedules and booking redirects so an AI assistant can discover connections across Europe and the Mediterranean and send users to Ferryhopper to complete bookings.
All-in-One SEO & Web Intelligence Toolkit API from FetchSERP.
MCP server that provides read-only access to HyperKitty, the web-based email archive component of Mailman 3.
At Sunrise Apps, we believe AI agents should be limitless, especially when it comes to visual data. We created ImageSorcery to bridge the critical gap in AI's ability to interact with and manipulate images directly, all while upholding the highest standards of privacy and security.
Just Domain is the domain registrar for businesses built with AI. Its remote MCP server checks availability and returns first-year and renewal pricing, plus a link to register on justdomain.ai, with DNS and WHOIS privacy in the same place. No account, no API key, read only. Endpoint: https://mcp.justdomain.ai/
Research tools, including a Sqlite-backed document stash
Semantic search over 9 free-license stock photo sources. Hosted remote server with OAuth — no API key to paste.
SerpApi MCP Server for Google and other search engine results
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




