Copy
---
title: Contextual AI
---
Contextual AI는 정확하고 신뢰할 수 있는 엔터프라이즈 AI 애플리케이션을 위해 특별히 설계된 최첨단 RAG 컴포넌트를 제공합니다. 우리의 LangChain 통합은 특화된 모델을 위한 독립형 API endpoint를 제공합니다:
- Grounded Language Model (GLM): 검색된 지식에 대한 충실성을 우선시하여 환각을 최소화하도록 설계된 세계에서 가장 근거 있는 언어 모델입니다. GLM은 인라인 출처 표시와 함께 뛰어난 사실 정확도를 제공하여, 신뢰성이 중요한 엔터프라이즈 RAG 및 에이전트 애플리케이션에 이상적입니다.
- Instruction-Following Reranker: 최신성, 출처 또는 문서 유형과 같은 특정 기준에 따라 문서를 지능적으로 우선순위화하는 맞춤 지시사항을 따르는 최초의 reranker입니다. 업계 벤치마크에서 경쟁사를 능가하며, 우리의 reranker는 엔터프라이즈 지식 베이스에서 상충되는 정보 문제를 해결합니다.
RAG 기술의 발명자들이 설립한 Contextual AI의 특화된 컴포넌트는 혁신적인 팀이 뛰어난 정확도로 응답을 제공하는 프로덕션 준비 RAG 에이전트 개발을 가속화하도록 돕습니다.
## Grounded Language Model (GLM)
Grounded Language Model (GLM)은 엔터프라이즈 RAG 및 에이전트 애플리케이션에서 환각을 최소화하도록 특별히 설계되었습니다. GLM은 다음을 제공합니다:
- FACTS 벤치마크에서 88%의 사실 정확도로 강력한 성능 ([벤치마크 결과 보기](https://venturebeat.com/ai/contextual-ais-new-ai-model-crushes-gpt-4o-in-accuracy-heres-why-it-matters/))
- 인라인 출처 표시와 함께 제공된 지식 소스에 엄격하게 근거한 응답 ([제품 세부정보 읽기](https://contextual.ai/blog/introducing-grounded-language-model/))
- 생성된 응답 내에 직접 통합된 정확한 출처 인용
- 파라메트릭 지식보다 검색된 컨텍스트의 우선순위화 ([기술 개요 보기](https://contextual.ai/blog/platform-benchmarks-2025/))
- 정보를 사용할 수 없을 때 불확실성에 대한 명확한 인정
GLM은 RAG 파이프라인에서 범용 LLM의 드롭인 대체품으로 사용되어, 미션 크리티컬 엔터프라이즈 애플리케이션의 신뢰성을 극적으로 향상시킵니다.
## Instruction-Following Reranker
세계 최초의 Instruction-Following Reranker는 전례 없는 제어와 정확도로 문서 순위를 혁신합니다. 주요 기능은 다음과 같습니다:
- 최신성, 출처, 메타데이터 등을 기반으로 문서의 우선순위를 지정하는 자연어 지시사항 ([작동 방식 보기](https://contextual.ai/blog/introducing-instruction-following-reranker/))
- BEIR 벤치마크에서 61.2점으로 경쟁사를 상당한 차이로 능가하는 우수한 성능 ([벤치마크 데이터 보기](https://contextual.ai/blog/platform-benchmarks-2025/))
- 여러 지식 소스의 상충되는 정보를 지능적으로 해결
- 기존 reranker의 드롭인 대체품으로 원활한 통합
- 자연어 명령을 통한 문서 순위의 동적 제어
이 reranker는 잠재적으로 모순되는 정보가 있는 엔터프라이즈 지식 베이스를 처리하는 데 탁월하며, 다양한 시나리오에서 어떤 소스가 우선되어야 하는지 정확하게 지정할 수 있습니다.
## LangChain과 함께 Contextual AI 사용하기
자세한 내용은 [여기](/oss/python/integrations/chat/contextual)를 참조하세요.
이 통합을 통해 Contextual AI의 GLM과 Instruction-Following Reranker를 LangChain 워크플로우에 쉽게 통합할 수 있습니다. GLM은 애플리케이션이 엄격하게 근거한 응답을 제공하도록 보장하며, reranker는 가장 관련성 높은 문서를 지능적으로 우선순위화하여 검색 품질을 크게 향상시킵니다.
규제 산업이나 보안에 민감한 환경을 위한 애플리케이션을 구축하든, Contextual AI는 엔터프라이즈 사용 사례가 요구하는 정확성, 제어 및 신뢰성을 제공합니다.
오늘 무료 평가판을 시작하고 엔터프라이즈 AI 애플리케이션을 위한 가장 근거 있는 언어 모델과 instruction-following reranker를 경험하세요.
### Grounded Language Model
```python
# Integrating the Grounded Language Model
import getpass
import os
from langchain_contextual import ChatContextual
# Set credentials
if not os.getenv("CONTEXTUAL_AI_API_KEY"):
os.environ["CONTEXTUAL_AI_API_KEY"] = getpass.getpass(
"Enter your Contextual API key: "
)
# initialize Contextual llm
llm = ChatContextual(
model="v1",
api_key="",
)
# include a system prompt (optional)
system_prompt = "You are a helpful assistant that uses all of the provided knowledge to answer the user's query to the best of your ability."
# provide your own knowledge from your knowledge-base here in an array of string
knowledge = [
"There are 2 types of dogs in the world: good dogs and best dogs.",
"There are 2 types of cats in the world: good cats and best cats.",
]
# create your message
messages = [
("human", "What type of cats are there in the world and what are the types?"),
]
# invoke the GLM by providing the knowledge strings, optional system prompt
# if you want to turn off the GLM's commentary, pass True to the `avoid_commentary` argument
ai_msg = llm.invoke(
messages, knowledge=knowledge, system_prompt=system_prompt, avoid_commentary=True
)
print(ai_msg.content)
Copy
According to the information available, there are two types of cats in the world:
1. Good cats
2. Best cats
Instruction-Following Reranker
Copy
import getpass
import os
from langchain_contextual import ContextualRerank
if not os.getenv("CONTEXTUAL_AI_API_KEY"):
os.environ["CONTEXTUAL_AI_API_KEY"] = getpass.getpass(
"Enter your Contextual API key: "
)
api_key = ""
model = "ctxl-rerank-en-v1-instruct"
compressor = ContextualRerank(
model=model,
api_key=api_key,
)
from langchain_core.documents import Document
query = "What is the current enterprise pricing for the RTX 5090 GPU for bulk orders?"
instruction = "Prioritize internal sales documents over market analysis reports. More recent documents should be weighted higher. Enterprise portal content supersedes distributor communications."
document_contents = [
"Following detailed cost analysis and market research, we have implemented the following changes: AI training clusters will see a 15% uplift in raw compute performance, enterprise support packages are being restructured, and bulk procurement programs (100+ units) for the RTX 5090 Enterprise series will operate on a $2,899 baseline.",
"Enterprise pricing for the RTX 5090 GPU bulk orders (100+ units) is currently set at $3,100-$3,300 per unit. This pricing for RTX 5090 enterprise bulk orders has been confirmed across all major distribution channels.",
"RTX 5090 Enterprise GPU requires 450W TDP and 20% cooling overhead.",
]
metadata = [
{
"Date": "January 15, 2025",
"Source": "NVIDIA Enterprise Sales Portal",
"Classification": "Internal Use Only",
},
{"Date": "11/30/2023", "Source": "TechAnalytics Research Group"},
{
"Date": "January 25, 2025",
"Source": "NVIDIA Enterprise Sales Portal",
"Classification": "Internal Use Only",
},
]
documents = [
Document(page_content=content, metadata=metadata[i])
for i, content in enumerate(document_contents)
]
reranked_documents = compressor.compress_documents(
query=query,
instruction=instruction,
documents=documents,
)
Copy
---
<Callout icon="pen-to-square" iconType="regular">
[Edit the source of this page on GitHub.](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/contextual.mdx)
</Callout>
<Tip icon="terminal" iconType="regular">
[Connect these docs programmatically](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
</Tip>