Prompt
How do I get cited answers from internal and external sources?
Latest observation
To get cited answers from internal and external sources, you generally need a workflow that combines:
- Retrieving the right documents
- Grounding the answer in those documents
- Citing each claim with source references
Here’s the practical approach.
1) Define your sources
- Internal sources: company docs, wikis, policies, tickets, knowledge bases, PDFs, databases, Slack/Teams archives, etc.
- External sources: web pages, journal articles, standards, news, government sites, vendor docs, etc.
2) Make the sources searchable
Use retrieval methods like:
- Full-text search
- Vector search / embeddings
- Hybrid search (best in many cases)
- RAG pipeline (Retrieval-Augmented Generation)
For internal data, you usually need:
- ingestion/connectors
- chunking
- metadata tagging
- access control enforcement
For external data, you usually need:
- web search or curated APIs
- source trust ranking
- citation extraction
3) Generate answers only from retrieved material
When asking the model:
- instruct it to answer only using provided sources
- require inline citations for every factual statement
- tell it to say “I don’t know” if sources don’t support the answer
Example prompt pattern:
Answer the question using only the provided documents.
Cite every factual claim with [Source 1], [Source 2], etc.
If the sources do not support an answer, say so clearly.
4) Attach citations to each claim
A citation can include:
- document title
- section/page
- URL
- timestamp
- internal document ID
- quoted excerpt if needed
Example:
- “The policy requires manager approval for expenses over $500 [Expense Policy v3, §4.2].”
- “According to the vendor docs, the API rate limit is 100 requests/minute [Vendor API Docs, rate limits page].”
5) Validate citation quality
A good cited answer should be:
- traceable: each claim maps to a source
- accurate: the source really supports the claim
- complete: no major unsupported statements
- current: especially important for external sources
6) Best practices
- Prefer primary sources over summaries
- Use multiple sources when claims are complex
- Keep source freshness in mind
- For internal info, respect permissions
- For external info, check credibility and date
- Avoid citation spam—cite the relevant claim, not every sentence unnecessarily
7) If you want this in an AI product
A common architecture is:
- user question
- retrieval from internal + external indexes
- reranker to pick best passages
- LLM answer generation with citations
- citation formatter
- verification step to ensure sources support claims
Example output
The onboarding process takes 5 business days and requires HR approval for access provisioning [Internal Onboarding SOP, p. 2]. The vendor recommends rotating API keys every 90 days [Vendor Security Guide, “Key Rotation”].
If you want, I can also show you:
- a prompt template
- a RAG architecture
- or how to implement citations in code for internal + external sources.