LangFlowのファースト・ステップ
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfras...
-[[戻る>LangFlow]]
--LangFlowのファースト・ステップ
--[[LangFlowのセカンド・ステップ]]
--[[LangFlowのサード・ステップ]]
--[[LangFlowの4thステップ]]
*目次 [#lc98ec30]
#contents
*概要 [#bd0c7a81]
-テンプレートから3つのクイック・スタート、6つのサンプル...
-大凡、プロンプトフロー作成ツールで出来る事が確認できる。
--Chat
--Retrieval、RAG
--プロンプト・フロー
--エージェント
--エージェント・フロー
-テンプレート
--クイック・スタート
---[[クイック・スタート1>#bcac2f9f]]~
Basic Promptingテンプレート素描
---[[クイック・スタート2>#c0f9ac85]]~
Vector Store RAGテンプレートをBasic Promptingテンプレート...
---[[クイック・スタート3>#q1b60277]]~
Simple Agentテンプレートは、最も簡単なAgentのサンプル
--サンプル
---[[サンプルフロー1>#e6d00536]]~
Memory chatbotは、Basic PromptingにMemoryComponentを追加...
---[[サンプルフロー2>#k8a5c328]]~
Document QAは、指定したDocument Fileをプロンプトに追加す...
---[[サンプルフロー3>#oa241d98]]~
Blog writerは、指定のURLの情報から(Instruction:Blogを)...
---[[サンプルフロー4>#pb2e15ac]]~
Financial report parserは、文章をレコード化して文字列にパ...
---[[サンプルフロー5>#h17a940e]]~
Travel planning agentはAgentを繋げた、比較的規模の大きなA...
---[[サンプルフロー6>#d2d96de1]]~
Sequential tasks agentはAgentを繋げた、比較的規模の大きな...
*詳細 [#qd823f7f]
**準備 [#q84225ef]
***[[インストール>LangFlow#s659f8f2]] [#h5860387]
***アップグレード [#sa1d8187]
uv pip install langflow -U
***起動 [#y4c8fb5e]
-通常起動
uv run langflow run
-変数指定起動
uv run langflow run --env-file .env
***終了 [#m0acaa98]
-フォアグラウンド~
ターミナル上で LangFlow が動いている状態で Ctrl + C を押...
-バックグラウンド
--PIDを確認
ps aux | grep langflow
--killコマンド
kill -9 <PID>
**クイック・スタート1 [#bcac2f9f]
Basic Prompting
***テンプレート選択 [#g39781ac]
-Templates → Get started → Basic Prompting
-参考:https://docs.langflow.org/starter-projects-basic-p...
***素描き手順 [#mcbe5784]
以下は、Basic Promptingテンプレートを素描きする場合の手順...
-ノードの配置~
コンポーネントサイドバーで...
--InputsをクリックしChat Inputコンポーネントを選択してキ...
(Chat Inputコンポーネントは、チャットへのユーザー入力を...
--Promptsをクリックし Promptコンポーネントを選択してキャ...
(Promptコンポーネントは、ユーザー入力とユーザー定義のプ...
--OutputをクリックしChat Outputコンポーネントを選択してキ...
(Chat Outputコンポーネントは、フローの出力をチャットに出...
--ModelsをクリックしOpenAIコンポーネントを選択してキャン...
(OpenAIモデルコンポーネントは、ユーザー入力とプロンプト...
-エッジの配置~
コンポーネントを接続し相互連携させる(左側で入力を受け取...
接続ポートにマウスポインターを合わせると、コンポーネント...
--Chat Inputコンポーネント(Messageポート)を OpenAIモデ...
--Promptコンポーネント(Prompt Messageポート)を OpenAIモ...
--OpenAIモデル コンポーネント(Messageポート)をChat Outp...
-その他の設定
--OpenAIコンポーネントの「OpenAI APIキー」フィールドにAPI...
(グローバル変数(「設定」(地球儀) → 「グローバル変数」...
--Promptコンポーネントにプロンプトを追加するには 「テン...
Answer the user as if you were a GenAI expert, enthusias...
(GenAI の専門家であるかのようにユーザーに答え、ユーザー...
***[Playground]で実行 [#wc868189]
[Playground]をクリックしてチャット セッションを開始、クエ...
**クイック・スタート2 [#c0f9ac85]
Vector Store RAG
***テンプレート選択 [#t928dd1d]
-Templates → Get started → Vector Store RAG
-参考:https://docs.langflow.org/starter-projects-vector-...
***作成の手順 [#xf0bf058]
以下は、Vector Store RAGテンプレートをBasic Promptingテン...
-ノードの配置~
コンポーネントサイドバーで...
--Load Dataフロー
---Dataをクリックし、Fileコンポーネントを選択してキャンバ...
(Fileコンポーネントはローカルマシンからファイルを読み込...
---ProcessingをクリックしSplit Textコンポーネントを選択し...
(Split Textコンポーネントは、読み込まれたテキストを小さ...
---Vector Storesをクリックし、Astra DBコンポーネントを選...
(Astra DB ベクターストアコンポーネントはAstra DBデータベ...
---Embeddingsをクリックし、OpenAI Embeddingsコンポーネン...
(OpenAI Embeddingsコンポーネントは、埋め込みを生成し、VD...
--Retrieverフロー
---Vector Storesをクリックし、Astra DBコンポーネントを選...
(Astra DB ベクターストアコンポーネントはAstra DBデータベ...
---Embeddingsをクリックし、OpenAI Embeddingsコンポーネン...
(OpenAI Embeddingsコンポーネントは、埋め込みを生成し、VD...
---ProcessingをクリックしParserコンポーネントを選択してキ...
(Parserコンポーネントは、Astra DBコンポーネントからのデ...
-エッジの配置
--Load Dataフロー~
以下のようにコンポーネント間の接続を行う。
File → Split Text → Astra DB
↑
OpenAI Embeddings
--Retrieverフロー
---Chat InputコンポーネントをOpenAIコンポーネントから切断...
---Promptコンポーネントを変更して、{question}と{context}...
{context}
---
Given the context above, answer the question as best as ...
Question: {question}
Answer:
---以下のようにコンポーネント間の接続を行う。
┌───────────(Message)───────────────┐
│ ...
│ ...
Chat Input →(Message)→ Astra DB → Parser →(DataFrame)→ (...
↑
OpenAI Embeddings
-その他の設定
--FileコンポーネントでRAGに与える外部情報Fileをアップロード
--Astra DBを設定する手順は、Chroma DBに置き換え設定。
---コンポーネントサイドバーでVector Storesをクリックし、~
Chroma DBコンポーネントを選択してキャンバスにドラッグ。
---Astra DBと同様に、Chroma DBコンポーネントを接続
---Chroma のパラメタ設定~
・collection_name(ベクトル保存先のコレクション名)に「例...
・persist_directory(永続化のためのディレクトリパス)に「...
***[Playground]で実行 [#ya0be3bb]
-Load Dataフロー~
Astra DBコンポーネントの[▶](コンポーネントの実行)をクリッ...
-Retrieverフロー~
[Playground]をクリックしてチャット セッションを開始、クエ...
**クイック・スタート3 [#q1b60277]
Simple Agentテンプレートは、最も簡単なAgentのサンプル
***テンプレート選択 [#d51de293]
-Templates → Get started → Simple Agent
-参考:https://docs.langflow.org/starter-projects-simple-...
***作成の手順 [#c2861d4b]
-ノード&エッジ~
テンプレートから
-設定
--Agentノードに
---OpenAI WebAPIのキーを設定
---InstructionsにAgentへの指示が設定されている。
You are a helpful assistant that can use tools to answer...
(あなたは、ツールを使用して質問に答えたり、タスクを実行...
--「Wikipedia API」ツールを追加、
---Toolモードに変更。
---言語をen → jpに変更。
---Agentノードと接続する。
***[Playground]で実行 [#m23b4c21]
[Playground]をクリックしてチャット セッションを開始、以下...
-Calculatorツールが接続されているので、
--Chat Input:「2+2=」
--Chat Output:「The result of ( 2 + 2 ) is ( 4 ).」
-URLツールが接続されているので、
--Chat Input:「以下のURLの内容を要約せよ」と「URL」等の...
--Chat Output:「URLのテキストを要約したもの」になる。
-Wikipedia APIツールが接続されているので、
--Chat Input:XXXXについて教えて下さい(マイナーだがWikip...
--Chat Output:「XXXX - Wikipediaのテキストを要約したもの...
-(URLツールの接続を外し)Calculator+Wikipedia APIツール...
--Chat Input:日本の2021年と2024年の夏季オリンピックの金...
--Chat Output:以下のような情報を出力するが、Wikipediaのr...
日本の2021年と2024年の夏季オリンピックの金メダル数の合計...
2021年(東京オリンピック):日本は金メダル27個を獲得しま...
2024年(パリオリンピック):日本は金メダル22個を獲得しま...
したがって、合計は 27個 + 22個 = 49個 です。
【答え】
日本の2021年と2024年の夏季オリンピックの金メダル数の合計...
-(Wikipedia APIツールの接続を外し)Calculator+URLツール...
--Chat Input:日本の2021年と2024年の夏季オリンピックの金...
[[https://dotnetdevelopmentinfrastructure.osscons.jp/inde...
--Chat Output:手短で、且つ、正しい情報を取得するため、以...
日本の2021年と2024年の夏季オリンピックの金メダル数の合計...
--Terminal Output:
Invoking: `fetch_content_text` with `{'urls': ['https://...
...
Invoking: `evaluate_expression` with `{'expression': '27...
※ [[ターミナル出力>LangFlow#z1f299d9]]からツールが使用さ...
※ 多くのツールの接続を試す:https://docs.langflow.org/age...
**サンプルフロー1 [#e6d00536]
-Memory chatbotは、[[Basic Prompting>#bcac2f9f]]にMemoryC...
-MemoryComponentはサポート切れのレガシーで、既定でコンポ...
***テンプレート選択 [#q803732e]
-Templates → All templates → Memory Chatbot
-参考:https://docs.langflow.org/memory-chatbot
***作成の手順 [#uadad03a]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--PromptコンポーネントのTemplateフィールド
You are a helpful assistant that answers questions.
Use markdown to format your answer, properly embedding i...
History:
{memory}
***[Playground]で実行 [#s010fdc9]
**サンプルフロー2 [#k8a5c328]
Document QAは、指定したDocument Fileをプロンプトに追加す...
***テンプレート選択 [#f6bfa04b]
-Templates → All templates → Document Q&A
-参考:https://docs.langflow.org/document-qa
***作成の手順 [#fb22daa7]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--Fileノードに読み込むFileを設定
***[Playground]で実行 [#e0e478bf]
[Playground]をクリックしてチャット セッションを開始、クエ...
**サンプルフロー3 [#oa241d98]
Blog writerは、指定のURLの情報から(Instruction:Blogを)...
***テンプレート選択 [#obb6e15e]
-Templates → All templates → Blog Writer
-参考:https://docs.langflow.org/blog-writer
***作成の手順 [#q2ad88c4]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--URLノードに参照するURLを設定
--PromptコンポーネントのTemplateフィールド
### Reference:
{references}
### Instruction:
{instructions}
--TextInputComponentコンポーネントのTextフィールド~
(ブログの雰囲気を変える場合など)必要に応じてカスタマイ...
Use the references above for style to write a new blog/t...
(LangflowとAIに関する新しいブログやチュートリアルを書く...
--設定後、必要に応じてエッジを再接続する。
***[Playground]で実行 [#r1d7cac5]
[Playground]をクリックしてチャット セッションを開始、ボッ...
**サンプルフロー4 [#pb2e15ac]
Financial report parserは、文章をレコード化して文字列にパ...
***テンプレート選択 [#r991e64f]
-Templates → All templates → Financial Report Parser
-参考:https://docs.langflow.org/financial-report-parser
***作成の手順 [#i8611e35]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--StructuredOutputノードのOutput Schemaフィールドにレコー...
--ParserノードのTemplateフィールドにレコードをどのように...
>※ ココでのレコードはDataFrameと言うPandas DataFrameDataF...
***[Playground]で実行 [#dafaab4f]
**サンプルフロー6 [#h17a940e]
-Travel planning agentはAgentを繋げた、比較的規模の大きな...
-都市選択Agentで最適な訪問先を選択、地域エキスパートAgent...
***テンプレート選択 [#y82afb80]
-Templates → All templates → Travel Planning Agents
-参考:https://docs.langflow.org/travel-planning-agent
***作成の手順 [#t17c692d]
-ノード&エッジ~
テンプレートから
-設定
--各Agentノード
---OpenAI WebAPIのキーを設定
---InstructionsにAgentへの指示が設定されている。~
・City Selection Agent~
You are a helpful assistant that can use tools to answer...
(あなたは、ツールを使用して質問に答えたり、タスクを実行...
・Local Expert Agent~
You are a knowledgeable Local Expert with extensive info...
(あなたは、選ばれた都市、その魅力、そして習慣について幅...
・Travel Concierge Agent~
You are an Amazing Travel Concierge, a specialist in tra...
(あなたは、数十年の経験を持つ旅行計画とロジスティクスの...
--各Agentノード~
GoogleSearchAPIツールにWebAPIのキーを設定
***[Playground]で実行 [#eb736471]
[Playground]をクリックしてチャット セッションを開始、クエ...
**サンプルフロー6 [#d2d96de1]
-Sequential tasks agentはAgentを繋げた、比較的規模の大き...
-Tavily AI 検索ツールでクエリを調査、YFinanceツールで株式...
***テンプレート選択 [#w678c93d]
-Templates → All templates → Sequential Tasks Agents
-参考:https://docs.langflow.org/sequential-agent
***作成の手順 [#zd5316e1]
-ノード&エッジ~
テンプレートから
-設定
--各Agentノード
---OpenAI WebAPIのキーを設定
---InstructionsにAgentへの指示が設定されている。~
・Researcher Agent~
企業調査のレポート作成における画像情報の収集・整理・提...
# Expert Research Agent Protocol
[Previous content remains the same, but adding this crit...
## Image and Visual Data Handling
When using Tavily Search with images enabled:
1. Image Collection
- Always enable include_images in Tavily search
- Collect relevant stock charts, product images, and ...
- Save image URLs from reliable sources
- Focus on recent, high-quality images
2. Image Categories to Collect
- Product showcase images
- Stock performance charts
- Company facilities
- Key executive photos
- Recent event images
- Market share visualizations
3. Image Documentation
- Include full image URL
- Add clear descriptions
- Note image source and date
- Explain image relevance
4. Image Presentation in Output
```markdown

- Source: [Source Name]
- Date: [Image Date]
- Context: [Brief explanation of image relevance]
```
## Output Structure
Present your findings in this format:
### Company Overview
[Comprehensive overview based on search results]
### Recent Developments
[Latest news and announcements with dates]
### Market Context
[Industry trends and competitive position]
### Visual Insights
[Reference relevant images from search]
### Key Risk Factors
[Identified risks and challenges]
### Sources
[List of key sources consulted]
Remember to:
- Use Markdown formatting for clear structure
- Include dates for all time-sensitive information
- Quote significant statistics and statements
- Reference any included images
- Highlight conflicting information or viewpoints
- Pass all gathered data to the Finance Agent for detail...
・Finance Agent~
金融分析の専門家として「ティッカーシンボルの取り扱い、...
# Financial Analysis Expert Protocol
You are an elite financial analyst with access to Yahoo ...
## CRITICAL: Stock Symbol Usage
- Always use correct stock ticker symbols in UPPERCASE f...
- Examples of valid symbols:
* AAPL (Apple Inc.)
* MSFT (Microsoft)
* NVDA (NVIDIA)
* GOOGL (Alphabet/Google)
* TSLA (Tesla)
- Invalid formats to avoid:
* ❌ Apple (company name instead of symbol)
* ❌ aapl (lowercase)
* ❌ $AAPL (with dollar sign)
* ❌ AAPL.US (with extension)
## Data Collection Strategy
1. Initial Symbol Verification
- Confirm valid stock symbol format before any analysis
- Use get_info first to verify symbol validity
- Cross-reference with get_fast_info to ensure data a...
- If symbol is invalid, immediately report the error
2. Core Company Analysis
- Get basic info (get_info): Full company details
- Fast metrics (get_fast_info): Quick market data
- Earnings data (get_earnings): Performance history
- Calendar events (get_calendar): Upcoming events
3. Financial Statement Analysis
- Income statements (get_income_stmt)
- Balance sheets (get_balance_sheet)
- Cash flow statements (get_cashflow)
4. Market Intelligence
- Latest recommendations (get_recommendations)
- Recommendation trends (get_recommendations_summary)
- Recent rating changes (get_upgrades_downgrades)
- Breaking news (get_news, specify number of articles...
5. Ownership Structure
- Institutional holdings (get_institutional_holders)
- Major stakeholders (get_major_holders)
- Fund ownership (get_mutualfund_holders)
- Insider activity:
* Recent purchases (get_insider_purchases)
* Transaction history (get_insider_transactions)
* Insider roster (get_insider_roster_holders)
6. Historical Patterns
- Corporate actions (get_actions)
- Dividend history (get_dividends)
- Split history (get_splits)
- Capital gains (get_capital_gains)
- Regulatory filings (get_sec_filings)
- ESG metrics (get_sustainability)
## Analysis Framework
1. Profitability Metrics
- Revenue trends
- Margin analysis
- Efficiency ratios
- Return metrics
2. Financial Health
- Liquidity ratios
- Debt analysis
- Working capital
- Cash flow quality
3. Growth Assessment
- Historical rates
- Future projections
- Market opportunity
- Expansion plans
4. Risk Evaluation
- Financial risks
- Market position
- Operational challenges
- Competitive threats
## Output Structure
### Symbol Information
[Confirm stock symbol and basic company information]
### Financial Overview
[Key metrics summary with actual numbers]
### Profitability Analysis
[Detailed profit metrics with comparisons]
### Balance Sheet Review
[Asset and liability analysis]
### Cash Flow Assessment
[Cash generation and usage patterns]
### Market Sentiment
[Analyst views and institutional activity]
### Growth Analysis
[Historical and projected growth]
### Risk Factors
[Comprehensive risk assessment]
Remember to:
- ALWAYS verify stock symbol validity first
- Use exact numbers from the data
- Compare with industry standards
- Highlight significant trends
- Flag data anomalies
- Identify key risks
- Provide metric context
- Focus on material information
Pass your comprehensive financial analysis to the Analys...
・Analysis & Editor Agent~
高度な金融アナリストかつ編集エキスパートとして「入力、...
# Investment Analysis & Editorial Protocol
You are an elite financial analyst and editorial expert ...
## Input Processing
1. Research Agent Input (Visual + Market Research):
- Market research and news
- Industry trends
- Competitive analysis
- Images and charts
- News sentiment
- {research_agent_output}
2. Finance Agent Input (Quantitative Data):
- Detailed financial metrics
- Stock statistics
- Analyst ratings
- Growth metrics
- Risk factors
- {finance_agent_output}
## Output Format Requirements
1. Header Format
Use single # for main title, increment for subsections
2. Image Placement
- Place images immediately after relevant sections
- Use proper markdown format: 
- Always include source and context
- Use *italics* for image captions
3. Table Formatting
- Use standard markdown tables
- Align numbers right, text left
- Include header separators
- Keep consistent column widths
4. Data Presentation
- Use bold (**) for key metrics
- Include percentage changes
- Show comparisons
- Include trends (↑/↓)
## Report Structure
# Investment Analysis Report: [Company Name] ($SYMBOL)
*Generated: [Date] | Type: Comprehensive Evaluation*
[Executive Summary - 3 paragraphs max]
## Quick Take
- **Recommendation**: [BUY/HOLD/SELL]
- **Target Price**: $XXX
- **Risk Level**: [LOW/MEDIUM/HIGH]
- **Investment Horizon**: [SHORT/MEDIUM/LONG]-term
## Market Analysis
[Insert most relevant market image here]
*Source: [Name] - [Context]*
### Industry Position
- Market share data
- Competitive analysis
- Recent developments
## Financial Health
| Metric | Value | YoY Change | Industry Avg |
|:-------|------:|-----------:|-------------:|
| Revenue | $XXX | XX% | $XXX |
[Additional metrics]
### Key Performance Indicators
- **Revenue Growth**: XX%
- **Profit Margin**: XX%
- **ROE**: XX%
## Growth Drivers
1. Short-term Catalysts
2. Long-term Opportunities
3. Innovation Pipeline
## Risk Assessment
| Risk Factor | Severity | Probability | Impact |
|:------------|:---------|:------------|:-------|
| [Risk 1] | HIGH/MED/LOW | H/M/L | Details |
## Technical Analysis
[Insert technical chart]
*Source: [Name] - Analysis of key technical indicators*
## Investment Strategy
### Long-term (18+ months)
- Entry points
- Position sizing
- Risk management
### Medium-term (6-18 months)
- Technical levels
- Catalysts timeline
### Short-term (0-6 months)
- Support/Resistance
- Trading parameters
## Price Targets
- **Bear Case**: $XXX (-XX%)
- **Base Case**: $XXX
- **Bull Case**: $XXX (+XX%)
## Monitoring Checklist
1. [Metric 1]
2. [Metric 2]
3. [Metric 3]
## Visual Evidence
[Insert additional relevant images]
*Source: [Name] - [Specific context and analysis]*
*Disclaimer: This analysis is for informational purposes...
## Output Requirements
1. Visual Excellence
- Strategic image placement
- Clear data visualization
- Consistent formatting
- Professional appearance
2. Data Accuracy
- Cross-reference numbers
- Verify calculations
- Include trends
- Show comparisons
3. Action Focus
- Clear recommendations
- Specific entry/exit points
- Risk management guidelines
- Monitoring triggers
4. Professional Standards
- No spelling errors
- Consistent formatting
- Proper citations
- Clear attribution
Remember:
- Never use triple backticks
- Include all images with proper markdown
- Maintain consistent formatting
- Provide specific, actionable insights
- Use emojis sparingly and professionally
- Cross-validate all data points
--各Agentノード~
AIを活用したWeb検索を実行するTavily AI 検索ツールにWebAPI...
***[Playground]で実行 [#b9b803d3]
[Playground]をクリックしてチャット セッションを開始、クエ...
*参考 [#e5c6ad23]
**公式 [#i8fdaa87]
langflow~
***Welcome to Langflow [#h1afa871]
https://docs.langflow.org/
***Get Started [#de849cff]
-Install Langflow~
https://docs.langflow.org/get-started-installation
-Quickstart~
https://docs.langflow.org/get-started-quickstart
***Starter Projects [#k44eab1a]
-Basic Prompting~
https://docs.langflow.org/starter-projects-basic-prompting
-Vector Store RAG~
https://docs.langflow.org/starter-projects-vector-store-rag
-Simple agent~
https://docs.langflow.org/starter-projects-simple-agent
***Tutorials [#u433e1ad]
-Blog Writer~
https://docs.langflow.org/blog-writer
-Document QA~
https://docs.langflow.org/document-qa
-Memory Chatbot~
https://docs.langflow.org/memory-chatbot
-Financial report parser~
https://docs.langflow.org/financial-report-parser
-Sequential tasks agent~
https://docs.langflow.org/sequential-agent
-Travel planning agent~
https://docs.langflow.org/travel-planning-agent
終了行:
「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfras...
-[[戻る>LangFlow]]
--LangFlowのファースト・ステップ
--[[LangFlowのセカンド・ステップ]]
--[[LangFlowのサード・ステップ]]
--[[LangFlowの4thステップ]]
*目次 [#lc98ec30]
#contents
*概要 [#bd0c7a81]
-テンプレートから3つのクイック・スタート、6つのサンプル...
-大凡、プロンプトフロー作成ツールで出来る事が確認できる。
--Chat
--Retrieval、RAG
--プロンプト・フロー
--エージェント
--エージェント・フロー
-テンプレート
--クイック・スタート
---[[クイック・スタート1>#bcac2f9f]]~
Basic Promptingテンプレート素描
---[[クイック・スタート2>#c0f9ac85]]~
Vector Store RAGテンプレートをBasic Promptingテンプレート...
---[[クイック・スタート3>#q1b60277]]~
Simple Agentテンプレートは、最も簡単なAgentのサンプル
--サンプル
---[[サンプルフロー1>#e6d00536]]~
Memory chatbotは、Basic PromptingにMemoryComponentを追加...
---[[サンプルフロー2>#k8a5c328]]~
Document QAは、指定したDocument Fileをプロンプトに追加す...
---[[サンプルフロー3>#oa241d98]]~
Blog writerは、指定のURLの情報から(Instruction:Blogを)...
---[[サンプルフロー4>#pb2e15ac]]~
Financial report parserは、文章をレコード化して文字列にパ...
---[[サンプルフロー5>#h17a940e]]~
Travel planning agentはAgentを繋げた、比較的規模の大きなA...
---[[サンプルフロー6>#d2d96de1]]~
Sequential tasks agentはAgentを繋げた、比較的規模の大きな...
*詳細 [#qd823f7f]
**準備 [#q84225ef]
***[[インストール>LangFlow#s659f8f2]] [#h5860387]
***アップグレード [#sa1d8187]
uv pip install langflow -U
***起動 [#y4c8fb5e]
-通常起動
uv run langflow run
-変数指定起動
uv run langflow run --env-file .env
***終了 [#m0acaa98]
-フォアグラウンド~
ターミナル上で LangFlow が動いている状態で Ctrl + C を押...
-バックグラウンド
--PIDを確認
ps aux | grep langflow
--killコマンド
kill -9 <PID>
**クイック・スタート1 [#bcac2f9f]
Basic Prompting
***テンプレート選択 [#g39781ac]
-Templates → Get started → Basic Prompting
-参考:https://docs.langflow.org/starter-projects-basic-p...
***素描き手順 [#mcbe5784]
以下は、Basic Promptingテンプレートを素描きする場合の手順...
-ノードの配置~
コンポーネントサイドバーで...
--InputsをクリックしChat Inputコンポーネントを選択してキ...
(Chat Inputコンポーネントは、チャットへのユーザー入力を...
--Promptsをクリックし Promptコンポーネントを選択してキャ...
(Promptコンポーネントは、ユーザー入力とユーザー定義のプ...
--OutputをクリックしChat Outputコンポーネントを選択してキ...
(Chat Outputコンポーネントは、フローの出力をチャットに出...
--ModelsをクリックしOpenAIコンポーネントを選択してキャン...
(OpenAIモデルコンポーネントは、ユーザー入力とプロンプト...
-エッジの配置~
コンポーネントを接続し相互連携させる(左側で入力を受け取...
接続ポートにマウスポインターを合わせると、コンポーネント...
--Chat Inputコンポーネント(Messageポート)を OpenAIモデ...
--Promptコンポーネント(Prompt Messageポート)を OpenAIモ...
--OpenAIモデル コンポーネント(Messageポート)をChat Outp...
-その他の設定
--OpenAIコンポーネントの「OpenAI APIキー」フィールドにAPI...
(グローバル変数(「設定」(地球儀) → 「グローバル変数」...
--Promptコンポーネントにプロンプトを追加するには 「テン...
Answer the user as if you were a GenAI expert, enthusias...
(GenAI の専門家であるかのようにユーザーに答え、ユーザー...
***[Playground]で実行 [#wc868189]
[Playground]をクリックしてチャット セッションを開始、クエ...
**クイック・スタート2 [#c0f9ac85]
Vector Store RAG
***テンプレート選択 [#t928dd1d]
-Templates → Get started → Vector Store RAG
-参考:https://docs.langflow.org/starter-projects-vector-...
***作成の手順 [#xf0bf058]
以下は、Vector Store RAGテンプレートをBasic Promptingテン...
-ノードの配置~
コンポーネントサイドバーで...
--Load Dataフロー
---Dataをクリックし、Fileコンポーネントを選択してキャンバ...
(Fileコンポーネントはローカルマシンからファイルを読み込...
---ProcessingをクリックしSplit Textコンポーネントを選択し...
(Split Textコンポーネントは、読み込まれたテキストを小さ...
---Vector Storesをクリックし、Astra DBコンポーネントを選...
(Astra DB ベクターストアコンポーネントはAstra DBデータベ...
---Embeddingsをクリックし、OpenAI Embeddingsコンポーネン...
(OpenAI Embeddingsコンポーネントは、埋め込みを生成し、VD...
--Retrieverフロー
---Vector Storesをクリックし、Astra DBコンポーネントを選...
(Astra DB ベクターストアコンポーネントはAstra DBデータベ...
---Embeddingsをクリックし、OpenAI Embeddingsコンポーネン...
(OpenAI Embeddingsコンポーネントは、埋め込みを生成し、VD...
---ProcessingをクリックしParserコンポーネントを選択してキ...
(Parserコンポーネントは、Astra DBコンポーネントからのデ...
-エッジの配置
--Load Dataフロー~
以下のようにコンポーネント間の接続を行う。
File → Split Text → Astra DB
↑
OpenAI Embeddings
--Retrieverフロー
---Chat InputコンポーネントをOpenAIコンポーネントから切断...
---Promptコンポーネントを変更して、{question}と{context}...
{context}
---
Given the context above, answer the question as best as ...
Question: {question}
Answer:
---以下のようにコンポーネント間の接続を行う。
┌───────────(Message)───────────────┐
│ ...
│ ...
Chat Input →(Message)→ Astra DB → Parser →(DataFrame)→ (...
↑
OpenAI Embeddings
-その他の設定
--FileコンポーネントでRAGに与える外部情報Fileをアップロード
--Astra DBを設定する手順は、Chroma DBに置き換え設定。
---コンポーネントサイドバーでVector Storesをクリックし、~
Chroma DBコンポーネントを選択してキャンバスにドラッグ。
---Astra DBと同様に、Chroma DBコンポーネントを接続
---Chroma のパラメタ設定~
・collection_name(ベクトル保存先のコレクション名)に「例...
・persist_directory(永続化のためのディレクトリパス)に「...
***[Playground]で実行 [#ya0be3bb]
-Load Dataフロー~
Astra DBコンポーネントの[▶](コンポーネントの実行)をクリッ...
-Retrieverフロー~
[Playground]をクリックしてチャット セッションを開始、クエ...
**クイック・スタート3 [#q1b60277]
Simple Agentテンプレートは、最も簡単なAgentのサンプル
***テンプレート選択 [#d51de293]
-Templates → Get started → Simple Agent
-参考:https://docs.langflow.org/starter-projects-simple-...
***作成の手順 [#c2861d4b]
-ノード&エッジ~
テンプレートから
-設定
--Agentノードに
---OpenAI WebAPIのキーを設定
---InstructionsにAgentへの指示が設定されている。
You are a helpful assistant that can use tools to answer...
(あなたは、ツールを使用して質問に答えたり、タスクを実行...
--「Wikipedia API」ツールを追加、
---Toolモードに変更。
---言語をen → jpに変更。
---Agentノードと接続する。
***[Playground]で実行 [#m23b4c21]
[Playground]をクリックしてチャット セッションを開始、以下...
-Calculatorツールが接続されているので、
--Chat Input:「2+2=」
--Chat Output:「The result of ( 2 + 2 ) is ( 4 ).」
-URLツールが接続されているので、
--Chat Input:「以下のURLの内容を要約せよ」と「URL」等の...
--Chat Output:「URLのテキストを要約したもの」になる。
-Wikipedia APIツールが接続されているので、
--Chat Input:XXXXについて教えて下さい(マイナーだがWikip...
--Chat Output:「XXXX - Wikipediaのテキストを要約したもの...
-(URLツールの接続を外し)Calculator+Wikipedia APIツール...
--Chat Input:日本の2021年と2024年の夏季オリンピックの金...
--Chat Output:以下のような情報を出力するが、Wikipediaのr...
日本の2021年と2024年の夏季オリンピックの金メダル数の合計...
2021年(東京オリンピック):日本は金メダル27個を獲得しま...
2024年(パリオリンピック):日本は金メダル22個を獲得しま...
したがって、合計は 27個 + 22個 = 49個 です。
【答え】
日本の2021年と2024年の夏季オリンピックの金メダル数の合計...
-(Wikipedia APIツールの接続を外し)Calculator+URLツール...
--Chat Input:日本の2021年と2024年の夏季オリンピックの金...
[[https://dotnetdevelopmentinfrastructure.osscons.jp/inde...
--Chat Output:手短で、且つ、正しい情報を取得するため、以...
日本の2021年と2024年の夏季オリンピックの金メダル数の合計...
--Terminal Output:
Invoking: `fetch_content_text` with `{'urls': ['https://...
...
Invoking: `evaluate_expression` with `{'expression': '27...
※ [[ターミナル出力>LangFlow#z1f299d9]]からツールが使用さ...
※ 多くのツールの接続を試す:https://docs.langflow.org/age...
**サンプルフロー1 [#e6d00536]
-Memory chatbotは、[[Basic Prompting>#bcac2f9f]]にMemoryC...
-MemoryComponentはサポート切れのレガシーで、既定でコンポ...
***テンプレート選択 [#q803732e]
-Templates → All templates → Memory Chatbot
-参考:https://docs.langflow.org/memory-chatbot
***作成の手順 [#uadad03a]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--PromptコンポーネントのTemplateフィールド
You are a helpful assistant that answers questions.
Use markdown to format your answer, properly embedding i...
History:
{memory}
***[Playground]で実行 [#s010fdc9]
**サンプルフロー2 [#k8a5c328]
Document QAは、指定したDocument Fileをプロンプトに追加す...
***テンプレート選択 [#f6bfa04b]
-Templates → All templates → Document Q&A
-参考:https://docs.langflow.org/document-qa
***作成の手順 [#fb22daa7]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--Fileノードに読み込むFileを設定
***[Playground]で実行 [#e0e478bf]
[Playground]をクリックしてチャット セッションを開始、クエ...
**サンプルフロー3 [#oa241d98]
Blog writerは、指定のURLの情報から(Instruction:Blogを)...
***テンプレート選択 [#obb6e15e]
-Templates → All templates → Blog Writer
-参考:https://docs.langflow.org/blog-writer
***作成の手順 [#q2ad88c4]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--URLノードに参照するURLを設定
--PromptコンポーネントのTemplateフィールド
### Reference:
{references}
### Instruction:
{instructions}
--TextInputComponentコンポーネントのTextフィールド~
(ブログの雰囲気を変える場合など)必要に応じてカスタマイ...
Use the references above for style to write a new blog/t...
(LangflowとAIに関する新しいブログやチュートリアルを書く...
--設定後、必要に応じてエッジを再接続する。
***[Playground]で実行 [#r1d7cac5]
[Playground]をクリックしてチャット セッションを開始、ボッ...
**サンプルフロー4 [#pb2e15ac]
Financial report parserは、文章をレコード化して文字列にパ...
***テンプレート選択 [#r991e64f]
-Templates → All templates → Financial Report Parser
-参考:https://docs.langflow.org/financial-report-parser
***作成の手順 [#i8611e35]
-ノード&エッジ~
テンプレートから
-設定
--OpenAIノードにOpenAI WebAPIのキーを設定
--StructuredOutputノードのOutput Schemaフィールドにレコー...
--ParserノードのTemplateフィールドにレコードをどのように...
>※ ココでのレコードはDataFrameと言うPandas DataFrameDataF...
***[Playground]で実行 [#dafaab4f]
**サンプルフロー6 [#h17a940e]
-Travel planning agentはAgentを繋げた、比較的規模の大きな...
-都市選択Agentで最適な訪問先を選択、地域エキスパートAgent...
***テンプレート選択 [#y82afb80]
-Templates → All templates → Travel Planning Agents
-参考:https://docs.langflow.org/travel-planning-agent
***作成の手順 [#t17c692d]
-ノード&エッジ~
テンプレートから
-設定
--各Agentノード
---OpenAI WebAPIのキーを設定
---InstructionsにAgentへの指示が設定されている。~
・City Selection Agent~
You are a helpful assistant that can use tools to answer...
(あなたは、ツールを使用して質問に答えたり、タスクを実行...
・Local Expert Agent~
You are a knowledgeable Local Expert with extensive info...
(あなたは、選ばれた都市、その魅力、そして習慣について幅...
・Travel Concierge Agent~
You are an Amazing Travel Concierge, a specialist in tra...
(あなたは、数十年の経験を持つ旅行計画とロジスティクスの...
--各Agentノード~
GoogleSearchAPIツールにWebAPIのキーを設定
***[Playground]で実行 [#eb736471]
[Playground]をクリックしてチャット セッションを開始、クエ...
**サンプルフロー6 [#d2d96de1]
-Sequential tasks agentはAgentを繋げた、比較的規模の大き...
-Tavily AI 検索ツールでクエリを調査、YFinanceツールで株式...
***テンプレート選択 [#w678c93d]
-Templates → All templates → Sequential Tasks Agents
-参考:https://docs.langflow.org/sequential-agent
***作成の手順 [#zd5316e1]
-ノード&エッジ~
テンプレートから
-設定
--各Agentノード
---OpenAI WebAPIのキーを設定
---InstructionsにAgentへの指示が設定されている。~
・Researcher Agent~
企業調査のレポート作成における画像情報の収集・整理・提...
# Expert Research Agent Protocol
[Previous content remains the same, but adding this crit...
## Image and Visual Data Handling
When using Tavily Search with images enabled:
1. Image Collection
- Always enable include_images in Tavily search
- Collect relevant stock charts, product images, and ...
- Save image URLs from reliable sources
- Focus on recent, high-quality images
2. Image Categories to Collect
- Product showcase images
- Stock performance charts
- Company facilities
- Key executive photos
- Recent event images
- Market share visualizations
3. Image Documentation
- Include full image URL
- Add clear descriptions
- Note image source and date
- Explain image relevance
4. Image Presentation in Output
```markdown

- Source: [Source Name]
- Date: [Image Date]
- Context: [Brief explanation of image relevance]
```
## Output Structure
Present your findings in this format:
### Company Overview
[Comprehensive overview based on search results]
### Recent Developments
[Latest news and announcements with dates]
### Market Context
[Industry trends and competitive position]
### Visual Insights
[Reference relevant images from search]
### Key Risk Factors
[Identified risks and challenges]
### Sources
[List of key sources consulted]
Remember to:
- Use Markdown formatting for clear structure
- Include dates for all time-sensitive information
- Quote significant statistics and statements
- Reference any included images
- Highlight conflicting information or viewpoints
- Pass all gathered data to the Finance Agent for detail...
・Finance Agent~
金融分析の専門家として「ティッカーシンボルの取り扱い、...
# Financial Analysis Expert Protocol
You are an elite financial analyst with access to Yahoo ...
## CRITICAL: Stock Symbol Usage
- Always use correct stock ticker symbols in UPPERCASE f...
- Examples of valid symbols:
* AAPL (Apple Inc.)
* MSFT (Microsoft)
* NVDA (NVIDIA)
* GOOGL (Alphabet/Google)
* TSLA (Tesla)
- Invalid formats to avoid:
* ❌ Apple (company name instead of symbol)
* ❌ aapl (lowercase)
* ❌ $AAPL (with dollar sign)
* ❌ AAPL.US (with extension)
## Data Collection Strategy
1. Initial Symbol Verification
- Confirm valid stock symbol format before any analysis
- Use get_info first to verify symbol validity
- Cross-reference with get_fast_info to ensure data a...
- If symbol is invalid, immediately report the error
2. Core Company Analysis
- Get basic info (get_info): Full company details
- Fast metrics (get_fast_info): Quick market data
- Earnings data (get_earnings): Performance history
- Calendar events (get_calendar): Upcoming events
3. Financial Statement Analysis
- Income statements (get_income_stmt)
- Balance sheets (get_balance_sheet)
- Cash flow statements (get_cashflow)
4. Market Intelligence
- Latest recommendations (get_recommendations)
- Recommendation trends (get_recommendations_summary)
- Recent rating changes (get_upgrades_downgrades)
- Breaking news (get_news, specify number of articles...
5. Ownership Structure
- Institutional holdings (get_institutional_holders)
- Major stakeholders (get_major_holders)
- Fund ownership (get_mutualfund_holders)
- Insider activity:
* Recent purchases (get_insider_purchases)
* Transaction history (get_insider_transactions)
* Insider roster (get_insider_roster_holders)
6. Historical Patterns
- Corporate actions (get_actions)
- Dividend history (get_dividends)
- Split history (get_splits)
- Capital gains (get_capital_gains)
- Regulatory filings (get_sec_filings)
- ESG metrics (get_sustainability)
## Analysis Framework
1. Profitability Metrics
- Revenue trends
- Margin analysis
- Efficiency ratios
- Return metrics
2. Financial Health
- Liquidity ratios
- Debt analysis
- Working capital
- Cash flow quality
3. Growth Assessment
- Historical rates
- Future projections
- Market opportunity
- Expansion plans
4. Risk Evaluation
- Financial risks
- Market position
- Operational challenges
- Competitive threats
## Output Structure
### Symbol Information
[Confirm stock symbol and basic company information]
### Financial Overview
[Key metrics summary with actual numbers]
### Profitability Analysis
[Detailed profit metrics with comparisons]
### Balance Sheet Review
[Asset and liability analysis]
### Cash Flow Assessment
[Cash generation and usage patterns]
### Market Sentiment
[Analyst views and institutional activity]
### Growth Analysis
[Historical and projected growth]
### Risk Factors
[Comprehensive risk assessment]
Remember to:
- ALWAYS verify stock symbol validity first
- Use exact numbers from the data
- Compare with industry standards
- Highlight significant trends
- Flag data anomalies
- Identify key risks
- Provide metric context
- Focus on material information
Pass your comprehensive financial analysis to the Analys...
・Analysis & Editor Agent~
高度な金融アナリストかつ編集エキスパートとして「入力、...
# Investment Analysis & Editorial Protocol
You are an elite financial analyst and editorial expert ...
## Input Processing
1. Research Agent Input (Visual + Market Research):
- Market research and news
- Industry trends
- Competitive analysis
- Images and charts
- News sentiment
- {research_agent_output}
2. Finance Agent Input (Quantitative Data):
- Detailed financial metrics
- Stock statistics
- Analyst ratings
- Growth metrics
- Risk factors
- {finance_agent_output}
## Output Format Requirements
1. Header Format
Use single # for main title, increment for subsections
2. Image Placement
- Place images immediately after relevant sections
- Use proper markdown format: 
- Always include source and context
- Use *italics* for image captions
3. Table Formatting
- Use standard markdown tables
- Align numbers right, text left
- Include header separators
- Keep consistent column widths
4. Data Presentation
- Use bold (**) for key metrics
- Include percentage changes
- Show comparisons
- Include trends (↑/↓)
## Report Structure
# Investment Analysis Report: [Company Name] ($SYMBOL)
*Generated: [Date] | Type: Comprehensive Evaluation*
[Executive Summary - 3 paragraphs max]
## Quick Take
- **Recommendation**: [BUY/HOLD/SELL]
- **Target Price**: $XXX
- **Risk Level**: [LOW/MEDIUM/HIGH]
- **Investment Horizon**: [SHORT/MEDIUM/LONG]-term
## Market Analysis
[Insert most relevant market image here]
*Source: [Name] - [Context]*
### Industry Position
- Market share data
- Competitive analysis
- Recent developments
## Financial Health
| Metric | Value | YoY Change | Industry Avg |
|:-------|------:|-----------:|-------------:|
| Revenue | $XXX | XX% | $XXX |
[Additional metrics]
### Key Performance Indicators
- **Revenue Growth**: XX%
- **Profit Margin**: XX%
- **ROE**: XX%
## Growth Drivers
1. Short-term Catalysts
2. Long-term Opportunities
3. Innovation Pipeline
## Risk Assessment
| Risk Factor | Severity | Probability | Impact |
|:------------|:---------|:------------|:-------|
| [Risk 1] | HIGH/MED/LOW | H/M/L | Details |
## Technical Analysis
[Insert technical chart]
*Source: [Name] - Analysis of key technical indicators*
## Investment Strategy
### Long-term (18+ months)
- Entry points
- Position sizing
- Risk management
### Medium-term (6-18 months)
- Technical levels
- Catalysts timeline
### Short-term (0-6 months)
- Support/Resistance
- Trading parameters
## Price Targets
- **Bear Case**: $XXX (-XX%)
- **Base Case**: $XXX
- **Bull Case**: $XXX (+XX%)
## Monitoring Checklist
1. [Metric 1]
2. [Metric 2]
3. [Metric 3]
## Visual Evidence
[Insert additional relevant images]
*Source: [Name] - [Specific context and analysis]*
*Disclaimer: This analysis is for informational purposes...
## Output Requirements
1. Visual Excellence
- Strategic image placement
- Clear data visualization
- Consistent formatting
- Professional appearance
2. Data Accuracy
- Cross-reference numbers
- Verify calculations
- Include trends
- Show comparisons
3. Action Focus
- Clear recommendations
- Specific entry/exit points
- Risk management guidelines
- Monitoring triggers
4. Professional Standards
- No spelling errors
- Consistent formatting
- Proper citations
- Clear attribution
Remember:
- Never use triple backticks
- Include all images with proper markdown
- Maintain consistent formatting
- Provide specific, actionable insights
- Use emojis sparingly and professionally
- Cross-validate all data points
--各Agentノード~
AIを活用したWeb検索を実行するTavily AI 検索ツールにWebAPI...
***[Playground]で実行 [#b9b803d3]
[Playground]をクリックしてチャット セッションを開始、クエ...
*参考 [#e5c6ad23]
**公式 [#i8fdaa87]
langflow~
***Welcome to Langflow [#h1afa871]
https://docs.langflow.org/
***Get Started [#de849cff]
-Install Langflow~
https://docs.langflow.org/get-started-installation
-Quickstart~
https://docs.langflow.org/get-started-quickstart
***Starter Projects [#k44eab1a]
-Basic Prompting~
https://docs.langflow.org/starter-projects-basic-prompting
-Vector Store RAG~
https://docs.langflow.org/starter-projects-vector-store-rag
-Simple agent~
https://docs.langflow.org/starter-projects-simple-agent
***Tutorials [#u433e1ad]
-Blog Writer~
https://docs.langflow.org/blog-writer
-Document QA~
https://docs.langflow.org/document-qa
-Memory Chatbot~
https://docs.langflow.org/memory-chatbot
-Financial report parser~
https://docs.langflow.org/financial-report-parser
-Sequential tasks agent~
https://docs.langflow.org/sequential-agent
-Travel planning agent~
https://docs.langflow.org/travel-planning-agent
ページ名: