Hello. I’m new to this agents part and I am having some issues with the import agent and as far as I could find on internet its a problem that it will only apears on vscode?
the problem that I’’m having is this:
ImportError: cannot import name ‘Agent’ from ‘agno’
the code is such as bellow. I am trying to do an agent that will do rag on a file.
Its an tryout to see what it can do and mostly important what I can do.
another thing. Where can I report a link that is not working on the documentation? I have found an 404 and didnt knew where to report it.
from agno import Agent
from agno.db.sqlite import SqLiteStorage
from agno.models.openai import OpenAIChat
from agno.os import AgentOS
from agno.knowledge.reader.pdf_reader import PDFKnowledgeBase, PDFReader
from agno.vectordb.chroma import ChromaDb
db = SqLiteStorage(table_name="agent_session", db_file="tmp/agent.db")
vector_db = ChromaDb(collection="pdf_agent", path ="tmp/chromadb") # collection é o nome da tabela do banco de dados neste ChromaDb.
knowledge= PDFKnowledgeBase(
path= "pdf/GlobalEVOutlook2025.pdf",
vector_db = vector_db,
reader= PDFReader(chunk=True),
)
knowledge.load()
assistant = Agent(
name="Assistant_PDF",
model=OpenAIChat(id="gpt-4.1-mini"),
description = "You are an engineer that is glad to help.",
instructions=["You are an engineer with knowledge on the diferent types of energy used to run cars. "],
knowledge= knowledge,
markdown=True,
)
agent_os = AgentOS(
os_id="Agente_pdf_Asimov",
description="My first AgentOS",
agents=[assistant],
)
app = agent_os.get_app()
if __name__ == "__main__":
# Default port is 7777; change with port=...
agent_os.serve(app="2_1_pdf_agent:app", reload=True)
Hi @egnoM, thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.If it’s urgent, please let us know. We appreciate your patience!
yeah, it created other problems and I decided to do it from scratch, and then I got into other ones..haha
I copied the code on Create Your First AgentOS - Agno
and still got an error of “ERROR: Error loading ASGI app. Could not import module “my_os”.”
the agent starte on the vscode and then it runs stratight into that error.
╔═══════════════ AgentOS ════════════════╗
║ ║
║ ║
║ https://os.agno.com/ ║
║ ║
║ ║
║ OS running on: http://localhost:7777 ║
║ ║
║ ║
╚════════════════════════════════════════╝
INFO: Will watch for changes in these directories: ['D:\\trabalho\\programacao\\4_ASimov\\Aulas\\03_Agno_agente_ia\\01']
INFO: Uvicorn running on http://localhost:7777 (Press CTRL+C to quit)
INFO: Started reloader process [32980] using WatchFiles
ERROR: Error loading ASGI app. Could not import module "my_os".
Trying to find out what it is and how to deal with it next. as i said, still new to it.
Hi @egnoM You probably have not named your file as my_os.py that is the Python FastAPI convention, the app name has to be same as file name. Hope it helps, thanks!