Use magic to defeat magic, AI writes prompt words to enhance the big model

Written by
Silas Grey
Updated on:June-25th-2025
Recommendation

AI prompt word optimization model improves the efficiency of intelligent talent screening.

Core content:
1. Challenges of vector database query and semantic understanding
2. Optimize prompt words to achieve accurate matching of gender conditions
3. Solutions to the limitations of the outer intelligent agent database table and SQL statement problems

Yang Fangxian
Founder of 53A/Most Valuable Expert of Tencent Cloud (TVP)
During the 51 holiday, I stayed at home to study whether I could use Coze to create a scenario application for HR intelligent talent screening.
After a few days of research, I found the following pitfalls:
1. The current intelligent agent uses vector database query, but it is insufficient in the flexible conversion of semantic understanding and precise query of large models. For example, if a user inputs to search for information of all female financial personnel, the search result is empty after the prompt word is entered. An output is added to see what SQL statement is written, and it is found that "female" is written, while "female" is written in the database, so the return value is empty. Although the prompt word is written to let it understand the storage content in the database first, it is completely unresponsive when it is actually executed. ChatGPT is used to optimize the prompt word, and AI's own answer is that it can only write a mapping matrix. But there is another problem here. The mapping matrix may not be able to exhaust all user inputs. How to deal with this? GPT was asked again and the following prompt words were given:

Gender Conditioning

- Direct statement:

  - "male", "male", "boy", "man" → gender = 'male'

  - "female", "female", "female", "lady" → gender = 'female'

- Implied expressions:

  - "beautiful girl", "girl", "sister" → gender = 'female'

  - "handsome guy", "young man", "man" → gender = 'male'

- Combined expression:

  - "Male employee", "Male colleague" → gender = 'male'

  - "female employee", "female colleague" → gender = 'female'

- Negative statement:

  - "non-male" → gender != 'male'

  - "non-female" → gender != 'female'

Test results:

Input: Find a finance girl

Output:

✅ Found 3 candidates who meet the requirements of "Finance Girl":

1️⃣ Zhao Ping (EMP006): Financial Analyst, 31 years old, works in the Finance Department.
2️⃣ Zhu Li (EMP016): Accountant, 35 years old, works in the Finance Department.
3️⃣ Gao Yan (EMP022): Financial Analyst, 33 years old, works in the Finance Department.

Please enter the candidate number (1 - 3) to view detailed analysis.

Input: Find a finance lady

Output: The query returned no results. This could mean:


  • There are no employees in the system who meet the requirement of "finance personnel over 50 years old".
  • There are no data records for this employee.
  • The query criteria may need to be adjusted.

You can consider relaxing the conditions, such as expanding the age range to middle-aged (35-50 years old), or provide other supplementary conditions, and I will continue to find the right person for you.

In other words, you still need to give AI an example, so that AI will be able to understand the matching relationship in the middle with a high probability.
2. The outer agent of Coze can only hang 3 database tables, and Coze does not support SELECT *, JOIN syntax to write SQL statements. The initial idea was to create a workflow and hang SQL statements in the workflow for query, but the problem here is what is the input of the workflow? If it is just the user's context, it is difficult to extract the query conditions one by one in the outer prompt words, and in the inner workflow, the database table cannot be hung on the LLM for vector retrieval. One idea is to set global parameters and then pass them to the workflow, but this is extremely inefficient and the system is obviously stuck. In the end, I had to give up and write everything in the prompt words of the outer large model.
3. For inputs that do not have a matching relationship, AI needs to be taught step by step how to perform job analysis and detailed steps.
The prompt words are as follows:

## 11. Matching and analysis execution process


### 11.1 Job Existence and Requirements Understanding


1. **Preliminary analysis of user needs**


**Example: Pre-demand analysis**

```

// Step 1: Identify the real needs of users

1. Analyze the target position of the user query: "Overseas IT System Implementation Project Manager"

2. Break it down into core elements: region (overseas), department (IT), function (system implementation), position (project manager)

3. Evaluate the importance of each factor

```


2. **Job Existence Verification**


**Example: Position existence verification**

```

// Step 2: Verify whether the position exists

SELECT COUNT(*) FROM position_competency 

WHERE position_code LIKE '%IT%' AND position_code LIKE '%PM%'

IF result = 0, execute the job modeling process

```


3. **Position modeling (for non-existent positions)**


**Example: Position Modeling**

```

// Step 3: Create a job model

1. Build a job characteristics model based on industry standards and best practices

2. Determine core competency requirements and weights

3. Map to similar positions and competency requirements within the system

```


### 11.2 Step-by-step verification analysis process


1. **Basic existence verification**


**Example: Basic Existence Verification**

```

// Step 4: Verify the existence of employee ID

SELECT COUNT(*) FROM employee_profile WHERE employee_id = 'EMP123'

If the result is 0, stop immediately and report "employee ID does not exist"

```


2. **Basic data acquisition**


**Example: Basic Data Acquisition**

```

// Step 5: Get basic information

SELECT * FROM employee_profile WHERE employee_id = 'EMP123'

Verify the number of returned rows to ensure that the data exists

```


3. **Acquisition of relevant data**


**Example: Relevant data acquisition**

```

// Step 6: Get relevant data

SELECT * FROM employee_competency WHERE employee_id = 'EMP123'

Explicitly state whether data was found: "5 competency assessment records found" or "No competency assessment records found"

```


4. Data Integration and Analysis


**Example: Data Integration and Analysis**

```

// Step 7: Perform analysis based on the actual acquired data

Only analyze data that actually exists

Clearly indicate missing data

No guessing about missing data

```

Effect verification:

Input: I am looking for a contractor who has done engineering projects overseas

Output:

Based on the execution results, no candidate was found who fully met the criteria of “contractor who has worked on engineering projects overseas”.


? Data diagnosis results:


  • Currently, no personnel with clear “overseas” and “engineering project” related skill labels and positions similar to those of contractors have been found.


? Recommended expansion direction:


  1. Priority will be given to relaxing the geographical requirement from “overseas” to “foreign language proficiency and engineering project experience” (estimated match: medium).
  2. Consider broadening the job scope from “contractor” to “engineering-related project manager or person in charge” (estimated match: medium-low).


Do you accept to relax the conditions and continue the search? If you accept, which condition do you want to relax first?

Input: Release all

Output:

Even after relaxing the geographical and position scope requirements, no qualified candidates were found.


? This could be an opportunity to show that:


  1. This position is an emerging need in the organization.
  2. External recruitment or internal development may be needed to fill this talent gap.
  3. Consider splitting responsibilities among existing team members.

? I can help you:


  1. Find existing talent that best matches your requirements.
  2. Design internal training programs.
  3. Analyze the key points of external recruitment.

What would you like me to help you with next?

Input: 1

Output:

When trying to find the current talent that is closest to the requirements, no personnel that meets certain relevant conditions are found. The current database may lack data on engineering personnel that are related to overseas engineering projects.


In view of this situation, it is recommended to consider recruiting suitable talents from outside. I can analyze the key points of external recruitment for you; or design an internal training program to tap the potential of internal employees and develop them into this position. Do you want me to analyze the key points of external recruitment for you, or design an internal training program?


Input: Internal solution
Output:

Since there is no suitable internal personnel data for reference at present, I will first build a job competency model of "overseas engineering project contractor" for you and design an internal training program based on this.


"Overseas Engineering Project Contractor" Job Competency Model

{
  "core_responsibilities": [
    "Responsible for the overall planning and coordination of overseas engineering projects",
    "Manage overseas engineering project teams and coordinate resources from all parties",
    "Ensure that projects comply with local regulations, standards and cultural requirements",
    "Controlling the progress, quality and cost of engineering projects",
    "Communicate effectively with overseas customers, suppliers and other stakeholders"
  ],
  "key_abilities": {
    "Project Management": ["Project Planning", "Schedule Control", "Quality Management", "Cost Management", "Risk Management"],
    "Technical ability": ["Engineering technical knowledge", "Construction technology mastery", "Drawing interpretation ability"],
    "Cross-cultural competence": ["Cultural sensitivity", "Cross-cultural communication skills", "International business etiquette"],
    "Team Management": ["Recruitment", "Team Motivation", "Conflict Resolution"]
  },
  "skill_requirements": [
    {"skill": "Project Management", "level": "Advanced", "weight": 30},
    {"skill": "Engineering Technology", "level": "Intermediate and Advanced", "weight": 25},
    {"skill": "Cross-cultural communication", "level": "Proficient", "weight": 20},
    {"skill": "Team Management", "level": "Advanced", "weight": 15},
    {"skill": "Foreign language ability", "level": "Good", "weight": 10}
  ]
}

Internal training program


Talent screening


Publish a recruitment notice for the position of "Overseas Engineering Project Contractor" within the company to attract employees who are interested in the position and have certain potential to apply. Select those who meet the following basic conditions from the applicants:


  • Have experience in engineering related projects.
  • Possess certain learning and adaptability.
  • Interest and willingness to work overseas.

Training Program


  1. Project Management Training
  • Professional project management lecturers are invited to give offline lectures. The course content includes project management knowledge system (such as PMBOK), project planning, schedule control, quality management, cost management, etc.
  • Organize trainees to participate in the management of actual engineering projects, apply the knowledge they have learned in practice, and arrange mentors to provide guidance.
  • Engineering technology training
    • For different engineering fields, we arrange internal technical experts to conduct technical training, including engineering technical knowledge, construction technology, and drawing interpretation.
    • Organize trainees to conduct field study at the construction site to understand the actual situation of the project construction.
  • Cross-cultural competence training
    • Conduct cross-cultural communication training courses and invite people with overseas work experience to share their experiences. The content includes cultural sensitivity, cross-cultural communication skills, international business etiquette, etc.
    • Arrange students to communicate and cooperate with overseas teams to improve their cross-cultural communication skills.
  • Foreign language training
    • According to job requirements, arrange corresponding foreign language training courses for trainees, such as English, local language, etc.
    • Organize foreign language exchange activities to improve students' foreign language application ability.

    Practical training


    1. Arrange trainees to participate in the company's internal overseas engineering projects, starting as project assistants and gradually accumulating overseas project experience.
    2. During the project implementation, specific tasks and responsibilities are assigned to trainees, allowing them to practice project management, team management and cross-cultural communication skills.

    Evaluation and Feedback


    1. Regularly evaluate students’ learning and practice, including theoretical knowledge assessment, practical project evaluation, etc.
    2. Based on the evaluation results, we provide students with personalized feedback and suggestions to help them improve and enhance.

    Promotion Mechanism


    1. Trainees who perform well during the training process will be given promotion opportunities to serve as “overseas engineering project contractors” or related management positions.
    2. Establish long-term career development plans to provide trainees with continuous development space and support.

    This internal training program is designed based on the job competency model. You can adjust and improve it according to the actual situation of the company. If you have other needs, please feel free to let me know.

    Input: Are there any suitable people according to this internal training plan?
    Output:

    Sorry, the query just now usedJOIN, which violates the rules. Next, I will query the two tables separately.
    No engineering-related employees were found in the employee profile table. Since there is no personnel base available for internal training, it is temporarily impossible to determine the right candidates who meet the internal training plan.


    Next, you can consider external recruitment to meet the needs of the "Overseas Engineering Project Contractor" position. I can analyze the key points of external recruitment for you; or you can further relax the conditions of internal screening to see if you can find potential employees. What do you want me to do for you next?

    Input: Relaxation of internal screening conditions

    Output:

    According to the relaxed screening criteria, we found 2 employees who may have the potential to participate in the "Overseas Engineering Project Contractor" training program. The following is the information of these employees:
    1️⃣ Yang Fan (EMP007): Operations Director, from the Operations Department, with skills including supply chain management, process optimization, project management, resource planning and risk management, and language proficiency of 4/5 in English and 3/5 in German.
    2️⃣ Xue Mei (EMP020): IT Director, from the IT Department, with skills covering IT strategy, system architecture, project management, information security and digital transformation, and English proficiency of 5/5.


    Next, I will further analyze the match between these two employees and the "Overseas Engineering Project Contractor" position competency model to determine whether they are suitable for inclusion in the training program.
    Unfortunately, there is no assessment data for these two employees (EMP007, EMP020) in the employee competency assessment form regarding key competency areas such as project management, engineering technology, cross-cultural communication, and team management. Based on the existing data, only limited analysis can be provided.


    According to the information in the employee portrait table, Yang Fan has project management skills and certain language skills, and has experience in operations management; Xue Mei has project management skills and excellent English skills, and has rich experience in the IT field. However, due to the lack of assessment data on key capabilities, it is difficult to accurately determine whether they are suitable for the training program of "Overseas Engineering Project Contractors".


    You can consider providing more information about these two employees, or continue to relax the screening criteria, and I will try my best to find more suitable internal training candidates for you. What do you want to do next?


    in conclusion:
    The whole set of prompts was used to generate a question each time, and then optimized using Claude 3.7. Finally, a set of prompts for 14 chapters was generated, which can basically cope with the input of most users.
    I just saw the news these days saying that the demand for "Prompt engineers" has decreased, but I also fully understand why Prompt is so important in the use of AI. In addition, building AI is really a very laborious job. You have to constantly test it from all angles, which is very time-consuming. You can only treat AI as a college graduate who knows nothing and needs to be taught and learned step by step. Maybe in a few years, this technology will not be so laborious.