r/Langchaindev • • Aug 24 '25

Built my own LangChain alternative for multi-LLM routing & analytics

6 Upvotes

I built JustLLMs to make working with multiple LLM APIs easier.

It’s a small Python library that lets you:

  • Call OpenAI, Anthropic, Google, etc. through one simple API

  • Route requests based on cost, latency, or quality

  • Get built-in analytics and caching

  • Install with: pip install justllms (takes seconds)

It’s open source — would love thoughts, ideas, PRs, or brutal feedback.

GitHub: https://github.com/just-llms/justllms
Website: https://www.just-llms.com/

If you end up using it, a ⭐ on GitHub would seriously make my day.


r/Langchaindev • • Oct 25 '24

How to add citations to a Rag

5 Upvotes

I'm building a Rag system but I haven't found a good way to make the LLm output to create citations. Any help here?

How can you create citations when you use an LLM model that uses RAG as it's source, let's say my vector store returns many (+40) pieces of context for the LLM. The LLM needs to parse and select a few of the pieces of context. How can i make it so that the LLM output has citations for the selected sources


r/Langchaindev • • Jul 16 '24

GraphRAG+ LangChain

5 Upvotes

GraphRAG is an advanced RAG system that uses Knowledge Graphs instead of Vector DBs improving retrieval. Check out the implementation using GraphQAChain in this video : https://youtu.be/wZHkeon42Aw


r/Langchaindev • • May 31 '23

✨ Tutorial: Build an LLM-powered app with LangChain and Streamlit in 18 lines of code

5 Upvotes

Learn from Chanin Nantasenamat, (Data Professor) the four simple steps: https://blog.streamlit.io/langchain-tutorial-1-build-an-llm-powered-app-in-18-lines-of-code/


r/Langchaindev • • Aug 27 '25

LangChain keeps “almost working”? use a Problem Map to fix the repeat failures

4 Upvotes

small board, so i’ll keep it real. most LangChain pain is not the model. it is structure. i keep a compact Problem Map with 16 repeat failures that show up in LCEL graphs, Agents, and retrievers. each has a short checklist fix. no infra changes.

what usually breaks in LangChain

  • No.1 retrieval drift. Chroma or FAISS has mixed domains or sloppy chunking. top-k looks fine yet answers wander.

  • No.4 chunking drift. token splitters cut inside rows or tables. CSV and PDFs go off by one.

  • No.6 logic collapse. RunnableSequence looks clean, then the chain violates its own earlier step.

  • No.8 black-box debugging. callbacks are on, but you still cannot tell why a chunk won.

  • No.13 multi-agent chaos. ToolInvocation races, retries multiply the error states.

  • No.14 bootstrap ordering. you call tools before the index is actually ready. silent failures.

  • No.15 deployment deadlock. first requests hit an empty or half-filled vector store.

quick hardening that fits LangChain

  • put a semantic firewall in front of your chain. treat each step as a contract: role, scope, allowed tools, evidence required, budget, stop or rollback codes.

  • add provenance per chunk before embedding: source ids, span boundaries, a tiny semantic checksum.

  • minimal trace schema through callbacks: query → candidates → span ids → reason code → violations → chosen.

  • CI check: fail the build if any step violates its contract or if chunk checksums diverge from source.

60-sec repro

  1. open a fresh chat with your model

  2. upload a small TXT rules file like TXTOS or the core layer

  3. ask: “use WFGY to diagnose my LangChain flow. first answer normally. then re-answer using WFGY. compare depth and stability.” you should see fewer detours, cleaner boundaries, visible recovery when the chain stalls.

one link
Problem Map (No.1..No.16, with checklists):
https://github.com/onestardao/WFGY/tree/main/ProblemMap/README.md


r/Langchaindev • • Jun 07 '25

Anyone looking for a job creating AI agents for companies in Sweden? You are in early. Equity will be awarded along with the companies growth.

4 Upvotes

I am currently building an AI agent agency, with the focus of directly increasing my customers profitability, taking a percentage of the profits that we generate them. I have great knowledge in sales, lead generation, funnel building, lead nurture and all other relevant aspects to how we will make them money

Your job: I will instruct you on what kind of AI agent that you are to build, using langchain or other codebased ai agent creation software.

For example: I have a client that has poor lead nurturing. We will fix it with an AI-agent.

- My job then: Give you instructions on how I want the AI agent to nurture leads.

- Your job: Build the AI agent based on my instructions.

So we combine our expertises to create brilliant AI agents.

You are in early. Equity will be awarded along with the companies growth. At $100 000 profit you get x percent. At $1000000 you get x percent again.

Lets build something great.


r/Langchaindev • • Mar 08 '25

UPDATE THIS WEEK: Tool Calling for DeepSeek-R1 671B is now available on Microsoft Azure

4 Upvotes

Exciting news for DeepSeek-R1 enthusiasts! I've now successfully integrated DeepSeek-R1 671B support for LangChain/LangGraph tool calling on Microsoft Azure for both Python & JavaScript developers!

Python (via Langchain's AzureAIChatCompletionsModel class): https://github.com/leockl/tool-ahead-of-time

JavaScript/TypeScript (via Langchain.js's BaseChatModel class): https://github.com/leockl/tool-ahead-of-time-ts

These 2 methods may also be used for LangChain/LangGraph tool calling support for any newly released models on Azure which may not have native LangChain/LangGraph tool calling support yet.

Please give my GitHub repos a star if this was helpful. Hope this helps anyone who needs this. Have fun!


r/Langchaindev • • Jan 09 '25

Building a Chatbot with Multi-Document Support: Routing Questions to Vector DB or CSV Files**

4 Upvotes

I'm building a chatbot where users can upload multiple structured (CSVs) and unstructured (text documents) files.

  • Unstructured Handling: I'm using a Retrieval Augmented Generation (RAG) model for unstructured data. RAG excels here because it can effectively link questions to the relevant document within a collection of uploaded files.

  • Structured Handling: I'm using a CSV agent to interact with structured data. However, my current CSV agent can only handle one CSV file at a time. To overcome this, I've created a CSV router that directs questions to the correct CSV file based on the question's context.

The Challenge:

I want to create a more sophisticated "master router" that intelligently directs user questions to:

  1. The Vector DB: If the question appears to be related to the content of any of the uploaded unstructured documents.

  2. The specific CSV file: If the question pertains to a particular CSV file.

Inspiration:

Claude AI demonstrates this type of functionality. It can understand and respond to questions about information from various sources, including different documents and data types.

How can I implement this "master router"?


r/Langchaindev • • Dec 15 '24

RAG on excel files

4 Upvotes

Hey guys I’m currently tasked with working on rag for several excel files and I was wondering if someone has done something similar in production already. I’ve seen PandasAI but not sure if I should go for it or if theres a better alternative. I have about 50 excel files.

Also if you have pushed to production, what were the issues you faced? Thanks in advance


r/Langchaindev • • Nov 06 '24

People who make langchain based chatbot, how do you make sure it is responsive and replies back in few seconds inside minutes?

4 Upvotes

I’ve built so many langchain based chatbots & one thing that always tips off the clients is the response time. What do you in such scenarios?


r/Langchaindev • • Oct 18 '24

I built an AI agent to find customers on autopilot!

4 Upvotes

Hey Reddit!

I've been working on an AI-powered agent that helps you find leads and ideal conversations on Reddit and Twitter, all on autopilot.
If you're looking for a way to introduce your product without the constant manual searching, this might be perfect for you!

Key Features:

  • Lead Generation: Automatically spot high-quality leads based on relevant conversations.

  • Mentions & Sentiment Analysis: Find posts and analyze the sentiment behind each mention to reply more effectively.

  • Keyword Filters: Set up positive and negative keywords to fine-tune your targeting.

  • Export leads: Export all your saved leads as CSV for better follow-up!

How it works (Takes less than 2 minutes!):

  1. Add your website & keywords - Just enter your website and product-related keywords.

  2. Find leads & posts - Our AI scans Reddit and Twitter for any mentions that match.

  3. Save profiles as leads - Track every interaction and save potential customers for easy follow-up.

  4. Receive detailed reports - Get regular reports to track mentions and new leads.

Ready to get started?
Give it a try for free and let us know what you think!

👉 scaloom.com


r/Langchaindev • • Jun 17 '24

Best open source document PARSER??!!

4 Upvotes

Right now I’m using LlamaParse and it works really well. I want to know what is the best open source tool out there for parsing my PDFs before sending it to the other parts of my RAG.


r/Langchaindev • • Jan 30 '24

AutoCoder: A description-to-pull-request coding bot built with ActionWeaver, LlamaIndex and LangChain/LangSmith !

4 Upvotes

Hey folks, I want to share a side project I’ve been working on during weekends: AutoCoder! 👨‍💻👩‍💻

🤖 A description-to-pull-request bot that can answer questions, and make code changes to Github repo through natural language instructions. It’s powered by LLM function calling and built with
- 🧠 ActionWeaver for function calling orchestration.
- 📚 LlamaIndex for RAG, including code chunking and advanced RAG technique like Hypothetical Document Embeddings!
- 🛠️ LangSmith for powerful LLM tracing and debugging!
- API toolings from LangChain Community.
It's incredible what a single developer can leverage existing AI libraries to create something like this in a short time!

Please checkout the codebase below 👇
Github Repo: https://github.com/TengHu/AutoCoder

Thank you!


r/Langchaindev • • Sep 05 '25

From Problem Map → Global Fix Map (300+ structured fixes for RAG / embeddings / vector stores)

3 Upvotes

why this matters to langchain devs

most of us patch errors after they appear in retrieval chains:

  • embeddings mismatch → wrong neighbors

  • chunk drift → “citation exists but never retrieved”

  • faiss / qdrant / redis quirks

  • role/tool orchestration deadlocks

  • long-context retrieval collapse

the global fix map routes these to structured, reproducible fixes. instead of patch jungles, you get a semantic firewall before generation:

  • unstable state? loop/reset before output.

  • once mapped, the bug stays sealed.

highlights

  • RAG + Vector DBs: faiss / pgvector / weaviate / chroma / redis guardrails

  • Embeddings: metric mismatch, normalization, dimension projection, hybrid retrievers

  • Chunking: contract discipline, ids, reindexing policies

  • Parsing / OCR: text integrity before embedding, locale/casing stability

  • Reasoning & Memory: logic collapse recovery, long-context drift, recursion traps

  • Ops: rollbacks, backpressure, deployment deadlocks

each section is vendor-neutral; fixes are tested against multiple stacks (LangChain, LlamaIndex, custom pipelines).

before vs after

  • before: firefighting, regex patches, fragile eval scripts, stability ceiling ~70–85%.

  • after: fix-once-stays-fixed, acceptance targets (ΔS ≤ 0.45, coverage ≥ 0.70, λ convergent across paraphrases). stability >90–95%, debug time cut 60–80%.

how to use

  1. locate your failure mode (symptom → map number).

  2. open the matching page (rag, embeddings, retrieval, etc).

  3. apply the minimal repair.

  4. verify acceptance targets.

  5. gate merges with provided ci/cd templates.

summary: the global fix map is a bug-routing index for llm infra. if you’re tired of whack-a-mole patches in langchain pipelines, this is the upgrade.

👉 full map here: [global fix map readme]
https://github.com/onestardao/WFGY/blob/main/ProblemMap/GlobalFixMap/README.md


r/Langchaindev • • May 28 '25

RAG Application with Large Documents: Best Practices for Splitting and Retrieval

3 Upvotes

Hey Reddit community, I'm working on a RAG application using Neon Database (PG Vector and Postgres-based) and OpenAI's text-embedding-ada-002 model with GPT-4o mini for completion. I'm facing challenges with document splitting and retrieval. Specifically, I have documents with 20,000 tokens, which I'm splitting into 2,000-token chunks, resulting in 10 chunks per document. When a user's query requires information beyond 5 chunk which is my K value, I'm unsure how to dynamically adjust the K-value for optimal retrieval. For example, if the answer spans multiple chunks, a higher K-value might be necessary, but if the answer is within two chunks, a K-value of 10 could lead to less accurate results. Any advice on best practices for document splitting, storage, and retrieval in this scenario would be greatly appreciated!


r/Langchaindev • • Feb 11 '25

I built a Streamlit app with a local RAG-Chatbot powered by DeepSeek's R1 model. It's using LMStudio, LangChain, and the open-source vector database FAISS to chat with Markdown files.

Thumbnail
youtu.be
3 Upvotes

r/Langchaindev • • Sep 06 '24

Langrunner Simplifies Remote Execution in Generative AI Workflows

3 Upvotes

When using Langchain and LlamaIndex to develop Generative AI applications, dealing with compute-intensive tasks (like fine-tuning with GPUs) can be a hassle. To solve this, we created the Langrunner tool which offers an inline API that lets you execute specific blocks of code remotely without wrapping the entire codebase. It integrates directly into your existing workflow, scheduling tasks on clusters optimized with the necessary resources (AWS, GCP, Azure, or Kubernetes) and pulling results back into your local environment.

No more manual containerization or artifact transfers—just streamlined development from within your notebook!

Check it out here: https://github.com/dkubeai/langrunner


r/Langchaindev • • Aug 29 '24

Need Help with Developing a Conversational Q&A Chatbot for Tabular and Textual Data

3 Upvotes

Hi everyone,

I’m working on developing a conversational Q&A chatbot, and most of my data comes from webpages. The catch is that around 80% of the data is in tabular format, while the remaining 20% is textual. I’m struggling to figure out the best approach to handle this mix.

From my understanding, Retrieval-Augmented Generation (RAG) usually has difficulties with tabular data, and I’m unsure how to prepare this type of data for efficient retrieval without losing context. Specifically, I’m curious about what techniques might work best for this scenario. Would using something like Agentic RAG be a good option?

If anyone has experience with this or could offer some guidance on how to tackle the problem, I’d really appreciate it!

Thanks in advance!


r/Langchaindev • • Jul 31 '24

I'm building a RAG as a Service

3 Upvotes

Hey everyone,

I'm excited to share that I'm building a RAG (Retrieval-Augmented Generation) as a service to help you create AI LLM tools such as:
👉🏽 AI Search Engine
👉🏽 AI Knowledge Base
👉🏽 AI Chatbot
👉🏽 Chat with PDF, page url, text file, ...

And the best part? You can do all this without using any Python libraries or vector databases!

Interested? Join the waitlist to get free access: ragcy.com

Looking forward to your thoughts and feedback!


r/Langchaindev • • Jul 22 '24

GraphRAG for JSON data

3 Upvotes

This tutorial explains how to use GraphRAG using JSON file and LangChain. This involves

  1. Converting json to text

  2. Create Knowledge Graph

  3. Create GraphQA chain

https://youtu.be/wXTs3cmZuJA?si=dnwTo6BHbK8WgGEF


r/Langchaindev • • May 29 '24

Attempting to Parse PDF's with Financial Data (Balance Sheets, P&Ls, 10Ks)

Thumbnail self.langchain
3 Upvotes

r/Langchaindev • • Feb 02 '24

Manager Wants to switch from LangChain to Copilot Studio for a Client Product - Thoughts?

3 Upvotes

Hey everyone!

I'm having a bit of trouble and could really use your wisdom. My company is eager to add AI to their products and daily operations.

We have this internal initiative where people from various departments come together to innovate or improve something, to add more value to the organization. My group has the task to develop an AI Chatbot, to assume some of the functions typically performed by an analyst, in a specific type of service, where it interacts with the customer, collects information for a specific process and uses this information to parameterize the company's system, for that specific customer.

Here's the problem: we have about 160 person-hours per month, split between three of us, over the next three months, to go from having zero expertise in creating AI-powered apps to delivering a functional AI-powered chatbot MVP.

It is clear that they do not know what they are doing about this matter. They gave us ChatGPT licenses after we requested OpenAI API credits. So they asked us to create a detailed AI spending plan, so they can evaluate (and yes, we are a technology company with over 1k employees).

Now they want us to move our development efforts to Copilot Studio, abandoning our current development with Python and Langchain. From what I gather, this may not be the wisest course of action, especially considering the intricate context management our project requires (different rules for answers, complex questions) and the potential lock-in with the Microsoft ecosystem (also, for what I could check, the client needs to pay for copilot studio as well). They don't even have paid Copilot Studio yet (don't know if they will ever do).

The challenge is that we don't really know much about AI development (we're trying to study it in the meantime), so it's hard to argue with them.

Can anyone here help us understand if it's true that Copilot Studio could be a better solution? Yes? No?

I would deeply appreciate any information or advice you could share so I can craft a well-informed response.

Thank you very much in advance for your contribution and time!


r/Langchaindev • • Jan 22 '24

Mistral 7B from Mistral.AI - FULL WHITEPAPER OVERVIEW

Thumbnail
youtu.be
3 Upvotes

r/Langchaindev • • Nov 21 '23

ActionWeaver, AI application framework that put function-calling as first-class feature !!

3 Upvotes

ActionWeaver, AI application framework that put function-calling as first-class feature, has just launched a new version! Supporting both OpenAI API and Azure OpenAI service!

https://github.com/TengHu/ActionWeaver


r/Langchaindev • • Oct 03 '23

Streaming Question HOW TO - streaming a subsequent chain while the parent chain is still streaming outputs.

3 Upvotes

Here is the feature I am trying to implement. True streaming chains

I have a 2 phase llmchain - [Input -> C1 -> C2 -> output]

Assume the output is 1000 tokens, and each token takes 1 second to generate and 0,1 second wait per input token. We are using this in streaming mode. Assume C1 = generate blog (so 1 line 10 tokens -> 1000 tokens) Assume C2 = translate ( so 1000 tokens -> 1000 tokens)

In the current setup, the time to first token would be 1101 seconds, 1 second input wait -> 1000 seconds for C1 -> then 100 seconds wait before C2 starts streaming -> C2 starts streaming out.

What I want to do is. 1 second input wait -> C1 starts streaming -> outputs first 100 tokens in 100 seconds C2 -> waits till first 100 tokens are generated (10 seconds) -> collects 100 tokens -> translates 100 tokens in 100 seconds -> starts streaming. Time to first token = 1 + 100 + 10 + 100 = 221 seconds.

This way I can speed up time to first token by a lot in a chain setting. This only works for cases where the subseuquent chain can operate over a chunk at a time, which is a very common post-processing scenario.

Is there an easy way to implement this ?

Thanks.