how we can build a chat bot for our asp.net core public web site?

john john Pter 1,345 Reputation points
2025-11-02T15:39:10.6333333+00:00

We have a .net core MVC 8.0 web application where our data is either stored on the MVC views as html pages or inside PDF files inside file system and other PDF inside SQL database. so can we build copilot agents which interact with our data? i have developed agents using copilot studio mainly interacting with sharepoint internally, but seems it is not feasible to open it to public because their requests inside the chat bot will consume credits, so my question if we can build such a agent (it does not have to be very complex/advance just a simple one ) using .net core MVC, that can interact with the PDF files inside our file system and sql + inside html pages ?

Thanks

Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 81,976 Reputation points Volunteer Moderator
    2025-11-02T16:54:04.2666667+00:00

    You need to expose your data, typically via RAG files to the AI chat engine. This will be the main part of the project. The MVC chat view will just send the prompt to the AI api (pretty simple call) and display the results.

    If you use azure AI service, you can expose your data as markdown documents in azure blobs. If you use a local ai engine, you will need to create the RAG files.

    the sql data can be exposed as RAG files or you can expose it as an external service.

    1 person found this answer helpful.
    0 comments No comments

  2. Varsha Dundigalla(INFOSYS LIMITED) 3,810 Reputation points Microsoft External Staff
    2025-11-03T12:42:00.66+00:00

    Thank you for reaching out.

    1. Use a Retrieval-Augmented Generation (RAG) Approach

    • Combine a search engine for your content with an LLM for natural language answers.
    • This works well for PDFs, HTML pages, and SQL data.

    2. Index Your Content

    • Gather PDFs from file system and SQL, plus rendered HTML pages.
    • Use Azure AI Search for indexing and semantic/vector search.
    • Add OCR via Document Intelligence for scanned PDFs.

    3. Connect to an LLM

    • Use Azure OpenAI On Your Data so responses are grounded in your indexed content.
    • This avoids generic answers and keeps control over data.

    4. Integrate with Your MVC App

    • Build a simple chat interface that calls Azure OpenAI’s Responses API with your search index as the data source.
    • Keep calls server-side for security and cost control.

    5. Manage Costs

    • Unlike Copilot Studio, this approach uses your Azure subscription.
    • Apply rate limits, caching, and optional sign-in for heavy users.

    6. Security and Compliance

    • Store keys in Azure Key Vault and use managed identities.
    • Add content filtering and logging for responsible AI.

    7. Start Simple

    • Begin with FAQs and document search.
    • Expand later to include agents or workflows using Azure AI Foundry Agent Service.

    References for next steps:

    Please let us know if you require any further assistance, we’re happy to help.

    If you found this information useful, kindly mark this as "Accept Answer".


  3. can kucukgultekin 330 Reputation points
    2025-11-17T17:51:34.0866667+00:00

    Yes you can definitely build this, but one reality upfront: whichever LLM service you use, token consumption is unavoidable. Moving away from Copilot Studio just shifts the cost to your own subscription, you gain architectural control but not free compute.

    Technically you implement standard RAG flow, crawl your HTML pages and strip markup, extract text from filesystem and SQL PDFs using server-side library, chunk everything and push to a search layer. That search can be full-text like Azure Cognitive Search or embedding-based vector search. When user asks a question your MVC endpoint queries search for relevant chunks, sends them as context to LLM with a prompt like "answer only using this, say you don't know if not there", then shows the model response in chat bubble.

    If your main concern is cost, you have two directions. One is to still use an LLM but wrap it in tight limits: per-user daily message caps, IP-based rate limiting, caching for repeated questions, etc., so token usage stays under control. The other is to skip AI entirely: just do full-text search over your HTML/PDF content, show the best matches, maybe format the text in a “bot-like” way, but don’t call any model at all, so there are no credits being burned.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.