Introduction
Meshagent CLI
Agents
Documents
Webhooks
Flutter SDK
Examples
Website RAG
If you want to create a website-rag service that will run in every room:
Copy
Ask AI
meshagent service create --name "website-rag" --image docker.io/meshagent/sample-website-rag:0.0.31 --env="MESHAGENT_PORT=8090" --port "num=8090 type=meshagent.callable liveness=/ path=/agent participant_name=website-rag"
If you want to test the website-rag with a single room:
Copy
Ask AI
meshagent service test --room my-room --name "website-rag" --image docker.io/meshagent/sample-website-rag:0.0.31 --env="MESHAGENT_PORT=8090" --port "num=8090 type=meshagent.callable liveness=/ path=/agent participant_name=website-rag"
Here is the website-rag service code if you want to create your own app:
Copy
Ask AI
from meshagent.api import RequiredToolkit, RequiredSchema
from meshagent.agents.schemas.document import document_schema
from meshagent.tools.document_tools import DocumentAuthoringToolkit, DocumentTypeAuthoringToolkit
from meshagent.agents.chat import ChatBot
from meshagent.openai import OpenAIResponsesAdapter
from meshagent.agents.indexer import RagToolkit, SiteIndexer
from meshagent.api.services import ServiceHost
import asyncio
import os
service = ServiceHost()
@service.path("/agent")
class RagChatBot(ChatBot):
def __init__(self):
super().__init__(
name="meshagent.chatbot.website_rag",
title="Website RAG chatbot",
description="an simple chatbot that does rag, pair with an indexer",
llm_adapter = OpenAIResponsesAdapter(
model="gpt-4o-mini",
parallel_tool_calls=None
),
rules=[
"after performing a rag search, do not include citations",
"output document names MUST have the extension .document, automatically add the extension if it is not provided",
"after opening a document, display it, before writing to it"
],
requires=[
RequiredSchema(
name="document"
),
RequiredToolkit(
name="ui",
tools=[
"ask_user",
"display_document",
"show_toast"
]
),
RequiredToolkit(
name="meshagent.markitdown",
tools=[ "markitdown_from_file" ]
)
],
toolkits=[
DocumentAuthoringToolkit(),
DocumentTypeAuthoringToolkit(
schema=document_schema,
document_type="document"
),
RagToolkit(table="index"),
],
labels=[ "chatbot", "rag" ]
)
@service.path("/indexer")
class SampleSiteIndexer(SiteIndexer):
def __init__(self):
super().__init__(
name="meshagent.site_indexer",
title="site indexer",
description="indexes a site using firecrawl, pair with a RAG chatbot",
labels=["tasks", "rag" ])
asyncio.run(service.run())
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.