<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex</title>
    <description>The latest articles on DEV Community by Alex (@ab_as_62eafcb6a433008952b).</description>
    <link>https://dev.to/ab_as_62eafcb6a433008952b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4010844%2F77a8c5ad-5c81-4cc1-9dc9-c779f0a67f0d.png</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/ab_as_62eafcb6a433008952b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ab_as_62eafcb6a433008952b"/>
    <language>en</language>
    <item>
      <title>We Indexed 57,638 Documents in 1.6 Seconds on a 6-Core CPU. Here's What We Built.</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 26 Nov 2026 16:23:28 +0000</pubDate>
      <link>https://dev.to/ab_as_62eafcb6a433008952b/we-indexed-57638-documents-in-16-seconds-on-a-6-core-cpu-heres-what-we-built-54bc</link>
      <guid>https://dev.to/ab_as_62eafcb6a433008952b/we-indexed-57638-documents-in-16-seconds-on-a-6-core-cpu-heres-what-we-built-54bc</guid>
      <description>&lt;p&gt;&lt;strong&gt;No GPU. No embedding API. No external vector database. Just Rust, a lightweight embedding model, and some deliberate engineering trade-offs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building a RAG system often means assembling several independent components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A parser to extract content from documents.&lt;/li&gt;
&lt;li&gt;An embedding model, usually running on a GPU or behind an API.&lt;/li&gt;
&lt;li&gt;A vector database for semantic similarity.&lt;/li&gt;
&lt;li&gt;A keyword search engine.&lt;/li&gt;
&lt;li&gt;A reranker to improve relevance.&lt;/li&gt;
&lt;li&gt;A context builder to prepare retrieved information for an LLM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each component works. The problem is the amount of infrastructure required to make them work together.&lt;/p&gt;

&lt;p&gt;We started asking a different question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if the entire retrieval pipeline could run inside a single process on an ordinary CPU?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That question led us to build &lt;strong&gt;SynRAG&lt;/strong&gt;, a self-hosted retrieval engine written in Rust, with its own multilingual embedding model called Synapse.&lt;/p&gt;

&lt;p&gt;The result is a roughly 3 MB engine binary, an 86 MB embedding model, and a retrieval pipeline that doesn't require a GPU.&lt;/p&gt;

&lt;p&gt;We recently published the first public version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Synlabs-ai/synrag" rel="noopener noreferrer"&gt;https://github.com/Synlabs-ai/synrag&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The 1.6-second experiment
&lt;/h2&gt;

&lt;p&gt;Let's start with the most interesting result.&lt;/p&gt;

&lt;p&gt;We used FiQA, a public financial question-answering retrieval dataset containing &lt;strong&gt;57,638 relatively short documents, approximately 44 MB of text&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The benchmark measured the time from process startup until the entire collection became searchable. It included reading the data, loading the model, generating embeddings, and constructing the search indexes.&lt;/p&gt;

&lt;p&gt;Our test machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AMD Ryzen 5 7500F — 6 cores / 12 threads&lt;/li&gt;
&lt;li&gt;31 GB RAM&lt;/li&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;No GPU used by SynRAG&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is what we measured:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Time until searchable&lt;/th&gt;
&lt;th&gt;Memory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SynRAG BM25 only&lt;/td&gt;
&lt;td&gt;0.45 s&lt;/td&gt;
&lt;td&gt;325 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SynRAG BM25 + Synapse&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.6 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;443 MB&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SynRAG full indexing mode&lt;/td&gt;
&lt;td&gt;4.8 s&lt;/td&gt;
&lt;td&gt;475 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tantivy + multilingual Model2Vec&lt;/td&gt;
&lt;td&gt;2.8 s&lt;/td&gt;
&lt;td&gt;1.85 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elasticsearch BM25&lt;/td&gt;
&lt;td&gt;12.7 s&lt;/td&gt;
&lt;td&gt;4.9 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EmbeddingGemma on RTX 5060 Ti&lt;/td&gt;
&lt;td&gt;282 s&lt;/td&gt;
&lt;td&gt;2.8 GB RAM + 5.6 GB VRAM&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are our measurements under the configurations documented in the repository. They are not universal performance guarantees.&lt;/p&gt;

&lt;p&gt;Also, an important qualification: &lt;strong&gt;57,638 FiQA documents are not 57,638 long PDFs&lt;/strong&gt;. The corpus is only 44 MB. Indexing time depends heavily on document size, parsing complexity, and the chosen retrieval mode.&lt;/p&gt;

&lt;p&gt;But this experiment demonstrates something useful: a complete hybrid retrieval index can become searchable in seconds without GPU acceleration.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Why we didn't use a conventional transformer for embeddings
&lt;/h2&gt;

&lt;p&gt;For many RAG applications, generating embeddings is one of the most computationally expensive steps.&lt;/p&gt;

&lt;p&gt;Transformer-based embedding models can produce excellent representations, but their inference cost becomes noticeable when indexing hundreds of thousands or millions of documents.&lt;/p&gt;

&lt;p&gt;Our goal wasn't to beat every transformer on retrieval quality.&lt;/p&gt;

&lt;p&gt;It was to explore a different performance-quality trade-off.&lt;/p&gt;

&lt;p&gt;We developed &lt;strong&gt;Synapse&lt;/strong&gt;, a compact multilingual encoder distilled from EmbeddingGemma.&lt;/p&gt;

&lt;p&gt;Some characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;21.3 million parameters&lt;/li&gt;
&lt;li&gt;256-dimensional embeddings&lt;/li&gt;
&lt;li&gt;A convolutional architecture with a local token window and a global gate&lt;/li&gt;
&lt;li&gt;Approximately 5,000 multiplications per token in the benchmarked configuration&lt;/li&gt;
&lt;li&gt;CPU-native inference&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On our six-core machine, Synapse processed approximately &lt;strong&gt;51,600 short FiQA-sized documents per second&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That number needs context.&lt;/p&gt;

&lt;p&gt;Static embedding approaches such as Model2Vec can be equally fast or faster. In our tests, multilingual Model2Vec reached about 56,400 documents per second, while its English-only variant was dramatically faster.&lt;/p&gt;

&lt;p&gt;So raw embedding throughput isn't our unique advantage.&lt;/p&gt;

&lt;p&gt;The design is about what happens when a lightweight semantic representation is combined with traditional lexical retrieval.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. We kept BM25 for a reason
&lt;/h2&gt;

&lt;p&gt;Semantic search and keyword search solve different problems.&lt;/p&gt;

&lt;p&gt;Imagine searching a collection of technical documents for:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What caused the WAL recovery failure?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Exact terms such as &lt;code&gt;WAL&lt;/code&gt;, error identifiers, function names, and configuration keys can be extremely important.&lt;/p&gt;

&lt;p&gt;A semantic model may understand the general meaning, but BM25 can preserve exact lexical matches that shouldn't be lost.&lt;/p&gt;

&lt;p&gt;Now consider:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How can we restore the database after an unexpected shutdown?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here, semantic similarity can retrieve relevant material even if the documents use different terminology.&lt;/p&gt;

&lt;p&gt;SynRAG combines both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    User query
                         |
                 Query processing
                         |
             +-----------+-----------+
             |                       |
         BM25 search           Synapse vectors
             |                       |
             +-----------+-----------+
                         |
                  Score fusion
                         |
                 Candidate results
                         |
                Optional reranker
                         |
               Context compression
                         |
                 Cited LLM context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal isn't to replace BM25 with embeddings.&lt;/p&gt;

&lt;p&gt;It's to make the two retrieval signals work together efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What about retrieval quality?
&lt;/h2&gt;

&lt;p&gt;Speed means very little if the engine retrieves the wrong documents.&lt;/p&gt;

&lt;p&gt;We evaluated SynRAG using nDCG@10 on public retrieval datasets, comparing systems on the same test machine.&lt;/p&gt;

&lt;p&gt;Here are the averages for three English BEIR datasets: SciFact, NFCorpus, and FiQA.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Average nDCG@10&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Elasticsearch BM25&lt;/td&gt;
&lt;td&gt;0.424&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SynRAG fast&lt;/td&gt;
&lt;td&gt;0.441&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SynRAG full + reranker&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.455&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bge-small-en-v1.5&lt;/td&gt;
&lt;td&gt;0.478&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EmbeddingGemma&lt;/td&gt;
&lt;td&gt;0.503&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;EmbeddingGemma wins here.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The gap is meaningful. On these English benchmarks, SynRAG is not the strongest retrieval system.&lt;/p&gt;

&lt;p&gt;We also evaluated four additional English datasets that were not used for tuning.&lt;/p&gt;

&lt;p&gt;SynRAG reached 0.518 average nDCG@10, while an Elasticsearch + EmbeddingGemma hybrid reached 0.561.&lt;/p&gt;

&lt;p&gt;That's a limitation we don't want to hide.&lt;/p&gt;

&lt;p&gt;On the other hand, results in multilingual retrieval are more encouraging.&lt;/p&gt;

&lt;p&gt;On our five-language MLQA evaluation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SynRAG + reranker: &lt;strong&gt;0.664&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;EmbeddingGemma: &lt;strong&gt;0.658&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Multilingual E5 small: &lt;strong&gt;0.624&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Elasticsearch BM25: &lt;strong&gt;0.585&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And on a 14-language Belebele evaluation, SynRAG reached &lt;strong&gt;0.874&lt;/strong&gt; compared with &lt;strong&gt;0.852&lt;/strong&gt; for EmbeddingGemma.&lt;/p&gt;

&lt;p&gt;The aggregate advantage there came primarily from lower-resource languages such as Kazakh, Uzbek, Kyrgyz, and Tajik. EmbeddingGemma performed better on several larger languages.&lt;/p&gt;

&lt;p&gt;Cross-lingual retrieval, where the question and relevant documents are in different languages, remains a weakness.&lt;/p&gt;

&lt;p&gt;These are internal evaluations, with methods and benchmark code published for reproduction—not a claim of independently certified superiority.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Retrieval latency below one millisecond
&lt;/h2&gt;

&lt;p&gt;We also measured HTTP search performance on the FiQA corpus.&lt;/p&gt;

&lt;p&gt;Using persistent HTTP connections, the SynRAG fast retrieval mode achieved:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Median latency&lt;/td&gt;
&lt;td&gt;0.76 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p95 latency&lt;/td&gt;
&lt;td&gt;1.07 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p99 latency&lt;/td&gt;
&lt;td&gt;1.23 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Throughput, 12 clients&lt;/td&gt;
&lt;td&gt;6,325 queries/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server memory&lt;/td&gt;
&lt;td&gt;315 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Enabling the reranker increased median latency to 3.17 ms in that evaluation.&lt;/p&gt;

&lt;p&gt;This illustrates another deliberate trade-off.&lt;/p&gt;

&lt;p&gt;Not every search needs the most expensive retrieval configuration.&lt;/p&gt;

&lt;p&gt;An agent doing repeated tool calls may benefit more from fast first-stage retrieval. A research assistant answering complex questions may justify spending additional milliseconds on reranking.&lt;/p&gt;

&lt;p&gt;We expose those choices rather than assuming one configuration should serve every workload.&lt;/p&gt;

&lt;p&gt;And these sub-millisecond figures apply to the tested FiQA index—not arbitrary corpora or distributed deployments.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. We also tested 8.8 million passages
&lt;/h2&gt;

&lt;p&gt;Small benchmarks are useful, but they don't tell you enough about memory behavior or larger indexes.&lt;/p&gt;

&lt;p&gt;We therefore indexed approximately &lt;strong&gt;8.8 million MS MARCO passages&lt;/strong&gt; on a single server.&lt;/p&gt;

&lt;p&gt;Results:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Indexing time&lt;/th&gt;
&lt;th&gt;Median query latency&lt;/th&gt;
&lt;th&gt;Peak RAM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BM25&lt;/td&gt;
&lt;td&gt;22 s&lt;/td&gt;
&lt;td&gt;7.1 ms&lt;/td&gt;
&lt;td&gt;15.2 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BM25 + Synapse&lt;/td&gt;
&lt;td&gt;142 s&lt;/td&gt;
&lt;td&gt;9.9 ms&lt;/td&gt;
&lt;td&gt;16.2 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's 2 minutes and 22 seconds for hybrid indexing on the tested machine.&lt;/p&gt;

&lt;p&gt;There are important limits to this result: the index used approximately 16 GB of RAM, quality still trailed retrieval models trained specifically for MS MARCO, and we have not validated 100-million-document production deployments.&lt;/p&gt;

&lt;p&gt;We're publishing the measured limits rather than extrapolating them into unsupported scale claims.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. The most overlooked part of RAG: context construction
&lt;/h2&gt;

&lt;p&gt;Retrieving a relevant document doesn't automatically make it useful to an LLM.&lt;/p&gt;

&lt;p&gt;A conventional pipeline often retrieves several chunks and concatenates them until the context budget is exhausted.&lt;/p&gt;

&lt;p&gt;But the information that answers a question may occupy only a few sentences.&lt;/p&gt;

&lt;p&gt;SynRAG includes a context builder that selects relevant sentences under a token budget and attaches source citations.&lt;/p&gt;

&lt;p&gt;For example, an agent can receive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customers may request a refund within
30 days of purchase [1].

Enterprise subscriptions are governed
by the terms of the signed agreement [2].
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alongside structured source metadata that identifies the original documents.&lt;/p&gt;

&lt;p&gt;We evaluated this approach with Qwen3-8B on 2,100 multilingual questions, keeping retrieved documents consistent between approaches.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Context strategy&lt;/th&gt;
&lt;th&gt;Answer F1&lt;/th&gt;
&lt;th&gt;Prompt tokens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Concatenate retrieved documents&lt;/td&gt;
&lt;td&gt;0.394&lt;/td&gt;
&lt;td&gt;624&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SynRAG compact context&lt;/td&gt;
&lt;td&gt;0.395&lt;/td&gt;
&lt;td&gt;357&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That is approximately &lt;strong&gt;43% fewer prompt tokens at comparable answer quality&lt;/strong&gt; in this experiment.&lt;/p&gt;

&lt;p&gt;The result doesn't mean we invented some mysterious compression algorithm.&lt;/p&gt;

&lt;p&gt;A simple sentence-selection baseline already captures much of the benefit.&lt;/p&gt;

&lt;p&gt;The practical lesson is that &lt;strong&gt;retrieval and prompt construction should be optimized together&lt;/strong&gt;, rather than treating the prompt as a pile of search results.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Try it on your own documents
&lt;/h2&gt;

&lt;p&gt;SynRAG currently supports Linux x86-64. Windows users can run it through WSL2.&lt;/p&gt;

&lt;p&gt;Install the engine and models:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://ai.synlabs.pro/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then index a folder containing your documents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;M&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$HOME/.synrag/models"&lt;/span&gt;

synrag index ./docs \
  -o docs.syn \
  --student &lt;span class="s2"&gt;"$M/synapse.synm"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Search:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;synrag search docs.syn \
  &lt;span class="s2"&gt;"how do refunds work"&lt;/span&gt; \
  -k 5 \
  --student &lt;span class="s2"&gt;"$M/synapse.synm"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or generate a citation-aware context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;synrag context docs.syn \
  &lt;span class="s2"&gt;"how do refunds work"&lt;/span&gt; \
  --budget 600 \
  --student &lt;span class="s2"&gt;"$M/synapse.synm"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also run SynRAG as an HTTP service, connect using the Python SDK, or expose retrieval tools through MCP.&lt;/p&gt;

&lt;p&gt;The MCP server runs in the user's environment and connects AI clients such as Claude and Cursor to local or self-hosted SynRAG indexes.&lt;/p&gt;

&lt;p&gt;Your document index doesn't need to be hosted by SynLabs. If you connect the MCP client to a cloud LLM, however, retrieved content may be sent to that LLM provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. What we're releasing
&lt;/h2&gt;

&lt;p&gt;The public repository includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux engine binaries and model downloads&lt;/li&gt;
&lt;li&gt;Python SDK and connectors&lt;/li&gt;
&lt;li&gt;MCP server&lt;/li&gt;
&lt;li&gt;Docker setup&lt;/li&gt;
&lt;li&gt;Installation scripts&lt;/li&gt;
&lt;li&gt;API documentation&lt;/li&gt;
&lt;li&gt;Benchmark methodology and reproduction scripts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Licensing transparency:&lt;/strong&gt; the Rust engine and model weights are proprietary, not open source. The Community edition is free for commercial use up to one million indexed chunks per organization. The Python SDK, MCP integration, and supporting code are Apache 2.0.&lt;/p&gt;

&lt;p&gt;We deliberately chose a model where developers can use the Community edition without sending their data to us or obtaining an activation token from an online service.&lt;/p&gt;

&lt;p&gt;Commercial editions add capacity and enterprise capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. What we'd like developers to test
&lt;/h2&gt;

&lt;p&gt;There are several questions we'd genuinely like outside feedback on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First: retrieval quality on real documents.&lt;/strong&gt; Public benchmarks can only tell us so much. How well does this approach work on your codebases, documentation, tickets, policies, or knowledge bases?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second: multilingual behavior.&lt;/strong&gt; We're particularly interested in feedback from teams working with languages that don't get as much attention in mainstream embedding benchmarks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third: the CPU-only trade-off.&lt;/strong&gt; For your workload, would you prefer stronger GPU-based embeddings, or lower infrastructure requirements and faster indexing?&lt;/p&gt;

&lt;p&gt;We think both approaches have a place.&lt;/p&gt;

&lt;p&gt;Our goal with SynRAG isn't to claim that every RAG pipeline should be rewritten in Rust.&lt;/p&gt;

&lt;p&gt;It's to demonstrate that a substantial part of retrieval infrastructure can run efficiently on ordinary CPUs—and to find out where that architecture is genuinely useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source and installation:&lt;/strong&gt; &lt;a href="https://github.com/Synlabs-ai/synrag" rel="noopener noreferrer"&gt;https://github.com/Synlabs-ai/synrag&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full benchmarks and reproduction details:&lt;/strong&gt; &lt;a href="https://github.com/Synlabs-ai/synrag/blob/main/BENCHMARKS.md" rel="noopener noreferrer"&gt;https://github.com/Synlabs-ai/synrag/blob/main/BENCHMARKS.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://ai.synlabs.pro/" rel="noopener noreferrer"&gt;https://ai.synlabs.pro/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try it, we'd appreciate an issue with your dataset characteristics, latency numbers, and any cases where retrieval fails.&lt;/p&gt;

&lt;p&gt;Those failures are often more useful than another impressive benchmark result.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>rag</category>
    </item>
    <item>
      <title>From Python/Pandas to Rust/C++: taking our tick simulation from 140ms to microseconds per window</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Wed, 01 Jul 2026 11:51:26 +0000</pubDate>
      <link>https://dev.to/ab_as_62eafcb6a433008952b/from-pythonpandas-to-rustc-taking-our-tick-simulation-from-140ms-to-microseconds-per-window-4e8f</link>
      <guid>https://dev.to/ab_as_62eafcb6a433008952b/from-pythonpandas-to-rustc-taking-our-tick-simulation-from-140ms-to-microseconds-per-window-4e8f</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;We're a small ML lab building alpha models for a handful of partners. Our market &lt;strong&gt;simulation&lt;/strong&gt; loop — the part that keeps you honest about look-ahead bias — was 900–1300 ms per window in Python/Pandas, which made every experiment a 6–20 hour run. We went &lt;strong&gt;pandas → numpy → hand-written Rust + C++ models&lt;/strong&gt; and landed at 1–5 ms per window on a cheap cloud box (4–40 µs on a high-clock CPU). This is the honest engineering story, and an actual question at the end for anyone who does HFT/MM.&lt;/p&gt;

&lt;p&gt;Not a pitch — I'll explain why at the bottom.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: simulation, not latency
&lt;/h2&gt;

&lt;p&gt;Our whole training stack is Python: feature engineering → targets → training → backtests → and the one that actually matters, &lt;strong&gt;simulation&lt;/strong&gt; (strict, no look-ahead).&lt;/p&gt;

&lt;p&gt;Simulation is brutal on compute. On 1m/5m bars over years of history, a single run on a normal workstation took &lt;strong&gt;6–20 hours&lt;/strong&gt;. For each window we compute several hundred features, then run inference. Data → features → inference of one window was &lt;strong&gt;900–1300 ms&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We never cared about that latency for trading. We cared because &lt;strong&gt;every experiment took a day&lt;/strong&gt;, and I had a backlog of hypotheses to test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: pandas → numpy
&lt;/h2&gt;

&lt;p&gt;Being Python people, the first move was obvious: rip pandas out of the hot path and go numpy. Real win — &lt;strong&gt;~140 ms/window&lt;/strong&gt;. We could finally evaluate models across more angles.&lt;/p&gt;

&lt;p&gt;But rolling-window recomputation and allocation churn were still the ceiling, and 140 ms only let me run the basic experiments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: accepting the language was the wall
&lt;/h2&gt;

&lt;p&gt;My friend has written Rust for years and never shut up about it: &lt;em&gt;"your Python is nonsense, rewrite it in Rust."&lt;/em&gt; We argued for years about whether Rust is always worth it.&lt;/p&gt;

&lt;p&gt;This time I got it: no matter what CPU I throw at it, the GIL and Python's overhead cap me. There was no way up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Rust + C++
&lt;/h2&gt;

&lt;p&gt;Not fast, not easy — we rewrote &lt;strong&gt;every feature in Rust&lt;/strong&gt;, with &lt;strong&gt;O(1) incremental state per tick&lt;/strong&gt; instead of recomputing rolling windows. That single change killed both the allocation churn and the latency variance. Then we converted the &lt;strong&gt;models to a C++ engine AOT-compiled for the target CPU&lt;/strong&gt;, called over FFI.&lt;/p&gt;

&lt;p&gt;Results, full cycle, one window:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Latency/window&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Python / pandas&lt;/td&gt;
&lt;td&gt;~140 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cheap cloud box (vCPU)&lt;/td&gt;
&lt;td&gt;1–5 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High-clock AMD test rig&lt;/td&gt;
&lt;td&gt;4–40 µs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Simulations that took hours now take minutes. The memory-leak whack-a-mole is gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part I didn't expect
&lt;/h2&gt;

&lt;p&gt;The interesting outcome wasn't prod speed — it's the experiments this &lt;strong&gt;unlocked&lt;/strong&gt;. We can now run real &lt;strong&gt;tick-level simulation&lt;/strong&gt; (not a backtest) to test ideas we simply couldn't touch before, including some inspired by Michael Levin's work (bioelectric / collective-behavior stuff that turns out useful well beyond biology). In Python that was infeasible; in Rust it's basically bounded only by infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify it yourself (no cherry-picked CSVs)
&lt;/h2&gt;

&lt;p&gt;We stream raw live signals to a public board. Every signal is written to public S3 at generation time, immutable, with a microsecond timestamp — so you can confirm there's &lt;strong&gt;no look-ahead&lt;/strong&gt;: &lt;code&gt;signal_gen_time &amp;gt; bar_time&lt;/code&gt;, for every single one. The demo box also reports its real inference latency (you'll see ms, not µs — cheap silicon, honest number).&lt;/p&gt;

&lt;h2&gt;
  
  
  Where we're NOT flexing
&lt;/h2&gt;

&lt;p&gt;We have real data-feed latency and &lt;strong&gt;zero colocation / kernel-bypass / exchange adjacency&lt;/strong&gt;. This is fast &lt;em&gt;compute&lt;/em&gt;, not a colocated HFT desk. Not pretending otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest question
&lt;/h2&gt;

&lt;p&gt;If anyone here actually runs &lt;strong&gt;HFT / market-making&lt;/strong&gt; in production: given fast compute but no colo (real feed latency), is any of this usable in prod? Our only idea so far is &lt;strong&gt;adverse-selection defense for market-making&lt;/strong&gt; — skew/pull quotes ahead of a microstructure move. We might be completely wrong. I'd love a reality check from someone who's actually done it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this isn't an ad
&lt;/h2&gt;

&lt;p&gt;We don't sell to retail, and I doubt there are buyers for this among readers here. I'm writing it because this community appreciates a real Rust-rewrite story and will tear bad engineering apart — which is exactly what I want.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rust is cool. That's the post.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Links&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live board (raw signals + real inference latency): &lt;a href="https://livefinai.synlabs.pro/" rel="noopener noreferrer"&gt;https://livefinai.synlabs.pro/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>rust</category>
      <category>performance</category>
      <category>showdev</category>
      <category>python</category>
    </item>
  </channel>
</rss>
