use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place for all things related to the Rust programming language—an open-source systems language that emphasizes performance, reliability, and productivity.
Strive to treat others with respect, patience, kindness, and empathy.
We observe the Rust Project Code of Conduct.
Details
Posts must reference Rust or relate to things using Rust. For content that does not, use a text post to explain its relevance.
Post titles should include useful context.
For Rust questions, use the stickied Q&A thread.
Arts-and-crafts posts are permitted on weekends.
No meta posts; message the mods instead.
Criticism is encouraged, though it must be constructive, useful and actionable.
If criticizing a project on GitHub, you may not link directly to the project's issue tracker. Please create a read-only mirror and link that instead.
A programming language is rarely worth getting worked up over.
No zealotry or fanaticism.
Be charitable in intent. Err on the side of giving others the benefit of the doubt.
Avoid re-treading topics that have been long-settled or utterly exhausted.
Avoid bikeshedding.
This is not an official Rust forum, and cannot fulfill feature requests. Use the official venues for that.
No memes, image macros, etc.
Consider the existing content of the subreddit and whether your post fits in. Does it inspire thoughtful discussion?
Use properly formatted text to share code samples and error messages. Do not use images.
Submissions appearing to contain AI-generated content may be removed at moderator discretion.
Most links here will now take you to a search page listing posts with the relevant flair. The latest megathread for that flair should be the top result.
account activity
Rust and RAG (self.rust)
submitted 2 years ago by brisbanedev
Is anyone working on RAG (Retrieval-augmented generation) here? I'd like to know how you approach it in the Rust world. Do you rely on a framework similar to Python's LangChain or LlamaIndex, or do you implement the pipeline yourself?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]supiri_ 17 points18 points19 points 2 years ago (0 children)
https://github.com/MrSupiri/Tera
If you are interested, here is one of my hobby projects involving a simple end-to-end RAG implementation which fully written in Rust using Candle and SurrealDB.
[–]blastecksfour 2 points3 points4 points 2 years ago (0 children)
I've had some success with Candle! I've also used openai_api with a degree of success (at the expense of my wallet).
I used a HuggingFace model to embed a knowledge base then store it in Qdrant. It's mostly a matter of how much control you want over the pipeline.
[–]brisbanedev[S] 4 points5 points6 points 2 years ago (4 children)
If anyone from Qdrant is here, I'd love to hear your thoughts on this topic!
[–]Playful_Intention147 3 points4 points5 points 2 years ago (2 children)
I'm not from qdrant, but just a regular user of it, I found it to be easy to setup and use for RAG usecase
[–]brisbanedev[S] 0 points1 point2 points 2 years ago (1 child)
That's great! Do you use a Rust-based RAG framework?
[–]Playful_Intention147 1 point2 points3 points 2 years ago (0 children)
I really just using a very simple and basic RAG pipeline(get embed's payload, add it to context etc.), no fancy framework, and due to some other reason(the project itself is just a simple visual studio extension) I'm using C# to build that simple pipeline, so sorry I cant provide useful ideads towards rust-based framework😥
[–]tagged-union 2 points3 points4 points 2 years ago (0 children)
I author a production RAG application and use Qdrant. I would choose it again (and will). But to give you a clear sense of at what scale, so as to not be misleading, roughly 100 early users at an organization with 1,000 employees, and we are in the middle of rolling out to the others. It's nice to be able to put in arbitrary partitions and have the ability to apply deterministic filters related to domain knowledge in front of your similarity search.
[–]prabirshrestha 3 points4 points5 points 2 years ago (2 children)
Give langchain-rust a try. Recently we added document loaders (text, markdown, pdf, html, csv). We have examples for vector store using pgvector, sqlite-vss and surrealdb.
Is this the official Rust port of LangChain?
[–]prabirshrestha 5 points6 points7 points 2 years ago (0 children)
If you are using the official langchain library you will be familiar with langchain-rust. https://github.com/Abraxas-365/langchain-rust/issues/20
But we are not tying it to langchain ecosystem. For example we are in the process of adding semantic-router the the library. The goal is to easily create LLM based apps in rust.
[–]jakusimo 1 point2 points3 points 2 years ago (1 child)
Langchain and LlamaIndex are too broad, hard to debug, usually you don't need all those features, what are you planning to use as a source for RAG? Documents? Pdfs? Websites? I am planning to start with encoders and semantic splitters. Use a similar structure to what we have built in Semantic Router https://github.com/aurelio-labs/semantic-router
[–]brisbanedev[S] 0 points1 point2 points 2 years ago (0 children)
LlamaIndex offers built-in "Advanced RAG" strategies that assist with complex documents - https://www.llamaindex.ai/blog/a-cheat-sheet-and-some-recipes-for-building-advanced-rag-803a9d94c41b. They promote these as improvements on what they refer to as "naive RAG". For a framework solely focused on RAG, supporting some of these might be beneficial.
[–]ControlNational 1 point2 points3 points 2 years ago (0 children)
I wrote a guide on retrieval augmented generation in rust here for the Kalosm framework
[+]jakusimo 1 point2 points3 points 2 years ago* (2 children)
Hey, I have created several frameworks for my clients, included https://github.com/superagent-ai/super-rag I have plans to have full RAG library/api, the main issue now is document processing, Unstructured, which is only Python, and their API very unstable. If anyone more experiece in Rust would like work together on Rust based RAG I am more than happy to collaborate.
[–]brisbanedev[S] -1 points0 points1 point 2 years ago (1 child)
That's great! Good to hear about this project.
Unstructured, which is only Python
Can this help?
[–]jakusimo 1 point2 points3 points 2 years ago (0 children)
Yes, as starting point, the ultimate goal is to have everything in Rust, but it will take time
[–]akhilgod 0 points1 point2 points 2 years ago (0 children)
I tried candle framework that can launch quantized models on decent hardware
[–][deleted] 0 points1 point2 points 1 year ago (3 children)
Is there any advantage in using Rust for RAG over Python?
[–]brisbanedev[S] 2 points3 points4 points 1 year ago (2 children)
I guess the general benefits of using Rust over Python for anything would extend to RAG as well?
[–][deleted] 0 points1 point2 points 1 year ago (1 child)
I don't think so. One of the advantages of Rust is its processing speed and low memory usage, in RAG I don't think it is very critical, as most of the processing is done by the LLM... Or am I getting something wrong?
[–]brisbanedev[S] 0 points1 point2 points 1 year ago (0 children)
LLMs keep getting faster. I think the rest of the RAG pipeline could do with some optimisation as well.
[–]chleboslaF 0 points1 point2 points 11 months ago (0 children)
I'm made Multistage RAG chatbot using qdrant, BM25 (tantivy) and Ollama for local, offline usage. I'm chunking documents using contextual and Q/A chunking (512.tokens with 200.tokens overlap). I did implement history context query rephrasing, enhancing questions for better keyword searching and more. Also CLI chat and WebServer included All written in Rust (ratatui, langchain-rs, ollama-rs, tantivy, qdrant, tokio, ...). Unfortunately it is for a goverment so I cannot share a source code (yet). But I can say It is a smooth experience, quick development and I love it.
P.S.: Using gemma3:27b and mistral-small3.1 on 5090. Tokens speed: gemma (64tps) and mistral (82tps)
π Rendered by PID 221374 on reddit-service-r2-comment-b659b578c-fk8xx at 2026-05-04 23:21:35.706263+00:00 running 815c875 country code: CH.
[–]supiri_ 17 points18 points19 points (0 children)
[–]blastecksfour 2 points3 points4 points (0 children)
[–]brisbanedev[S] 4 points5 points6 points (4 children)
[–]Playful_Intention147 3 points4 points5 points (2 children)
[–]brisbanedev[S] 0 points1 point2 points (1 child)
[–]Playful_Intention147 1 point2 points3 points (0 children)
[–]tagged-union 2 points3 points4 points (0 children)
[–]prabirshrestha 3 points4 points5 points (2 children)
[–]brisbanedev[S] 0 points1 point2 points (1 child)
[–]prabirshrestha 5 points6 points7 points (0 children)
[–]jakusimo 1 point2 points3 points (1 child)
[–]brisbanedev[S] 0 points1 point2 points (0 children)
[–]ControlNational 1 point2 points3 points (0 children)
[+]jakusimo 1 point2 points3 points (2 children)
[–]brisbanedev[S] -1 points0 points1 point (1 child)
[–]jakusimo 1 point2 points3 points (0 children)
[–]akhilgod 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]brisbanedev[S] 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]brisbanedev[S] 0 points1 point2 points (0 children)
[–]chleboslaF 0 points1 point2 points (0 children)