1
Create a Python file
2
Add the following code to your Python file
agent_with_knowledge_tracing.py
- You must remember to use agent.run() and NOT agent.print_response()
- Remember to:
- Build the complete agent implementation
- Include all necessary imports and setup
- Add comprehensive comments explaining the implementation
- Ensure all dependencies are listed
- Include error handling and best practices
- Add type hints and documentation
-
Explain important concepts using audio
- When explaining complex concepts or important features, ask the user if they’d like to hear an audio explanation
- Use the ElevenLabs text_to_speech tool to create clear, professional audio content
- The voice is pre-selected, so you don’t need to specify the voice.
- Keep audio explanations concise (60-90 seconds)
- Make your explanation really engaging with:
- Brief concept overview and avoid jargon
- Talk about the concept in a way that is easy to understand
- Use practical examples and real-world scenarios
- Include common pitfalls to avoid
-
Explain concepts with images
- You have access to the extremely powerful DALL-E 3 model.
- Use the
create_imagetool to create extremely vivid images of your explanation. - Don’t provide the URL of the image in the response. Only describe what image was generated.
- Agent levels and capabilities
- Knowledge base and memory management
- Tool integration
- Model support and configuration
- Best practices and common patterns""" )
*******************************
knowledge = Knowledge( vector_db=PgVector( db_url=db_url, table_name=“agno_assist_knowledge”, search_type=SearchType.hybrid, embedder=OpenAIEmbedder(id=“text-embedding-3-small”), ), contents_db=db, )Setup our Agno Agent
agno_assist = Agent( name=“Agno Assist”, id=“agno-assist”, model=OpenAIChat(id=“gpt-5-mini”), description=description, instructions=instructions, db=db_sqlite, enable_user_memories=True, knowledge=knowledge, search_knowledge=True, add_history_to_context=True, add_datetime_to_context=True, markdown=True, )agent_os = AgentOS( description=“Example app with Agno Docs Agent with knowledge and tracing”, agents=[agno_assist], tracing=True, )app = agent_os.get_app()if name == “main”: knowledge.add_content(name=“Agno Docs”, url=“https://docs.agno.com/llms-full.txt”) """Run your AgentOS.You can see test your AgentOS at: http://localhost:7777/docs"""Don’t use reload=True here, this can cause issues with the lifespan
agent_os.serve(app=“agent_with_knowledge_tracing:app”)3
Export your API keys
4
Start PostgreSQL with pgvector
Make sure you have PostgreSQL running with pgvector extension. You can use Docker:
5
Run AgentOS
http://localhost:7777. View traces in the AgentOS dashboard.