Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Monitoring not working #2021

Open
zachwills opened this issue Feb 5, 2025 · 2 comments
Open

[Bug] Monitoring not working #2021

zachwills opened this issue Feb 5, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@zachwills
Copy link

zachwills commented Feb 5, 2025

Description

Agno monitoring doesn't work. Also, no explanation of how to set the API key in the docs (looking at code appears you can set an ENV variable)

Steps to Reproduce

Run the following code (pretty much verbatim from an example).

Agent Configuration (if applicable)

from dotenv import load_dotenv
import os

# Load environment variables from .env file
load_dotenv()


from datetime import datetime
from pathlib import Path
from textwrap import dedent

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.newspaper4k import Newspaper4kTools


def run_agent():
    # Initialize the research agent with advanced journalistic capabilities
    research_agent = Agent(
        model=OpenAIChat(id="gpt-4o"),
        tools=[DuckDuckGoTools(), Newspaper4kTools()],
        description=dedent(
            """\
            You are an elite investigative journalist with decades of experience at the New York Times.
            Your expertise encompasses: 📰

            - Deep investigative research and analysis
            - Meticulous fact-checking and source verification
            - Compelling narrative construction
            - Data-driven reporting and visualization
            - Expert interview synthesis
            - Trend analysis and future predictions
            - Complex topic simplification
            - Ethical journalism practices
            - Balanced perspective presentation
            - Global context integration\
        """
        ),
        instructions=dedent(
            """\
            1. Research Phase 🔍
            - Search for 10+ authoritative sources on the topic
            - Prioritize recent publications and expert opinions
            - Identify key stakeholders and perspectives

            2. Analysis Phase 📊
            - Extract and verify critical information
            - Cross-reference facts across multiple sources
            - Identify emerging patterns and trends
            - Evaluate conflicting viewpoints

            3. Writing Phase ✍️
            - Craft an attention-grabbing headline
            - Structure content in NYT style
            - Include relevant quotes and statistics
            - Maintain objectivity and balance
            - Explain complex concepts clearly

            4. Quality Control ✓
            - Verify all facts and attributions
            - Ensure narrative flow and readability
            - Add context where necessary
            - Include future implications
        """
        ),
        expected_output=dedent(
            """\
            # {Compelling Headline} 📰

            ## Executive Summary
            {Concise overview of key findings and significance}

            ## Background & Context
            {Historical context and importance}
            {Current landscape overview}

            ## Key Findings
            {Main discoveries and analysis}
            {Expert insights and quotes}
            {Statistical evidence}

            ## Impact Analysis
            {Current implications}
            {Stakeholder perspectives}
            {Industry/societal effects}

            ## Future Outlook
            {Emerging trends}
            {Expert predictions}
            {Potential challenges and opportunities}

            ## Expert Insights
            {Notable quotes and analysis from industry leaders}
            {Contrasting viewpoints}

            ## Sources & Methodology
            {List of primary sources with key contributions}
            {Research methodology overview}

            ---
            Research conducted by AI Investigative Journalist
            New York Times Style Report
            Published: {current_date}
            Last Updated: {current_time}\
        """
        ),
        markdown=True,
        monitoring=True,
        show_tool_calls=True,
        add_datetime_to_instructions=True,
    )

    research_agent.print_response(
        "Analyze the top Agent frameworks and tools for creating AI applications",
        stream=True,
    )


# Example usage with detailed research request
if __name__ == "__main__":
    run_agent()
"""

Expected Behavior

Monitoring to show up in Agno

Actual Behavior

Nothing in Agno.

Screenshots or Logs (if applicable)

Include any relevant screenshots or error logs that demonstrate the issue.

Additional Context

Also no easy way to hook up other monitoring like Langfuse.

@zachwills zachwills added the bug Something isn't working label Feb 5, 2025
@ysolanky
Copy link
Contributor

ysolanky commented Feb 5, 2025

Hello @zachwills !

From your terminal either run the command agno setup or export AGNO_API_KEY=***. Now, when you run your Agent, the session should get logged on app.agno.com

Apologies, this step was missing from the docs and I will update it. Thank you for raising this issue.

@dahal4
Copy link

dahal4 commented Feb 6, 2025

hi @ysolanky , i have also faced the same issue , and tried your approach too . But its not helping . there is no any visible error to show . everything works fine except the monitoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants