File size: 491 Bytes
fe5c39d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Agent with RAG search."""

import asyncio

from examples.rag.rag_pipeline import DOC_PATH, QUESTION
from metagpt.logs import logger
from metagpt.rag.engines import SimpleEngine
from metagpt.roles import Sales


async def search():
    """Agent with RAG search."""

    store = SimpleEngine.from_docs(input_files=[DOC_PATH])
    role = Sales(profile="Sales", store=store)
    result = await role.run(QUESTION)
    logger.info(result)


if __name__ == "__main__":
    asyncio.run(search())