Skip to content

ClasCat® AI Research

クラスキャット – 生成 AI, AI エージェント, MCP

Menu
  • ホーム
    • ClassCat® AI Research ホーム
    • クラスキャット・ホーム
  • OpenAI API
    • OpenAI Python ライブラリ 1.x : 概要
    • OpenAI ブログ
      • GPT の紹介
      • GPT ストアの紹介
      • ChatGPT Team の紹介
    • OpenAI platform 1.x
      • Get Started : イントロダクション
      • Get Started : クイックスタート (Python)
      • Get Started : クイックスタート (Node.js)
      • Get Started : モデル
      • 機能 : 埋め込み
      • 機能 : 埋め込み (ユースケース)
      • ChatGPT : アクション – イントロダクション
      • ChatGPT : アクション – Getting started
      • ChatGPT : アクション – アクション認証
    • OpenAI ヘルプ : ChatGPT
      • ChatGPTとは何ですか?
      • ChatGPT は真実を語っていますか?
      • GPT の作成
      • GPT FAQ
      • GPT vs アシスタント
      • GPT ビルダー
    • OpenAI ヘルプ : ChatGPT > メモリ
      • FAQ
    • OpenAI ヘルプ : GPT ストア
      • 貴方の GPT をフィーチャーする
    • OpenAI Python ライブラリ 0.27 : 概要
    • OpenAI platform
      • Get Started : イントロダクション
      • Get Started : クイックスタート
      • Get Started : モデル
      • ガイド : GPT モデル
      • ガイド : 画像生成 (DALL·E)
      • ガイド : GPT-3.5 Turbo 対応 微調整
      • ガイド : 微調整 1.イントロダクション
      • ガイド : 微調整 2. データセットの準備 / ケーススタディ
      • ガイド : 埋め込み
      • ガイド : 音声テキスト変換
      • ガイド : モデレーション
      • ChatGPT プラグイン : イントロダクション
    • OpenAI Cookbook
      • 概要
      • API 使用方法 : レート制限の操作
      • API 使用方法 : tiktoken でトークンを数える方法
      • GPT : ChatGPT モデルへの入力をフォーマットする方法
      • GPT : 補完をストリームする方法
      • GPT : 大規模言語モデルを扱う方法
      • 埋め込み : 埋め込みの取得
      • GPT-3 の微調整 : 分類サンプルの微調整
      • DALL-E : DALL·E で 画像を生成して編集する方法
      • DALL·E と Segment Anything で動的マスクを作成する方法
      • Whisper プロンプティング・ガイド
  • Gemini API
    • Tutorials : クイックスタート with Python (1) テキスト-to-テキスト生成
    • (2) マルチモーダル入力 / 日本語チャット
    • (3) 埋め込みの使用
    • (4) 高度なユースケース
    • クイックスタート with Node.js
    • クイックスタート with Dart or Flutter (1) 日本語動作確認
    • Gemma
      • 概要 (README)
      • Tutorials : サンプリング
      • Tutorials : KerasNLP による Getting Started
  • Keras 3
    • 新しいマルチバックエンド Keras
    • Keras 3 について
    • Getting Started : エンジニアのための Keras 入門
    • Google Colab 上のインストールと Stable Diffusion デモ
    • コンピュータビジョン – ゼロからの画像分類
    • コンピュータビジョン – 単純な MNIST convnet
    • コンピュータビジョン – EfficientNet を使用した微調整による画像分類
    • コンピュータビジョン – Vision Transformer による画像分類
    • コンピュータビジョン – 最新の MLPモデルによる画像分類
    • コンピュータビジョン – コンパクトな畳込み Transformer
    • Keras Core
      • Keras Core 0.1
        • 新しいマルチバックエンド Keras (README)
        • Keras for TensorFlow, JAX, & PyTorch
        • 開発者ガイド : Getting started with Keras Core
        • 開発者ガイド : 関数型 API
        • 開発者ガイド : シーケンシャル・モデル
        • 開発者ガイド : サブクラス化で新しい層とモデルを作成する
        • 開発者ガイド : 独自のコールバックを書く
      • Keras Core 0.1.1 & 0.1.2 : リリースノート
      • 開発者ガイド
      • Code examples
      • Keras Stable Diffusion
        • 概要
        • 基本的な使い方 (テキスト-to-画像 / 画像-to-画像変換)
        • 混合精度のパフォーマンス
        • インペインティングの簡易アプリケーション
        • (参考) KerasCV – Stable Diffusion を使用した高性能画像生成
  • TensorFlow
    • TF 2 : 初級チュートリアル
    • TF 2 : 上級チュートリアル
    • TF 2 : ガイド
    • TF 1 : チュートリアル
    • TF 1 : ガイド
  • その他
    • 🦜️🔗 LangChain ドキュメント / ユースケース
    • Stable Diffusion WebUI
      • Google Colab で Stable Diffusion WebUI 入門
      • HuggingFace モデル / VAE の導入
      • LoRA の利用
    • Diffusion Models / 拡散モデル
  • クラスキャット
    • 会社案内
    • お問合せ
    • Facebook
    • ClassCat® Blog
Menu

Agno : イントロダクション : エージェントとは ? / Colab 実行例

Posted on 07/12/2025 by Masashi Okumura

エージェントは自律的に動作する AI プログラムです。従来のソフトウェアは事前にプログラムされた一連のステップに従いますが、エージェントは機械学習モデルを使用して行動方針を動的に決定します。
Agno は人気急上昇中のマルチエージェント・システムを構築するためのフルスタック・フレームワークです。

Agno : ユーザガイド : イントロダクション : エージェントとは ? / Colab 実行例

作成 : クラスキャット・セールスインフォメーション
作成日時 : 07/12/2025
バージョン : Agno 1.7.1

* 本記事は docs.agno.com の以下のページを独自に翻訳した上で、Google Colab 上での動作確認を加えてまとめ直しています :

  • User Guide : Introduction : What are Agents?

* サンプルコードの動作確認はしておりますが、必要な場合には適宜、追加改変しています。
* ご自由にリンクを張って頂いてかまいませんが、sales-info@classcat.com までご一報いただけると嬉しいです。

 

クラスキャット 人工知能 研究開発支援サービス ⭐️ リニューアルしました 😉

◆ クラスキャット は人工知能に関する各種サービスを提供しています。お気軽にご相談ください :

  • 人工知能導入個別相談会(無償)実施中! [詳細]

  • 人工知能研究開発支援 [詳細]
    1. 自社特有情報を含むチャットボット構築支援
    2. 画像認識 (医療系含む) / 画像生成

  • PoC(概念実証)を失敗させないための支援 [詳細]

◆ お問合せ : 下記までお願いします。

  • クラスキャット セールス・インフォメーション
  • sales-info@classcat.com
  • ClassCatJP

 

 

ユーザガイド : イントロダクション : エージェントとは ? / Colab 実行例

エージェントは自律的に動作する AI プログラムです。

従来のソフトウェアは事前にプログラムされた一連のステップに従います。エージェントは機械学習モデルを使用して行動方針を動的に決定します、そのコア・コンポーネントは :

  • モデル : 実行フローを制御します。推論、行動、応答かのいずれかを決定します。

  • ツール : エージェントがアクションを実行しう、外部システムとやり取りすることを可能にします。

  • 指示 (Instructions) : エージェントをプログラムし、ツールを使用したり応答する方法を教える手段です。

エージェントはまたメモリ、知識、ストレージと推論能力も備えています :

  • 推論 : エージェントが応答前に「考える」ことができて、アクション (i.e. ツール呼び出し) の結果を「分析する」ことができるようにします、これは応答の信頼性と品質を向上させます。

  • 知識 : エージェントが実行時に検索してより良い決定を行い正確な応答を提供できるようにするドメイン固有情報です (RAG)。知識はベクトルデータベースに保存されて、この実行時検索パターンはエージェント型 RAG/エージェント型検索と呼ばれます。

  • ストレージ : セッション履歴や状態をデータベースに保存するためにエージェントが使用します。モデル API はステートレスですが、ストレージは会話を中断したところから継続することを可能にします。これはエージェントをステートフルにし、複数ターンや長期の会話を可能にします。

  • メモリ : エージェントに以前のやり取りからの情報を保存して思い起こす機能を与え、ユーザの好みを学習したり応答をパーソナライズすることを可能にします。

 

レベル 1 : ツールと指示を備えたエージェント

最も単純なエージェントはモデル、ツールと指示から成ります。yfinance ライブラリを使用してデータを取得し、結果をテーブルに表示する指示を持つエージェントを構築しましょう。

level_1_agent.py

from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.yfinance import YFinanceTools

agent = Agent(
    model=Claude(id="claude-sonnet-4-20250514"),
    tools=[YFinanceTools(stock_price=True)],
    instructions="Use tables to display data. Don't include any other text.",
    markdown=True,
)
agent.print_response("What is the stock price of Apple?", stream=True)

 
仮想環境を作成し、依存関係をインストールし、API キーをエクスポートしてエージェントを実行します。

  1. 仮想環境のセットアップ
    uv venv --python 3.12
    source .venv/bin/activate
    

     

  2. 依存関係のインストール
    uv pip install -U agno anthropic yfinance
    

     

  3. Anthropic キーのエクスポート
    export ANTHROPIC_API_KEY=sk-***
    

     

  4. エージェントの実行
    python level_1_agent.py
    

Note : Set debug_mode=True or export AGNO_DEBUG=true to see the system prompt and user messages.

 

Colab で実行

Google Colab で動作確認をしておきます :

%%capture --no-stderr
%pip install -U --quiet agno anthropic yfinance
import getpass
import os

def _set_env(key: str):
    if key not in os.environ:
        os.environ[key] = getpass.getpass(f"{key}:")

_set_env("ANTHROPIC_API_KEY")
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.yfinance import YFinanceTools
agent = Agent(
    model=Claude(id="claude-sonnet-4-20250514"),
    tools=[YFinanceTools(stock_price=True)],
    instructions="Use tables to display data. Don't include any other text.",
    markdown=True,
)
agent.print_response("What is the stock price of Apple?", stream=True)

出力例

▰▱▱▱▱▱▱ Thinking...
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ What is the stock price of Apple?                                                                               ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ • get_current_stock_price(symbol=AAPL)                                                                          ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (5.0s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃   Stock Symbol   Current Price                                                                                  ┃
┃  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                                                                 ┃
┃   AAPL           $210.70                                                                                        ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

 

レベル 2 : 知識とストレージを備えたエージェント

知識 (Knowledge) : モデルは膨大な量のトレーニングデータを持っていますが、より良い決定を行い、正確な応答を提供するためには殆ど常にドメイン固有情報を提供する必要があります (RAG)。この情報はベクトルデータベースにストアし、エージェントが実行時にそれを検索できるようにします。

ストレージ : モデル API はステートレスで、ストレージドライバはチャット履歴と状態をデータベースに保存します。エージェント実行時、データベースからチャット履歴と状態を読み取り、メッセージリストに追加し、会話を再開し、エージェントをステートフルにします。

この例では、以下を使用します :

  • UrlKnowledge : 埋め込み用に OpenAI を使用して、Agno ドキュメントを LanceDB にロードします。

  • SqliteStorage :エージェントのセッション履歴と状態をデータベースに保存します。

level_2_agent.py

from agno.agent import Agent
from agno.embedder.openai import OpenAIEmbedder
from agno.knowledge.url import UrlKnowledge
from agno.models.anthropic import Claude
from agno.storage.sqlite import SqliteStorage
from agno.vectordb.lancedb import LanceDb, SearchType

# Load Agno documentation in a knowledge base
# You can also use `https://docs.agno.com/llms-full.txt` for the full documentation
knowledge = UrlKnowledge(
    urls=["https://docs.agno.com/introduction.md"],
    vector_db=LanceDb(
        uri="tmp/lancedb",
        table_name="agno_docs",
        search_type=SearchType.hybrid,
        # Use OpenAI for embeddings
        embedder=OpenAIEmbedder(id="text-embedding-3-small", dimensions=1536),
    ),
)

# Store agent sessions in a SQLite database
storage = SqliteStorage(table_name="agent_sessions", db_file="tmp/agent.db")

agent = Agent(
    name="Agno Assist",
    model=Claude(id="claude-sonnet-4-20250514"),
    instructions=[
        "Search your knowledge before answering the question.",
        "Only include the output in your response. No other text.",
    ],
    knowledge=knowledge,
    storage=storage,
    add_datetime_to_instructions=True,
    # Add the chat history to the messages
    add_history_to_messages=True,
    # Number of history runs
    num_history_runs=3,
    markdown=True,
)

if __name__ == "__main__":
    # Load the knowledge base, comment out after first run
    # Set recreate to True to recreate the knowledge base if needed
    agent.knowledge.load(recreate=False)
    agent.print_response("What is Agno?", stream=True)

依存関係をインストールし、OPENAI_API_KEY をエクスポートしてエージェントを実行します。

  1. 新しい依存関係のインストール
    uv pip install -U lancedb tantivy openai sqlalchemy
    

     

  2. エージェントの実行
    python level_2_agent.py
    

 

Colab で実行

Google Colab で動作確認をしましょう :

%%capture --no-stderr
%pip install -U --quiet agno anthropic yfinance
%pip install -U --quiet lancedb tantivy openai sqlalchemy pylance
import getpass
import os

def _set_env(key: str):
    if key not in os.environ:
        os.environ[key] = getpass.getpass(f"{key}:")

_set_env("ANTHROPIC_API_KEY")
_set_env("OPENAI_API_KEY")
from agno.agent import Agent
from agno.embedder.openai import OpenAIEmbedder
from agno.knowledge.url import UrlKnowledge
from agno.models.anthropic import Claude
from agno.storage.sqlite import SqliteStorage
from agno.vectordb.lancedb import LanceDb, SearchType
# Load Agno documentation in a knowledge base
# You can also use `https://docs.agno.com/llms-full.txt` for the full documentation
knowledge = UrlKnowledge(
    urls=["https://docs.agno.com/introduction.md"],
    vector_db=LanceDb(
        uri="tmp/lancedb",
        table_name="agno_docs",
        search_type=SearchType.hybrid,
        # Use OpenAI for embeddings
        embedder=OpenAIEmbedder(id="text-embedding-3-small", dimensions=1536),
    ),
)
INFO Creating table: agno_docs
# Store agent sessions in a SQLite database
storage = SqliteStorage(table_name="agent_sessions", db_file="tmp/agent.db")
agent = Agent(
    name="Agno Assist",
    model=Claude(id="claude-sonnet-4-20250514"),
    instructions=[
        "Search your knowledge before answering the question.",
        "Only include the output in your response. No other text.",
    ],
    knowledge=knowledge,
    storage=storage,
    add_datetime_to_instructions=True,
    # Add the chat history to the messages
    add_history_to_messages=True,
    # Number of history runs
    num_history_runs=3,
    markdown=True,
)
# Load the knowledge base, comment out after first run
# Set recreate to True to recreate the knowledge base if needed
agent.knowledge.load(recreate=False)
INFO Loading knowledge base                                                                                        
INFO Added 2 documents to knowledge base  
agent.print_response("What is Agno?", stream=True)

 

レベル 3 : メモリと推論を備えたエージェント

  • 推論 (Reasoning) : エージェントが「考える」&「分析する」ことを可能にし、信頼性と品質向上させます。ReasoningTools はエージェントの応答品質を向上させる最善のアプローチの一つです。

  • メモリ : エージェントがユーザの好みを分類、保存、思い起こす (recall) ことを可能にし、応答をパーソナライズします。メモリは、エージェントがペルソナを構築して以前のやり取りから学習するのに役立ちます。

level_3_agent.py

from agno.agent import Agent
from agno.memory.v2.db.sqlite import SqliteMemoryDb
from agno.memory.v2.memory import Memory
from agno.models.anthropic import Claude
from agno.tools.reasoning import ReasoningTools
from agno.tools.yfinance import YFinanceTools

memory = Memory(
    # Use any model for creating and managing memories
    model=Claude(id="claude-sonnet-4-20250514"),
    # Store memories in a SQLite database
    db=SqliteMemoryDb(table_name="user_memories", db_file="tmp/agent.db"),
    # We disable deletion by default, enable it if needed
    delete_memories=True,
    clear_memories=True,
)

agent = Agent(
    model=Claude(id="claude-sonnet-4-20250514"),
    tools=[
        ReasoningTools(add_instructions=True),
        YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True),
    ],
    # User ID for storing memories, `default` if not provided
    user_id="ava",
    instructions=[
        "Use tables to display data.",
        "Include sources in your response.",
        "Only include the report in your response. No other text.",
    ],
    memory=memory,
    # Let the Agent manage its memories
    enable_agentic_memory=True,
    markdown=True,
)

if __name__ == "__main__":
    # This will create a memory that "ava's" favorite stocks are NVIDIA and TSLA
    agent.print_response(
        "My favorite stocks are NVIDIA and TSLA",
        stream=True,
        show_full_reasoning=True,
        stream_intermediate_steps=True,
    )
    # This will use the memory to answer the question
    agent.print_response(
        "Can you compare my favorite stocks?",
        stream=True,
        show_full_reasoning=True,
        stream_intermediate_steps=True,
    )

 

Colab で実行

Google Colab で動作確認をしましょう :

%%capture --no-stderr
%pip install -U --quiet agno anthropic yfinance
%pip install -U --quiet lancedb tantivy openai sqlalchemy pylance
import getpass
import os

def _set_env(key: str):
    if key not in os.environ:
        os.environ[key] = getpass.getpass(f"{key}:")

_set_env("ANTHROPIC_API_KEY")
from agno.agent import Agent
from agno.memory.v2.db.sqlite import SqliteMemoryDb
from agno.memory.v2.memory import Memory
from agno.models.anthropic import Claude
from agno.tools.reasoning import ReasoningTools
from agno.tools.yfinance import YFinanceTools
memory = Memory(
    # Use any model for creating and managing memories
    model=Claude(id="claude-sonnet-4-20250514"),
    # Store memories in a SQLite database
    db=SqliteMemoryDb(table_name="user_memories", db_file="tmp/agent.db"),
    # We disable deletion by default, enable it if needed
    delete_memories=True,
    clear_memories=True,
)
agent = Agent(
    model=Claude(id="claude-sonnet-4-20250514"),
    tools=[
        ReasoningTools(add_instructions=True),
        YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True),
    ],
    # User ID for storing memories, `default` if not provided
    user_id="ava",
    instructions=[
        "Use tables to display data.",
        "Include sources in your response.",
        "Only include the report in your response. No other text.",
    ],
    memory=memory,
    # Let the Agent manage its memories
    enable_agentic_memory=True,
    markdown=True,
)
%%time

# This will create a memory that "ava's" favorite stocks are NVIDIA and TSLA
agent.print_response(
    "My favorite stocks are NVIDIA and TSLA",
    stream=True,
    show_full_reasoning=True,
    stream_intermediate_steps=True,
)
▰▰▰▰▰▰▰ Thinking...
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ My favorite stocks are NVIDIA and TSLA                                                                          ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Reasoning step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ Understanding user's favorite stocks                                                                            ┃
┃ Action: Update user memory with their favorite stocks information                                               ┃
┃                                                                                                                 ┃
┃ Reasoning: The user has mentioned their favorite stocks are NVIDIA and TSLA (Tesla). This is information I      ┃
┃ should capture in their memory for future reference. I should use the update_user_memory tool to store this     ┃
┃ preference information.                                                                                         ┃
┃ Confidence: 1.0                                                                                                 ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ • think(title=Understanding user's favorite stocks, thought=The user has mentioned their favorite stocks are    ┃
┃ NVIDIA and TSLA (Tesla). This is information I should capture in their memory for future reference. I should    ┃
┃ use the update_user_memory tool to store this preference information., action=Update user memory with their     ┃
┃ favorite stocks information, confidence=1.0)                                                                    ┃
┃ • update_user_memory(task=Add a new memory that the user's favorite stocks are NVIDIA and TSLA (Tesla). This    ┃
┃ shows their preference for technology and electric vehicle stocks.)                                             ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (17.2s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ Thanks for sharing your favorite stocks! I've noted that you prefer NVIDIA and TSLA (Tesla) - both excellent    ┃
┃ choices in the technology and electric vehicle sectors.                                                         ┃
┃                                                                                                                 ┃
┃ Would you like me to provide any information about these stocks, such as their current prices, recent news,     ┃
┃ analyst recommendations, or company overviews? I can help you stay updated on your favorite investments.        ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
CPU times: user 1.39 s, sys: 79.8 ms, total: 1.47 s
Wall time: 17.7 s
%%time

# This will use the memory to answer the question
agent.print_response(
    "Can you compare my favorite stocks?",
    stream=True,
    show_full_reasoning=True,
    stream_intermediate_steps=True,
)
▰▰▱▱▱▱▱ Thinking...
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ Can you compare my favorite stocks?                                                                             ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Reasoning step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ Understanding user request and recalling their favorite stocks                                                  ┃
┃ Action: Gather comprehensive data for both NVIDIA and TSLA stocks including current prices, company info,       ┃
┃ analyst recommendations, and recent news                                                                        ┃
┃                                                                                                                 ┃
┃ Reasoning: The user is asking me to compare their favorite stocks. From the memories, I can see that their      ┃
┃ favorite stocks are NVIDIA and TSLA (Tesla). I should gather comprehensive information about both stocks to     ┃
┃ provide a meaningful comparison. This would include current stock prices, company information, analyst          ┃
┃ recommendations, and recent news for both companies.                                                            ┃
┃ Confidence: 0.95                                                                                                ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Reasoning step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ Comprehensive data gathered for both favorite stocks                                                            ┃
┃ Successfully gathered comprehensive data for both NVIDIA (NVDA) and Tesla (TSLA) including current stock        ┃
┃ prices, company information, analyst recommendations, and recent news. NVIDIA is at $164.92 with a market cap   ┃
┃ of $4.02T and strong buy recommendations, while Tesla is at $313.51 with a market cap of $1.01T and hold        ┃
┃ recommendations.                                                                                                ┃
┃ Reasoning: I have all the necessary data to provide a comprehensive comparison of the user's favorite stocks.   ┃
┃ The data includes financial metrics, analyst opinions, and recent news for both companies. NVIDIA shows         ┃
┃ stronger analyst sentiment and financial metrics, while Tesla shows mixed performance with governance concerns. ┃
┃ I can now create a detailed comparison report.                                                                  ┃
┃ Confidence: 0.95                                                                                                ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ • think(title=Understanding user request and recalling their favorite stocks, thought=The user is asking me to  ┃
┃ compare their favorite stocks. From the memories, I can see that their favorite stocks are NVIDIA and TSLA      ┃
┃ (Tesla). I should gather comprehensive information about both stocks to provide a meaningful comparison. This   ┃
┃ would include current stock prices, company information, analyst recommendations, and recent news for both      ┃
┃ companies., action=Gather comprehensive data for both NVIDIA and TSLA stocks including current prices, company  ┃
┃ info, analyst recommendations, and recent news, confidence=0.95)                                                ┃
┃ • get_current_stock_price(symbol=NVDA)                                                                          ┃
┃ • get_current_stock_price(symbol=TSLA)                                                                          ┃
┃ • get_company_info(symbol=NVDA)                                                                                 ┃
┃ • get_company_info(symbol=TSLA)                                                                                 ┃
┃ • get_analyst_recommendations(symbol=NVDA)                                                                      ┃
┃ • get_analyst_recommendations(symbol=TSLA)                                                                      ┃
┃ • get_company_news(symbol=NVDA, num_stories=3)                                                                  ┃
┃ • get_company_news(symbol=TSLA, num_stories=3)                                                                  ┃
┃ • analyze(title=Comprehensive data gathered for both favorite stocks, result=Successfully gathered              ┃
┃ comprehensive data for both NVIDIA (NVDA) and Tesla (TSLA) including current stock prices, company information, ┃
┃ analyst recommendations, and recent news. NVIDIA is at $164.92 with a market cap of $4.02T and strong buy       ┃
┃ recommendations, while Tesla is at $313.51 with a market cap of $1.01T and hold recommendations., analysis=I    ┃
┃ have all the necessary data to provide a comprehensive comparison of the user's favorite stocks. The data       ┃
┃ includes financial metrics, analyst opinions, and recent news for both companies. NVIDIA shows stronger analyst ┃
┃ sentiment and financial metrics, while Tesla shows mixed performance with governance concerns. I can now create ┃
┃ a detailed comparison report., next_action=final_answer, confidence=0.95)                                       ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (38.6s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                 ┃
┃ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃
┃ ┃                                Stock Comparison Report: Your Favorite Stocks                                ┃ ┃
┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                                    Overview                                                     ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃   Metric          NVIDIA (NVDA)    Tesla (TSLA)                                                                 ┃
┃  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                                          ┃
┃   Current Price   $164.92          $313.51                                                                      ┃
┃   Market Cap      $4.02 trillion   $1.01 trillion                                                               ┃
┃   Sector          Technology       Consumer Cyclical                                                            ┃
┃   Industry        Semiconductors   Auto Manufacturers                                                           ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                              Financial Performance                                              ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃   Metric           NVIDIA (NVDA)      Tesla (TSLA)                                                              ┃
┃  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                                        ┃
┃   P/E Ratio        53.2               178.13                                                                    ┃
┃   EPS              $3.10              $1.76                                                                     ┃
┃   Revenue Growth   69.2%              -9.2%                                                                     ┃
┃   Gross Margins    70.1%              17.7%                                                                     ┃
┃   EBITDA Margins   59.4%              13.1%                                                                     ┃
┃   Free Cash Flow   $55.4B             $3.4B                                                                     ┃
┃   52-Week Range    $86.62 - $167.89   $182.00 - $488.54                                                         ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                             Analyst Recommendations                                             ┃
┃                                                                                                                 ┃
┃                                                  NVIDIA (NVDA)                                                  ┃
┃                                                                                                                 ┃
┃  • Overall Rating: Strong Buy                                                                                   ┃
┃  • Distribution: 12 Strong Buy, 46 Buy, 7 Hold, 1 Sell, 0 Strong Sell                                           ┃
┃  • Total Analysts: 57                                                                                           ┃
┃                                                                                                                 ┃
┃                                                  Tesla (TSLA)                                                   ┃
┃                                                                                                                 ┃
┃  • Overall Rating: Hold                                                                                         ┃
┃  • Distribution: 7 Strong Buy, 14 Buy, 16 Hold, 7 Sell, 3 Strong Sell                                           ┃
┃  • Total Analysts: 41                                                                                           ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                             Recent News Highlights                                              ┃
┃                                                                                                                 ┃
┃                                                     NVIDIA                                                      ┃
┃                                                                                                                 ┃
┃  • Historic Milestone: Became the first company to close above $4 trillion market cap                           ┃
┃  • CEO Activity: Jensen Huang spotted at the White House, potentially signaling important developments          ┃
┃  • Market Performance: Continues to be viewed as undervalued despite record highs                               ┃
┃                                                                                                                 ┃
┃                                                      Tesla                                                      ┃
┃                                                                                                                 ┃
┃  • Governance Concerns: Analyst Dan Ives suggested board oversight for CEO Elon Musk, leading to public dispute ┃
┃  • Tax Credit Alert: EV buyers need to act quickly to secure $7,500 federal tax credit                          ┃
┃  • SpaceX Success: While Tesla faces challenges, Musk's SpaceX continues strong financial performance           ┃
┃                                                                                                                 ┃
┃                                                                                                                 ┃
┃                                                  Key Insights                                                   ┃
┃                                                                                                                 ┃
┃ NVIDIA Strengths:                                                                                               ┃
┃                                                                                                                 ┃
┃  • Dominant position in AI/semiconductor market                                                                 ┃
┃  • Exceptional profit margins (70.1% gross, 59.4% EBITDA)                                                       ┃
┃  • Strong analyst consensus with "Strong Buy" rating                                                            ┃
┃  • Record-breaking market valuation milestone                                                                   ┃
┃                                                                                                                 ┃
┃ Tesla Challenges:                                                                                               ┃
┃                                                                                                                 ┃
┃  • Declining revenue growth (-9.2%)                                                                             ┃
┃  • High valuation concerns (P/E of 178.13)                                                                      ┃
┃  • Mixed analyst sentiment with "Hold" rating                                                                   ┃
┃  • Governance and leadership questions                                                                          ┃
┃                                                                                                                 ┃
┃ Investment Considerations:                                                                                      ┃
┃                                                                                                                 ┃
┃  • NVIDIA appears fundamentally stronger with better growth metrics and analyst support                         ┃
┃  • Tesla trades at a significant premium despite recent performance challenges                                  ┃
┃  • Both stocks remain volatile and subject to broader market conditions                                         ┃
┃                                                                                                                 ┃
┃ ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┃
┃ Sources: Yahoo Finance, company financial reports, analyst recommendations as of January 2025                   ┃
┃                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
CPU times: user 2.44 s, sys: 99.4 ms, total: 2.54 s
Wall time: 39 s

 

以上



クラスキャット

最近の投稿

  • Agno : イントロダクション : エージェントとは ? / Colab 実行例
  • Agno : MAS 構築用フルスタック・フレームワーク
  • LangGraph 0.5 : エージェント開発 : エージェント・アーキテクチャ
  • LangGraph 0.5 : エージェント開発 : ワークフローとエージェント
  • LangGraph 0.5 : エージェント開発 : エージェントの実行

タグ

AutoGen (13) ClassCat Press Release (20) ClassCat TF/ONNX Hub (11) DGL 0.5 (14) Eager Execution (7) Edward (17) FLUX.1 (16) Gemini (20) HuggingFace Transformers 4.5 (10) HuggingFace Transformers 4.6 (7) HuggingFace Transformers 4.29 (9) Keras 2 Examples (98) Keras 2 Guide (16) Keras 3 (10) Keras Release Note (17) Kubeflow 1.0 (10) LangChain (45) LangGraph (24) LangGraph 0.5 (9) MediaPipe 0.8 (11) Model Context Protocol (16) NNI 1.5 (16) OpenAI Agents SDK (8) OpenAI Cookbook (13) OpenAI platform (10) OpenAI platform 1.x (10) OpenAI ヘルプ (8) TensorFlow 2.0 Advanced Tutorials (33) TensorFlow 2.0 Advanced Tutorials (Alpha) (15) TensorFlow 2.0 Advanced Tutorials (Beta) (16) TensorFlow 2.0 Guide (10) TensorFlow 2.0 Guide (Alpha) (16) TensorFlow 2.0 Guide (Beta) (9) TensorFlow 2.0 Release Note (12) TensorFlow 2.0 Tutorials (20) TensorFlow 2.0 Tutorials (Alpha) (14) TensorFlow 2.0 Tutorials (Beta) (12) TensorFlow 2.4 Guide (24) TensorFlow Deploy (8) TensorFlow Get Started (7) TensorFlow Probability (9) TensorFlow Programmer's Guide (22) TensorFlow Release Note (18) TensorFlow Tutorials (33) TF-Agents 0.4 (11)
2025年7月
月 火 水 木 金 土 日
 123456
78910111213
14151617181920
21222324252627
28293031  
« 6月    
© 2025 ClasCat® AI Research | Powered by Minimalist Blog WordPress Theme