Metadata Filter Extraction With 2 CoT Examples

Metadata filter extraction with 2 CoT examples

T
tcd
·May 3, 2026·
247 1 147
$6.99
Prompt
373 words

Your goal is to structure the user's query to match the request schema provided below.

When responding use a markdown code snippet with a JSON object formatted in the following schema:

{schema_str}

The query string should contain only text that is expected to match the contents of documents. Any conditions in the filter should not be mentioned in the query as well.

Restrictions

  • Make sure that filters only refer to attributes that exist in the data source.
  • Make sure that filters take into account the descriptions of attributes.
  • MAKE SURE THAT FILTERS ARE ONLY USED AS NEEDED. IF THERE - ARE NO FILTERS THAT SHOULD BE APPLIED RETURN [] FOR THE FILTER VALUE.
  • Do NOT EVER infer a null value for a filter. This will break the downstream program. Instead, don't include the filter.
  • If more than one value will be used for one filter do not use multiple == for the same filter key. For example use ...⟨"key": "report_quarter", "value": ["Q1", "Q2"], "operator": "in"⟩.... DO NOT USE ...⟨"key": "report_quarter", "value" Q1, "operator": "=="⟩, ⟨"key": "report_quarter", "value" Q2, "operator": "=="⟩...

Data Source:

⟨
    "metadata_info": [
       {{
           "name"="trading_symbol",
           "description"="Four character trading symbol of the company. AAPL for Apple, AMZN for Amazon, INTC for Intel, MSFT for Microsoft, and NVDA for Nvidia",
           "type"="string",
       ⟩,
       ⟨
            "name"="report_year",
           "description"="Creation year of the document.",
           "type"="string",
       ⟩,
       ⟨
            "name"="report_quarter",
            "description"="Creation quarter of the document. Only can be one of Q1, Q2, or Q3",
           "type"="string",
       ⟩,
    ],
    "content_info": "SEC FORM-10Q Documents"
}}

User Query: In Amazon's Q2 2023 10-Q, how does the discussion on employee compensation and benefits in the human resources section relate to the reported financial expenses?

Additional Instructions: If one of the filters is 'trading_symbol', please make sure that all letters of the inferred value is capitalized. Only words that are capitalized are valid values for "trading_symbol".

Structured Request:

⟨
    "query": "Discussion on employee compensation and benefits in the human resources section relate to the reported financial expenses",
     "filters": [
          {{"key": "trading_symbol", "value": "AMZN", "operator": "=="⟩,
          ⟨"key": "report_year", "value": "2023", "operator": "=="⟩,
          ⟨"key": "report_quarter", "value" Q2, "operator": "=="⟩
     ],
}}

Data Source:

{info_str}

User Query: {query_str}

Additional Instructions: {additional_instructions}

Structured Request:

This prompt contains variables shown as ⟨variable_name⟩. Replace them with your own values before using.

How to Use

Use with LangChain: hub.pull("tcd/metadata-filterer")

Need help?

Connect with verified experts who can help you succeed.

Related Prompts

More prompts in Creative & Design

View All
Creative & Design
Midjourney

Midjourney Prompt Generator

Outputs four extremely detailed midjourney prompts for your keyword.

·
· kenny · 3 years ago$6.99
1,755,666 2,783,616
Creative & Design
ChatGPT

Convert Your Small And Lazy Prompt Into A Detailed And Better Prompts With This Template.

Convert your small and lazy prompt into a detailed and better prompts with this template.

H
hardkothari$4.99
209,414 107,942
Creative & Design
Universal

One Click Personalized Workout and Diet Plan

With just one click, create a personalized diet and exercise plan. Just enter the information.

V
Vishal Keshria$4.99
13,911 13,924
Creative & Design
Universal

learning new skill

Looking to learn or improve a specific skill but have no prior experience? Here's a 30-day learning plan designed specifically for beginners like you. Whether you're interested in coding, cooking, photography, or anything in between, this plan will help you build a solid foundation and make steady progress towards your goal. Each day, you'll have a specific task or activity to complete, ranging from watching instructional videos to practising hands-on exercises. The plan is designed to gradually increase in complexity as you build your knowledge and skills, so you can start with the basics and steadily work your way up. By the end of the 30 days, you should have a solid understanding of the fundamentals of your chosen skill, as well as a set of practical techniques and strategies to help you continue improving in the future. So, whether you're looking to learn a new hobby or develop a new professional skill, this 30-day learning plan is the perfect place to start.

M
Marwan UsamaFree
2,090 2,100
Creative & Design
Universal

FitnessGPT v2: One-Click Personal Trainer

An upgraded version of DigitalJeff's original 'One Click Personal Trainer' prompt.

C
Chase Curtis$4.99
6,241 6,268
Creative & Design
Universal

MoneyMindGPT - Your AI-Powered Personal Financial Advisor

MoneyMindGPT is an AI-powered financial advisor that offers personalized guidance to improve your financial health. It helps you with budgeting, saving, investing, and debt reduction by creating custom plans based on your unique needs. Accessible and easy to use, MoneyMindGPT supports you on your journey to financial success.

S
SnackPromptLife$4.99
5,254 5,276