Shubham Saboo Profile picture
May 4, 2024 11 tweets 4 min read Read on X
Build a LLM app with RAG to chat with any AI newsletter on Substack in just 30 lines of Python Code (step-by-step instructions):
1. Import necessary libraries

• Streamlit for building the web app
• Embedchain for the RAG functionality
• tempfile for creating temporary files and directories Image
2. Configure the Embedchain App

For this application we will use GPT-4 Turbo, you can choose from cohere, anthropic or any other LLM of your choice.

Select the vector database as the opensource chroma db (you are free to choose any other vector database of your choice) Image
3. Set up the Streamlit App

Streamlit lets you create user interface with just python code, for this app we will:

• Add a title to the app using 'st.title()'
• Create a text input box for the user to enter their OpenAI API key using 'st.text_input()' Image
4. Initialize the Embedchain App

• If the OpenAI API key is provided, create a temporary directory for the vector database using 'tempfile.mkdtemp()'
• Initialize the Embedchain app using the 'embedchain_bot' function Image
5. Get the Substack Newsletter URL from the user and add it to the knowledge base

• Use 'st.text_input()' to get the substack URL from the user
• Given the video URL, add it to the embedchain application Image
6. Ask question about the AI newsletter and display the answer

• Create a text input for the user to enter their question using 'st.text_input()'
• If a question is asked, get the answer from the Embedchain app and display it using 'st.write()' Image
Full RAG Application Code to Chat with Substack Newsletter👇 Image
Working Application demo using Streamlit

Paste the above code in vscode and run the following command: 'streamlit run chat_substack.py' Image
If you’re interested in:
- ML/NLP
- LLMs
- RAG

Connect with me → @Saboo_Shubham_
My Newsletter →

Everyday, I share tip & tutorials on above topics on X and my newsletter. unwindai.substack.com
Image
Find all the awesome LLM Apps demo with RAG in the following Github Repo.

P.S: Don't forget to star the repo to show your support 🌟
github.com/Shubhamsaboo/a…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Shubham Saboo

Shubham Saboo Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Saboo_Shubham_

Jul 5
Build an AI Agent with Structured Output using Google ADK (step-by-step instructions):
What Are Structured Outputs?

Think of structured outputs as a strict dress code for your AI agent's responses.

Instead of getting random, unpredictable text, you get perfectly formatted JSON every single time.

Let's build our AI Agent with structured output 👇 Image
1. Install the necessary Python Libraries

Run the following commands to install the required libraries: Image
Read 8 tweets
Jun 21
This Chinese AI model just changed document OCR forever.

It can parse complex documents with text, tables, formulas and figures in parallel simultaneously using task-specific prompts.

100% opensource.
Dolphin uses a smart two-stage parsing approach.

Stage 1: Analyzes page layout and generates element sequence in natural reading order.

Stage 2: Parses all document elements simultaneously using task-specific prompts. Image
You can try Dolphin's document parsing capabilities right now with live demo on GitHub.

GitHub Repo: github.com/bytedance/Dolp…
Read 4 tweets
Jun 10
This is crazy!

Meet the world's first fully Agentic Download Agent and AI Drive.

It can literally search, download, and organize any files instantly in the AI drive from just a single prompt.

Works with PDFs, images, videos, music, and Office documents.

3 wild examples:
1. Batch Download Images Instantly:

The Download Agent searches trusted platforms like Pixabay and Unsplash, gathers your images, and places them in a dedicated folder in your AI Drive.

One prompt does it all—no more tedious clicking or sorting.
2. Effortless PDF Collection for Research:

The Download Agent reads the post, locates every paper, downloads them, and organizes everything into a neatly named folder.

Files are even renamed to match their titles, making future reference effortless.
Read 5 tweets
Jun 7
Build an Agentic RAG systems that can Reason using Claude 4 and OpenAI Embedder (step-by-step instructions):
1. Install the necessary Python Libraries

Run the following commands from your terminal to install the required libraries: Image
2. Import necessary libraries

• @AgnoAgi framework provides the agent infrastructure
• @streamlit creates the web interface
• Environment variables for secure API key management Image
Read 14 tweets
Jun 5
OpenAI Operator costs $200 per month.

But this AI web agent literally blew my mind. I have been testing it for a while and it has automated hours of boring work for me.

5 amazing use cases:

1. Get top 10 AI stories on Hacker News in the last 24 hours and add it to my Google Doc.
2. Find top job openings in Austin that match my resume and create a Google Sheet with Company, Title, and Salary columns.
3. Look for the best Indian fine-dine restaurant in South Austin, book a table for 2, and add it to my Google Calendar.
Read 6 tweets
May 28
I vibe coded Instagram clone with this AI Agent using Claude 4 in less than 5 minutes.

Ship full-stack apps using Claude 4 without writing a single line of code.

Let that sink in.
Emergent is an agentic coding platform to build web apps, games, SaaS, Chrome extensions, and everything else.

It doesn't just generate code snippets, it builds entire systems with databases, APIs, authentication, and infrastructure, all with just simple prompts.
Here's another one:

I connected it with my GitHub repo Awesome LLM Apps and asked it to create a nice landing page for my Legal AI Agent Team app.
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(