0PricingLogin
AI Prompt Engineering · Lesson

Providing Background Information

When and how to include domain knowledge, constraints, and project details.

Why Background Information Matters

Background information gives the model the facts it cannot know on its own: your specific project details, your team's constraints, your existing work, and your stakeholders' expectations.

Without background, the model generates for an imaginary generic situation. With background, it generates for your situation.

When to Include Domain Knowledge

Include domain knowledge in your prompt when:

  • The topic has multiple interpretations across industries
  • You are working with specialized terminology
  • The correct answer depends on domain-specific norms or regulations
  • The model might give a general answer when you need a field-specific one

Do not paste entire textbooks — summarize the 2-3 domain facts most relevant to your specific question.

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

domain_knowledge = (
    'Domain: algorithmic trading at a regulated broker-dealer in the US. '
    'Relevant rules: SEC Rule 15c3-5 (Market Access Rule) requires pre-trade risk checks. '
    'Latency budget: all risk checks must complete in under 100 microseconds. '
    'Stack: C++ for the matching engine, Python for strategy logic.'
)

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=300,
    messages=[{
        'role': 'user',
        'content': (
            f'{domain_knowledge}\n\n'
            f'Question: How should we implement position limit checks for our order router?'
        )
    }]
)
print(response.content[0].text)

All lessons in this course

  1. What Context Means in AI Prompting
  2. Providing Background Information
  3. Setting the Scene Effectively
  4. Context Length and Relevance
← Back to AI Prompt Engineering