Building Talk-to-Page: Chat or Talk with Any Website
K Om Senapati

K Om Senapati @k0msenapati

About: Hi, I'm K Om Senapati, a 2nd-year B.Tech CSE student at OUTR, Bhubaneswar, and a Python developer passionate about hackathons, teamwork, and exploring new technologies.

Location:
Bhubaneswar, India
Joined:
Sep 5, 2023

Building Talk-to-Page: Chat or Talk with Any Website

Publish Date: Jan 6
102 18

Ever thought of chatting with a webpage or literally talking to it? Well, I built an app that does just that! It’s called Talk-to-Page. You simply input a URL, and you can start a conversation with the page.

Here’s a quick demo of how it works:


Why Did I Build This?

Chatbots are cool, but they’re not perfect. Most don’t understand the specific details of a web page. If you build a chatbot with Retrieval Augmented Generation (RAG), it often feels limited. You set it up for one page, and it’s stuck with that static content.

So, I thought: Why not make it dynamic?

What if you could give the chatbot any URL and let it adapt on the go?

That’s how Talk-to-Page was born!


How It Came Together

I used my coagents-starter kit as the foundation. It’s a setup I built for creating full-stack apps with AI agents using LangGraph and CopilotKit.

Here’s the starter kit, in case you want to check it out:

GitHub logo k0msenapati / coagents-starter

🤖 Starter kit for building agentic full-stack apps

CoAgents Starter

This example contains a simple starter project.

These instructions assume you are in the coagents-starter/ directory

Running the Agent

First, install the dependencies:

cd agent
poetry install
Enter fullscreen mode Exit fullscreen mode

Then, create a .env file inside ./agent with the following:

GROQ_API_KEY=...

Then, run the demo:

poetry run demo
Enter fullscreen mode Exit fullscreen mode

Running the UI

First, install the dependencies:

cd ./ui
pnpm i
Enter fullscreen mode Exit fullscreen mode

Then, create a .env file inside ./ui with the following:

GROQ_API_KEY=...

Then, run the Next.js project:

pnpm run dev
Enter fullscreen mode Exit fullscreen mode

Usage

Navigate to http://localhost:3000.

LangGraph Studio

Run LangGraph studio, then load the ./agent folder into it.

Make sure to create teh .env mentioned above first!

Troubleshooting

A few things to try if you are running into trouble:

  1. Make sure there is no other local application server running on the 8000 port.
  2. Under /agent/my_agent/demo.py, change 0.0.0.0 to 127.0.0.1 or to localhost



The backend uses FastAPI for deploying the LangGraph agent, while the frontend is built with Next.js.


Building the Agent

The first step was to create the agent. I followed a modular approach, breaking it into smaller parts like state, nodes, and edges. You can see the folder structure here:

Agent Code

I renamed my_agent to rag_agent. This meant updating the name everywhere—folders, files (like demo.py), and config (like langgraph.json and pyproject.toml).

Url Updating stuff:

  • Node: I added a new node called update_url that updates the agent’s retriever whenever the URL changes.
  • Edge: Created an edge called new_url that listens for a "URL UPDATED" message and triggers the update_url node to update the retriever.

Except that it's a self-RAG agent. You can check out its tutorial and code here.

Here’s what the final agent graph looks like:

graph-img


Building the UI

The UI was fairly straightforward, but I wanted to make it interesting. Instead of using CopilotKit’s built-in copilot, I built a custom chat-bot interface.

You can find the code here:

Custom Chat Interface

For backgrounds, I added a retro grid background using Magic UI’s Retro Grid. I also implemented a Matrix Rain background using v0.dev which remained active for 5s when the URL was updated.

Voice Interaction:

For a better experience than that of a normal chatbot, I added the following:

  • Speech-to-text for user input.
  • Text-to-speech for AI responses.

So now, you can literally talk to a webpage. Cool, right? 😉


Getting It All Working

The starter kit comes pre-configured with Tailwind CSS, Shadcn, and CopilotKit. For the agent to work, I just updated the agent name in ui/app/layout.tsx.


My Experience

Building this app was a fun and rewarding experience. Learning LangGraph and LangChain took some time, but the CopilotKit integration was surprisingly smooth.

Big thanks to the CopilotKit documentation for making things easy to follow!


That’s how I built Talk-to-Page!

What do you think about this project? Would you build something similar? Let me know!

Have a great day! Till next time!

If you loved this, please star CopilotKit and talk-to-page :)

Star CopilotKit ⭐

Star talk-to-page 🤝

Follow me for more content like this!

Comments 18 total

  • Rohan Sharma
    Rohan SharmaJan 6, 2025

    Nice project!!

    Starred! ⭐

  • Akash Jana
    Akash JanaJan 6, 2025

    Amazing idea with on point execution! Keep it up ✨

  • Md Abid Hussain
    Md Abid HussainJan 6, 2025

    Amazing project 🔥🔥

  • Anmol Baranwal
    Anmol BaranwalJan 6, 2025

    Great work man! Loved the banner 🔥 You should include the demo video link in the readme as well.

  • Ayush Kumar Patro
    Ayush Kumar PatroJan 6, 2025

    Amazing article bro!

  • Pheonix Coder 🐦‍🔥
    Pheonix Coder 🐦‍🔥Jan 6, 2025

    Great idea.

    I have also built a project using coagents - github.com/pheonix-coder/cogni-flow

    • Prasant
      PrasantJan 6, 2025

      Your project is cool aswell

  • Prasant
    PrasantJan 6, 2025

    I liked your project.

    Currently dont have any ideas for creating coagents project

  • KidfromKonoha
    KidfromKonohaJan 6, 2025

    Great work 💯

  • Nathan Tarbert
    Nathan TarbertJan 6, 2025

    Nice project!

  • uliyahoo
    uliyahooJan 10, 2025

    Was really happy to see this get featured by Dev.to on their twitter page. Really well done tutorial!

  • Ayush Jhawar
    Ayush JhawarJan 10, 2025

    Great Work 🙌🏻

  • Jyoti Ranjan Jena
    Jyoti Ranjan JenaJan 12, 2025

    Nice project
    Liked the banner

  • KrishavRajSingh
    KrishavRajSinghFeb 22, 2025

    Can i use it for any website, it it okay legally to take data from any website??

    I really wanted to work on something like this but I heard that it is illegal to take data from any website without their consent.

    • K Om Senapati
      K Om Senapati Feb 23, 2025

      Technically, WebBaseLoader allows you to fetch and process web pages, but whether you're allowed to do so legally depends on the website’s policies and laws in your jurisdiction.

      Legality depends on various factors like ToS (Terms of Service), Robots.txt file, other laws for the particular website.

Add comment