Skip to content

ClassCat® AI Research

クラスキャット – Agno, AgentOS, MCP, LangChain/LangGraph, CrewAI

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 2.x : チーム – チーム・セッション

Posted on 11/10/2025 by Masashi Okumura

チーム・セッションと会話履歴の管理について学習します。
Team.run() を呼び出すと、ステートレスな単一のチーム実行が作成されますが、この会話を続けたい場合、つまり複数ターンの会話を行いたい場合どうすれば良いでしょう?そこで「セッション」が登場します。セッションは連続的な実行のコレクションです。

Agno 2.x : Learn : チーム – チーム・セッション

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

* 本記事は docs.agno.com の以下のページを独自に翻訳した上で、補足説明を加えてまとめ直しています。スニペットはできる限り日本語を使用しています :

  • Learn : Teams – Team Sessions

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

 

 

Agno 2.x : Learn : チーム – チーム・セッション

チーム・セッションと会話履歴の管理について学習します。

Team.run() を呼び出すと、ステートレスな単一のチーム実行が作成されます。

しかしこの会話を続けたい場合、つまり複数ターンの会話を行いたい場合どうすれば良いでしょう?そこで「セッション」が登場します。セッションは連続的な実行のコレクションです。

実際には、チームの文脈でのセッションはユーザとチーム間の複数ターンの会話です。session_id を使用して、会話履歴と複数実行にわたる状態を関連付けることができます。

See more details in the Agent Sessions documentation.

 

マルチユーザ、マルチセッションのチーム

チームとやり取りする各ユーザはセッションの固有のセットを取得し、同じチームと同時にやり取りする複数のユーザを持つことができます。

user_id を設定して、ユーザをチームのセッションに接続します。

以下の例では、session_id を設定して、複数ユーザで複数ターンの会話を同時に行う方法を実演します。

from agno.team import Team
from agno.models.openai import OpenAIChat
from agno.db.sqlite import SqliteDb

db = SqliteDb(db_file="tmp/data.db")

team = Team(
    model=OpenAIChat(id="gpt-5-mini"),
    members=[
        Agent(name="Agent 1", role="You answer questions in English"),
        Agent(name="Agent 2", role="You answer questions in Chinese"),
        Agent(name="Agent 3", role="You answer questions in French"),
    ],
    db=db,
    respond_directly=True,
)

user_1_id = "user_101"
user_2_id = "user_102"

user_1_session_id = "session_101"
user_2_session_id = "session_102"

# Start the session with user 1 (This means "how are you?" in French)
team.print_response(
    "comment ça va?",
    user_id=user_1_id,
    session_id=user_1_session_id,
)
# Continue the session with user 1 (This means "tell me a joke" in French)
team.print_response("Raconte-moi une blague.", user_id=user_1_id, session_id=user_1_session_id)

# Start the session with user 2
team.print_response("Tell me about quantum physics.", user_id=user_2_id, session_id=user_2_session_id)
# Continue the session with user 2
team.print_response("What is the speed of light?", user_id=user_2_id, session_id=user_2_session_id)

# Ask the agent to give a summary of the conversation, this will use the history from the previous messages (but only for user 1)
team.print_response(
    "Give me a summary of our conversation.",
    user_id=user_2_id,
    session_id=user_2_session_id,
)

出力例

INFO Agent 'Agent 1' inheriting model from Team: gpt-5-mini                                                                                        
INFO Agent 'Agent 2' inheriting model from Team: gpt-5-mini                                                                                        
INFO Agent 'Agent 3' inheriting model from Team: gpt-5-mini                                                                                        
▰▰▰▰▰▰▱ Thinking...
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ comment ça va?                                                                                                                                  ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (4.7s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Operation cancelled by user                                                                                                                     ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Raconte-moi une blague.                                                                                                                         ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-3, task=Raconte une blague en français, adaptée à un public général,                                  ┃
┃   courte (1 à 3 phrases), et sans contenu offensant. Donne la blague seule, puis, sur une nouvelle ligne,                                       ┃
┃   ajoute une brève ligne facultative entre parenthèses expliquant le jeu de mots si nécessaire.)                                                ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (14.6s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Quel est le comble pour un électricien ? De ne pas être au courant.                                                                             ┃
┃                                                                                                                                                 ┃
┃ (Jeu de mots entre "être au courant" = être informé et "courant" électrique.)                                                                   ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Tell me about quantum physics.                                                                                                                  ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-1, task=Provide a clear, accessible overview of quantum physics in                                    ┃
┃   English suitable for a general audience. Cover: 1) What quantum physics studies; 2) Key principles (wave-                                     ┃
┃   particle duality, superposition, uncertainty principle, quantization, entanglement); 3) Core mathematical                                     ┃
┃   ideas at a high level (state vectors/wavefunctions, operators, Schrödinger equation) without heavy math; 4)                                   ┃
┃   Important historical experiments (double-slit, photoelectric effect, Stern–Gerlach, Bell tests); 5) Main                                      ┃
┃   interpretations (Copenhagen, Many-Worlds, pilot-wave) briefly; 6) Major applications and technologies                                         ┃
┃   (semiconductors, lasers, MRI, quantum computing, cryptography); 7) Common misconceptions and clarifications;                                  ┃
┃   8) Suggested further reading/resources for different levels (beginner, intermediate, advanced). Keep tone                                     ┃
┃   friendly and explanatory, use analogies where helpful, and aim for ~700–1000 words. Provide the content as                                    ┃
┃   plain English text.)                                                                                                                          ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (38.5s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ What quantum physics studies                                                                                                                    ┃
┃ Quantum physics (or quantum mechanics) is the branch of physics that describes the behavior of matter and energy at the smallest scales —       ┃
┃ atoms, electrons, photons and other elementary particles. It explains why atoms bind into molecules, how light interacts with matter, and the   ┃
┃ rules that govern tiny systems that don’t follow the everyday “common sense” of classical physics.                                              ┃
┃                                                                                                                                                 ┃
┃ Key principles (in plain language)                                                                                                              ┃
┃ - Wave–particle duality: Tiny things behave sometimes like particles (localized bits of stuff) and sometimes like waves (spread-out,            ┃
┃ interfering patterns). Light can act like a stream of particles called photons, but it also produces interference patterns like waves. Think of ┃
┃ a toy that can be both a marble and a ripple depending on how you test it.                                                                      ┃
┃ - Superposition: A quantum object can be in multiple possible states at once until you check it. Imagine a spinning coin that’s not strictly    ┃
┃ heads or tails but a mixture; only when you look does it give one definite face. Mathematically that “mixture” means different possibilities    ┃
┃ add together.                                                                                                                                   ┃
┃ - Uncertainty principle: Certain pairs of properties (like position and momentum) can’t both be known to arbitrary precision at the same time.  ┃
┃ This isn’t a limit of our instruments but a fundamental feature: the more tightly something is localized, the less precisely its motion is      ┃
┃ defined.                                                                                                                                        ┃
┃ - Quantization: Some properties come in discrete packets. For example, electrons in atoms can occupy only certain energy levels rather than any ┃
┃ value in between — like steps on a ladder, not a ramp.                                                                                          ┃
┃ - Entanglement: Two or more quantum systems can be linked so that their properties are correlated in ways that can’t be explained by each       ┃
┃ object having its own separate properties. Measuring one instantly tells you something about the other, even if they are far apart.             ┃
┃                                                                                                                                                 ┃
┃ Core mathematical ideas (high level)                                                                                                            ┃
┃ - State vectors / wavefunctions: The quantum state encodes all possible outcomes and their likelihoods. A wavefunction is a mathematical        ┃
┃ “cloud” whose size at a point relates to the probability of finding a particle there. It’s not a physical cloud but a tool for computing        ┃
┃ probabilities.                                                                                                                                  ┃
┃ - Operators: Measurements correspond to mathematical operators — think of them as the questions you can ask a system. Applying an operator to a ┃
┃ state gives possible answers (the measurement outcomes) and their probabilities.                                                                ┃
┃ - Schrödinger equation: This is the fundamental rule for how the quantum state evolves over time. It’s like the recipe that tells the           ┃
┃ wavefunction how to change, predicting how probabilities shift unless and until a measurement is made.                                          ┃
┃                                                                                                                                                 ┃
┃ Important historical experiments                                                                                                                ┃
┃ - Double-slit experiment: Particles sent one-by-one through two slits create an interference pattern on a screen, revealing wave-like behavior. ┃
┃ When detectors check which slit a particle passes through, the interference disappears—showing measurement affects outcomes.                    ┃
┃ - Photoelectric effect: Light shone on metal ejects electrons only if its frequency is above a threshold, regardless of intensity. Einstein     ┃
┃ explained this by proposing light comes in quanta (photons), establishing the particle-like nature of light.                                    ┃
┃ - Stern–Gerlach experiment: A beam of silver atoms sent through a magnetic field splits into discrete components, showing that certain          ┃
┃ properties (spin) are quantized — not a continuum but distinct values.                                                                          ┃
┃ - Bell tests (Aspect and others): Experiments measuring entangled particles violate inequalities derived from classical assumptions (local      ┃
┃ realism), demonstrating that no local hidden-variable theory can reproduce quantum correlations.                                                ┃
┃                                                                                                                                                 ┃
┃ Main interpretations (brief)                                                                                                                    ┃
┃ - Copenhagen interpretation: Traditionally dominant, it treats the wavefunction as a tool for predicting probabilities and says measurement     ┃
┃ causes a collapse to a definite outcome. It emphasizes experimental context and avoids assigning reality to unobserved properties.              ┃
┃ - Many-Worlds interpretation: Suggests the wavefunction never collapses; instead, every possible outcome occurs in a branching multiverse.      ┃
┃ Measurement splits the world into branches where each outcome happens.                                                                          ┃
┃ - Pilot-wave (Bohmian) interpretation: Proposes particles have definite positions guided by a nonlocal “pilot wave.” It’s deterministic but     ┃
┃ requires nonlocal influences that connect distant particles.                                                                                    ┃
┃                                                                                                                                                 ┃
┃ There’s no single agreed-upon interpretation; they make the same experimental predictions in most cases, so choice is partly philosophical.     ┃
┃                                                                                                                                                 ┃
┃ Major applications and technologies                                                                                                             ┃
┃ - Semiconductors and transistors: Quantum mechanics explains electron behavior in solids; this underpins all modern electronics and computers.  ┃
┃ - Lasers: Based on quantized energy levels and stimulated emission; used in medicine, communications, manufacturing.                            ┃
┃ - MRI (magnetic resonance imaging): Uses quantum properties of atomic nuclei (spin) to produce detailed body images.                            ┃
┃ - LEDs, solar cells, and electron microscopes: All rely on quantum principles.                                                                  ┃
┃ - Quantum computing: Uses qubits that exploit superposition and entanglement to solve certain problems faster than classical computers; still   ┃
┃ an active research field with practical devices emerging.                                                                                       ┃
┃ - Quantum cryptography: Uses quantum properties (e.g., no-cloning and disturbance on measurement) to create secure communication methods like   ┃
┃ quantum key distribution.                                                                                                                       ┃
┃                                                                                                                                                 ┃
┃ Common misconceptions and clarifications                                                                                                        ┃
┃ - “Quantum means small” — Mostly true in practice, but quantum laws apply to everything; macroscopic objects appear classical because of        ┃
┃ decoherence (interaction with many surroundings washes out quantum effects).                                                                    ┃
┃ - “Observation requires a conscious observer” — No. “Measurement” means interaction that leaves a record (e.g., a detector); consciousness is   ┃
┃ not required.                                                                                                                                   ┃
┃ - “Quantum equals spooky action at a distance that allows faster-than-light signaling” — Entanglement produces correlations that appear         ┃
┃ instantaneous, but it can’t transmit usable information faster than light.                                                                      ┃
┃ - “Quantum randomness means anything is possible” — Outcomes are probabilistic, but the probability rules are sharply defined and reliably      ┃
┃ predictive.                                                                                                                                     ┃
┃                                                                                                                                                 ┃
┃ Suggested further reading/resources                                                                                                             ┃
┃ Beginner                                                                                                                                        ┃
┃ - “In Search of Schrödinger’s Cat” by John Gribbin — classic popular account.                                                                   ┃
┃ - “Quantum: A Guide for the Perplexed” by Jim Al-Khalili — friendly overview.                                                                   ┃
┃ - Online: Khan Academy basics, and accessible videos from Veritasium, PBS Space Time, and MinutePhysics.                                        ┃
┃                                                                                                                                                 ┃
┃ Intermediate                                                                                                                                    ┃
┃ - “The Theoretical Minimum: Quantum Mechanics” by Leonard Susskind and Art Friedman — conceptual with some math.                                ┃
┃ - “Quantum Mechanics: A Modern Development” (popular-level introductions vary) or “Introduction to Quantum Mechanics” by David J. Griffiths for ┃
┃ a standard undergraduate introduction.                                                                                                          ┃
┃                                                                                                                                                 ┃
┃ Advanced                                                                                                                                        ┃
┃ - “Modern Quantum Mechanics” by J. J. Sakurai and Jim Napolitano — graduate-level.                                                              ┃
┃ - “Quantum Computation and Quantum Information” by Nielsen and Chuang — for quantum information theory.                                         ┃
┃                                                                                                                                                 ┃
┃ Hands-on / online                                                                                                                               ┃
┃ - MIT OpenCourseWare, Stanford lectures, and Coursera/edX courses.                                                                              ┃
┃ - IBM Quantum Experience lets you run simple quantum programs on real devices.                                                                  ┃
┃                                                                                                                                                 ┃
┃ Closing                                                                                                                                         ┃
┃ Quantum physics may feel strange because it challenges everyday intuition, but its rules are precise, experimentally tested, and the foundation ┃
┃ of much modern technology. You don’t need advanced math to appreciate the ideas; start with accessible books and videos, then gradually add     ┃
┃ formal coursework if you want to go deeper.                                                                                                     ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ What is the speed of light?                                                                                                                     ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (5.2s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ The speed of light in vacuum (symbol c) is exactly 299,792,458 meters per second — about 3.00 × 10^8 m/s, 299,792.458 km/s, or roughly 186,282  ┃
┃ miles per second.                                                                                                                               ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Give me a summary of our conversation.                                                                                                          ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (10.6s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Here’s a concise summary of our conversation so far:                                                                                            ┃
┃                                                                                                                                                 ┃
┃ - System context: You’re talking with an AI whose knowledge cutoff is 2024-06 and current date is 2025-11-09.                                   ┃
┃ - Developer instructions: I act as leader of a team of AI agents and must coordinate them to complete user requests. I must delegate tasks to   ┃
┃ team members, include member_id and a clear task description, analyze member responses before replying to the user, and reassign if             ┃
┃ unsatisfied. For simple greetings/thanks or questions about the team, I should respond directly.                                                ┃
┃ - Team composition:                                                                                                                             ┃
┃   - agent-1 (Agent 1) — answers questions in English                                                                                            ┃
┃   - agent-2 (Agent 2) — answers questions in Chinese                                                                                            ┃
┃   - agent-3 (Agent 3) — answers questions in French                                                                                             ┃
┃ - Tools available for delegation:                                                                                                               ┃
┃   - functions.delegate_task_to_member — send a task to a specific member (must include member_id and task).                                     ┃
┃   - multi_tool_use.parallel — run multiple function calls in parallel (wraps delegate calls).                                                   ┃
┃ - User activity: You asked, “Give me a summary of our conversation.”                                                                            ┃
┃ - Current state: I will respond directly with this summary (per the delegation rules for simple requests).                                      ┃
┃                                                                                                                                                 ┃
┃ If you want a different type of summary (more detailed, chronological transcript, or focused on a particular part), tell me which and I’ll      ┃
┃ refine it.                                                                                                                                      ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

 
ユーザ 2 のセッションを日本語に

from agno.agent import Agent
from agno.team import Team
from agno.models.openai import OpenAIChat
from agno.db.sqlite import SqliteDb

db = SqliteDb(db_file="tmp/data.db")

team = Team(
    model=OpenAIChat(id="o4-mini"),
    members=[
        Agent(name="Agent 1", role="あなたは日本語で質問に答えます"),
        Agent(name="Agent 2", role="You answer questions in Chinese"),
        Agent(name="Agent 3", role="You answer questions in French"),
    ],
    db=db,
    respond_directly=True,
)

user_1_id = "user_101"
user_2_id = "user_102"

user_1_session_id = "session_101"
user_2_session_id = "session_102"

# ユーザ 1 のセッションで始めます (This means "how are you?" in French)
team.print_response(
    "comment ça va?",
    user_id=user_1_id,
    session_id=user_1_session_id,
)
# ユーザ 1 のセッションを続けます (This means "tell me a joke" in French)
team.print_response("Raconte-moi une blague.", user_id=user_1_id, session_id=user_1_session_id)

# ユーザ 2 のセッションを始めます
team.print_response("量子物理学について教えてください。", user_id=user_2_id, session_id=user_2_session_id)
# Continue the session with user 2
team.print_response("光の速さとは何ですか?", user_id=user_2_id, session_id=user_2_session_id)

# Ask the agent to give a summary of the conversation,
# this will use the history from the previous messages (but only for user 1)
team.print_response(
    "私たちの会話内容を要約してください。",
    user_id=user_2_id,
    session_id=user_2_session_id,
)

出力例

INFO Agent 'Agent 1' inheriting model from Team: o4-mini                                                                                           
INFO Agent 'Agent 2' inheriting model from Team: o4-mini                                                                                           
INFO Agent 'Agent 3' inheriting model from Team: o4-mini                                                                                           
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ comment ça va?                                                                                                                                  ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-3, task=Réponds à l'utilisateur en français à la question "comment                                    ┃
┃   ça va?", en exprimant que tu vas bien et en retournant la question à l'utilisateur.)                                                          ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (8.8s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Je vais bien, merci ! Et toi, comment ça va ?                                                                                                   ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Raconte-moi une blague.                                                                                                                         ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-3, task=Raconte une blague en français pour l'utilisateur.)                                           ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (7.1s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ Pourquoi les plongeurs plongent-ils toujours en arrière et jamais en avant ?                                                                    ┃
┃                                                                                                                                                 ┃
┃ Parce que sinon ils tombent encore dans le bateau !                                                                                             ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 量子物理学について教えてください。                                                                                                              ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-1,                                                                                                    ┃
┃   task=量子物理学について初心者向けにわかりやすく説明してください。基本的な概念、原理、主要な実験例を含めて日本語で解説してください。)          ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (18.3s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 量子物理学は、「非常に小さな世界」(原子や電子、光子など)で成立する物理法則を扱う学問分野です。古典物理学(ニュートン力学やマクスウェルの電磁  ┃
┃ 気学など)では説明できない現象を解明し、現代の科学技術(半導体、レーザー、MRI、量子コンピュータなど)の基盤となっています。以下、初心者向けに基 ┃
┃ 本概念・原理・代表的な実験例をまとめます。                                                                                                      ┃
┃                                                                                                                                                 ┃
┃ 1. 古典→量子への転換                                                                                                                            ┃
┃   -                                                                                                                                             ┃
┃ 古典物理学では「エネルギーは連続的」と考えられていたが、20世紀初頭の実験(黒体放射など)で「エネルギーはある単位(量子)でしかやり取りできない  ┃
┃ 」ことが分かった。                                                                                                                              ┃
┃                                                                                                                                                 ┃
┃ 2. 基本概念                                                                                                                                     ┃
┃   1) 量子(Quantum)                                                                                                                            ┃
┃     ・エネルギーや運動量が連続ではなく最小単位(量子)で飛び飛びに変化する。                                                                    ┃
┃   2) 波動‐粒子二重性                                                                                                                            ┃
┃     ・光も電子も「波の性質」と「粒子の性質」を併せ持つ。                                                                                        ┃
┃   3) 不確定性原理(ハイゼンベルク)                                                                                                             ┃
┃     ・位置と運動量、エネルギーと時間など、ある対の物理量は同時に完全に正確には測れない。                                                        ┃
┃   4) 重ね合わせ原理                                                                                                                             ┃
┃     ・量子状態は複数の状態の重ね合わせ(例えば「↑」「↓」両方のスピンが同時にある状態)で存在できる。                                            ┃
┃   5) 量子もつれ(エンタングルメント)                                                                                                           ┃
┃     ・離れた粒子同士が、一体の量子状態として結びつき、片方を測定するともう片方の状態が瞬時に決まるように見える。                                ┃
┃                                                                                                                                                 ┃
┃ 3. 代表的な実験例                                                                                                                               ┃
┃   1) 光電効果(アインシュタイン, 1905年)                                                                                                       ┃
┃     ・光を金属に当てると電子が飛び出す現象。古典波動説では説明できず、光が粒子(光子)として働く証拠となった。                                  ┃
┃   2) ダブルスリット実験(ヤングの干渉→電子版)                                                                                                  ┃
┃     ・光や電子を2本のスリットに通すと干渉縞が現れる。一粒ずつ飛ばしても干渉縞ができ、波動‐粒子二重性と重ね合わせを示す。                       ┃
┃   3) EPR実験とベルの不等式(アスペらの実験, 1980年代)                                                                                          ┃
┃     ・量子もつれ状態にある2つの光子で、ベルの不等式を破る結果が得られ、局所実在論(古典的直観)を否定した。                                    ┃
┃                                                                                                                                                 ┃
┃ 4. 基本原理と数式的枠組み                                                                                                                       ┃
┃   - シュレディンガー方程式                                                                                                                      ┃
┃     ・波動関数Ψ(x,t)が時間とともにどう変化するかを支配する方程式。                                                                              ┃
┃   - 波動関数の確率解釈(ボルンの解釈)                                                                                                          ┃
┃     ・|Ψ(x)|²が位置xに粒子が存在する確率を表す。                                                                                                ┃
┃   - コペンハーゲン解釈                                                                                                                          ┃
┃     ・測定によって波動関数が「収縮」し、結果としてひとつの状態がランダムに現れる。                                                              ┃
┃                                                                                                                                                 ┃
┃ 5. 応用例                                                                                                                                       ┃
┃   - 半導体デバイス(トランジスタ、ダイオード)                                                                                                  ┃
┃   - レーザー(誘導放出による単一周波数光源)                                                                                                    ┃
┃   - MRI(核スピンの量子状態を利用)                                                                                                             ┃
┃   - 量子コンピュータ(重ね合わせともつれを計算資源に)                                                                                          ┃
┃                                                                                                                                                 ┃
┃ まとめると、量子物理学は「ミクロ世界でのエネルギーの量子化」「波と粒子の二重性」「不確定性や重ね合わせ」といったユニークな現象を理論化・実証し  ┃
┃ 、現代の先端技術を支えている分野です。興味があれば、まずは高校レベルの量子力学入門書や概念解説書を手に取ってみてください。                      ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 光の速さとは何ですか?                                                                                                                          ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-1, task=「光の速さとは何ですか?」という質問に日本語で回答してください。)                             ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (10.1s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 光の速さ(光速度)とは、真空中で光が伝わる速さのことを指し、物理定数として「c」で表されます。国際単位系(SI)ではその値が正確に 299 792 458     ┃
┃ メートル/秒 と定められており、これは光が 1 秒間に約 30 万キロメートル進む速さに相当します。                                                    ┃
┃                                                                                                                                                 ┃
┃ この速さは次のような重要な性質をもちます。                                                                                                      ┃
┃ ・相対性理論の根幹:アインシュタインの特殊相対性理論では、光速は観測者の運動状態に依存せず不変であるとされ、時間や長さの概念に深い影響を与えま  ┃
┃ す。                                                                                                                                            ┃
┃ ・情報伝達の上限:真空中では物質も信号もこの速度を超えて伝わることはできないと考えられています。                                                ┃
┃ ・長さの定義基準:1 メートルは「光が真空中で 1/299 792 458 秒間に進む距離」として定義されています。                                             ┃
┃                                                                                                                                                 ┃
┃ このように、光の速さは物理学の基本定数であり、現代科学や技術の多くの分野で基礎となっています。                                                  ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 私たちの会話内容を要約してください。                                                                                                            ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-1, task=今までの会話内容を日本語で要約してください。)                                                 ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (9.4s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ これまでのやり取りをまとめると以下の通りです。                                                                                                  ┃
┃                                                                                                                                                 ┃
┃ 1. システムメッセージ                                                                                                                           ┃
┃    – 知識のカットオフは2024年6月であること                                                                                                      ┃
┃    – 出力は API 経由で利用されるため、過度な装飾を避けること                                                                                    ┃
┃                                                                                                                                                 ┃
┃ 2. 開発者メッセージ                                                                                                                             ┃
┃    – 日本語で質問に答えること                                                                                                                   ┃
┃                                                                                                                                                 ┃
┃ 3. ユーザーメッセージ                                                                                                                           ┃
┃    – 「今までの会話内容を日本語で要約してください」との要望                                                                                     ┃
┃                                                                                                                                                 ┃
┃ 以上です。                                                                                                                                      ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

 

会話履歴

ストレージが有効にされたチームはセッションの実行履歴 (「会話履歴」や「チャット履歴」とも呼ばれます) へのアクセス権を自動的に持ちます。To learn more, see the Conversation History documentation.

​

 

セッション・サマリー

チームはセッションの凝縮された表現をストアできます、これはチャット履歴が長すぎるときに有用です。これは Agno では「セッション・サマリー」と呼称されます。

セッションサマリーを有効にするには、チームで enable_session_summaries=True を設定します。

from agno.agent import Agent
from agno.team import Team
from agno.models.openai import OpenAIChat
from agno.db.sqlite import SqliteDb

db = SqliteDb(db_file="tmp/data.db")

user_id = "jon_hamm@example.com"
session_id = "1001"

team = Team(
    model=OpenAIChat(id='gpt-4.1'),
    members=[
        Agent(name="Agent 1", role="あなたは日本語で回答します"),
        Agent(name="Agent 2", role="You answer questions in Chinese"),
    ],
    db=db,
    enable_session_summaries=True,
)

team.print_response(
    "量子コンピューティングについて、何を教えてくれますか?",
    stream=True,
    user_id=user_id,
    session_id=session_id,
)

team.print_response(
    "LLM についても知りたいです?",
    stream=True,
    user_id=user_id,
    session_id=session_id
)

session_summary = team.get_session_summary(session_id=session_id)
print(f"セッション・サマリー: {session_summary.summary}")

出力例

INFO Agent 'Agent 1' inheriting model from Team: gpt-4.1                                                                                           
INFO Agent 'Agent 2' inheriting model from Team: gpt-4.1                                                                                           
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 量子コンピューティングについて、何を教えてくれますか?                                                                                          ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-1,                                                                                                    ┃
┃   task=量子コンピューティングについて詳しく説明してください。基礎原理、動作の仕組み、特徴、応用分野、現在の課題などもわかりやすく日本語でまとめ ┃
┃ てください。)                                                                                                                                   ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (45.8s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 量子コンピューティングについて、以下のポイントで解説します:                                                                                    ┃
┃                                                                                                                                                 ┃
┃ ---                                                                                                                                             ┃
┃                                                                                                                                                 ┃
┃ 1. 基本原理:                                                                                                                                   ┃
┃ 量子コンピュータは「量子力学」の法則を利用し、「量子ビット(qubit)」を用いて情報を処理します。量子ビットは、0と1の「重ね合わせ」や「量子もつれ ┃
┃ 」といった特徴を持ち、同時に複数の状態を表現できます。                                                                                          ┃
┃                                                                                                                                                 ┃
┃ 2. 仕組み:                                                                                                                                     ┃
┃ 量子ビットに量子ゲートを使って操作を行い、計算を進めます。計算の最後に測定し、結果を得ます。並列的に膨大な情報を一度に扱えるのが利点です。      ┃
┃                                                                                                                                                 ┃
┃ 3. 特徴:                                                                                                                                       ┃
┃ - 重ね合わせやもつれにより、並列的な計算が可能                                                                                                  ┃
┃ - 特定の問題(例えば素因数分解等)で大きなスピードアップが期待できる                                                                            ┃
┃                                                                                                                                                 ┃
┃ 4. 主な応用分野:                                                                                                                               ┃
┃ - 暗号解読                                                                                                                                      ┃
┃ - 新素材や新薬の分子シミュレーション                                                                                                            ┃
┃ - 複雑な最適化問題                                                                                                                              ┃
┃ - AIや機械学習の高速化 など                                                                                                                     ┃
┃                                                                                                                                                 ┃
┃ 5. 現在の課題:                                                                                                                                 ┃
┃ - エラーに弱く、環境ノイズにとても敏感(安定したキュービットの作成が課題)                                                                      ┃
┃ - 大規模な量子計算のための技術やハードウェアが未完成                                                                                            ┃
┃ - 誰でも使えるには時間と研究の進展が必要                                                                                                        ┃
┃                                                                                                                                                 ┃
┃ ---                                                                                                                                             ┃
┃                                                                                                                                                 ┃
┃ 量子コンピュータは、古典的なコンピュータとは仕組みも考え方も大きく異なり、今後の科学や社会に変革をもたらす可能性を持った新しい技術領域です。    ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ LLM についても知りたいです?                                                                                                                    ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Team Tool Calls ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ • delegate_task_to_member(member_id=agent-1,                                                                                                    ┃
┃ task=LLM(大規模言語モデル)について、日本語で概要、仕組み、特徴、主な用途と課題について分かりやすく説明してください。)                         ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (25.2s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ LLM(大規模言語モデル)について日本語でご説明します。                                                                                           ┃
┃                                                                                                                                                 ┃
┃ ---                                                                                                                                             ┃
┃                                                                                                                                                 ┃
┃ 1. 概要                                                                                                                                         ┃
┃ LLM(Large Language                                                                                                                             ┃
┃ Model)は、大量のテキストデータを使って訓練されたAIモデルで、人間のように自然な文章を生成したり、質問に答えたりすることができます。ChatGPTやBER ┃
┃ T、PaLMといったモデルがその例です。                                                                                                             ┃
┃                                                                                                                                                 ┃
┃ 2. 仕組み                                                                                                                                       ┃
┃ 主にディープラーニングの「トランスフォーマー」技術を用いています。たくさんの文章データから次に来る単語や文脈を推測し、意味の通った文章を作り出  ┃
┃ す能力を持っています。                                                                                                                          ┃
┃                                                                                                                                                 ┃
┃ 3. 特徴                                                                                                                                         ┃
┃ - 自然で多様な文章生成が可能                                                                                                                    ┃
┃ - さまざまな言語タスク(翻訳、要約、質問応答など)ができる                                                                                      ┃
┃ - 大規模な計算データ・リソースが必要                                                                                                            ┃
┃                                                                                                                                                 ┃
┃ 4. 主な用途                                                                                                                                     ┃
┃ - チャットボットやカスタマーサポート                                                                                                            ┃
┃ - 自動記事生成や文章要約                                                                                                                        ┃
┃ - プログラミング補助や翻訳                                                                                                                      ┃
┃ - 情報検索や学習アシスタント                                                                                                                    ┃
┃                                                                                                                                                 ┃
┃ 5. 課題                                                                                                                                         ┃
┃ - 間違った情報やデマを自信たっぷりに話すことがある                                                                                              ┃
┃ - バイアスや偏見のある発言をする場合がある                                                                                                      ┃
┃ - プライバシーや著作権への配慮が必要                                                                                                            ┃
┃ - なぜその回答になるか分かりにくい(ブラックボックス問題)                                                                                      ┃
┃                                                                                                                                                 ┃
┃ ---                                                                                                                                             ┃
┃                                                                                                                                                 ┃
┃ LLMは便利ですが、正しく使いこなすためには、その仕組みや課題についても理解することが大切です。                                                   ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
セッション・サマリー: The user asked for comprehensive explanations of quantum computing and large language models (LLMs), including their principles, mechanisms, features, applications, and challenges. The assistant provided detailed answers in both English and Japanese, covering foundational concepts, operational mechanisms, comparisons to classical models, practical usage areas, and current research or technical limitations for both topics.

 

セッション・サマリーのカスタマイズ

カスタム session_summary_prompt をチームに提供することで、セッション・サマリーを調整できます。

SessionSummaryManager クラスは、セッション・サマリーの作成と更新に使用されるモデルの処理を担当します。これを調整して、サマリーが作成・更新される方法をパーソナライズできます :

from agno.team import Team
from agno.session import SessionSummaryManager
from agno.models.openai import OpenAIChat
from agno.db.sqlite import SqliteDb

# Setup your database
db = SqliteDb(db_file="agno.db")

# Setup your Session Summary Manager, to adjust how summaries are created
session_summary_manager = SessionSummaryManager(
    # Select the model used for session summary creation and updates. If not specified, the agent's model is used by default.
    model=OpenAIChat(id="gpt-5-nano"),
    # You can also overwrite the prompt used for session summary creation
    session_summary_prompt="Create a very succinct summary of the following conversation:",
)

# Now provide the adjusted Memory Manager to your Agent
team = Team(
  members=[],
  db=db,
  session_summary_manager=session_summary_manager,
  enable_session_summaries=True,
)

team.print_response("光の速さとは何ですか?", stream=True)

session_summary = team.get_session_summary()
print(f"Session summary: {session_summary.summary}")

出力例

INFO Setting default model to OpenAI Chat                                                                                                          
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 光の速さとは何ですか?                                                                                                                          ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━ Response (14.1s) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                 ┃
┃ 光の速さとは、電磁波である光が真空中を伝わる速度のことを指します。光の速さは物理学において非常に重要な定数であり、その値は約299,792,458メートル ┃
┃ 毎秒(m/s)とされています。通常、秒速約30万キロメートルと概算されます。この速度は、時間と空間の特性を記述する際の基礎となるものであり、アルベル ┃
┃ ト・アインシュタインの特殊相対性理論をはじめとする多くの物理理論において中心的な役割を果たしています。光の速さは不変であり、真空中では常にこの  ┃
┃ 値を取るとされています。                                                                                                                        ┃
┃                                                                                                                                                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Session summary: User asked what the speed of light is; the assistant stated it is the vacuum speed of light, about 299,792,458 m/s (roughly 300,000 km/s), and noted its role as a fundamental, invariant constant central to physics and relativity.

 

以上





クラスキャット

最近の投稿

  • Agno 2.x : チーム – チーム・セッション
  • Agno 2.x : チーム – 会話履歴
  • Agno 2.x : チーム – チームメンバーへのタスクの委任
  • Agno 2.x : チーム – チームの実行
  • Agno 2.x : チーム – 概要 & チームの構築

タグ

AG2 (14) Agno (46) Agno 2.x (18) AutoGen (13) ClassCat Press Release (20) ClassCat TF/ONNX Hub (11) DGL 0.5 (14) Edward (17) FLUX.1 (16) Gemini (20) HuggingFace Transformers 4.5 (10) 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) LangChain v1.0 (10) LangGraph (24) LangGraph 0.5 (9) MediaPipe 0.8 (11) Model Context Protocol (16) NNI 1.5 (16) 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 Probability (9) TensorFlow Programmer's Guide (22) TensorFlow Release Note (18) TensorFlow Tutorials (33) TF-Agents 0.4 (11)
2025年11月
月 火 水 木 金 土 日
 12
3456789
10111213141516
17181920212223
24252627282930
« 10月    
© 2025 ClassCat® AI Research | Powered by Minimalist Blog WordPress Theme