Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions pipeline/core/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def build_all(self) -> None:
logger.info("Building LangSmith content...")
self._build_unversioned_content("langsmith", "langsmith")

# Build localized content directories (ko/, cn/, es/, zh-Hant/)
logger.info("Building localized content...")
self._build_localized_content()

# Copy shared files (docs.json, images, etc.)
logger.info("Copying shared files...")
self._copy_shared_files()
Expand Down Expand Up @@ -636,6 +640,169 @@ def _build_unversioned_content(self, source_dir: str, output_dir: str) -> None:
skipped_count,
)

def _build_localized_content(self) -> None:
"""Build localized content directories (ko/, cn/, es/, zh-Hant/).

This method scans for localized content directories in src/ and copies them
to the build directory, maintaining the directory structure.

If a localized directory contains an oss/ subdirectory, that content will be
versioned into python/ and javascript/ variants.
"""
# Common language codes for localized content
localized_dirs = ["ko", "cn", "es", "zh-Hant", "ja", "de", "fr", "pt", "ru"]

for lang_code in localized_dirs:
src_path = self.src_dir / lang_code
if src_path.exists() and src_path.is_dir():
logger.info("Building %s/ content...", lang_code)

# Check if this localized directory has an oss/ subdirectory
oss_path = src_path / "oss"
if oss_path.exists() and oss_path.is_dir():
# Build versioned OSS content
logger.info("Building %s/oss/ Python version...", lang_code)
self._build_localized_oss_version(lang_code, "python")

logger.info("Building %s/oss/ JavaScript version...", lang_code)
self._build_localized_oss_version(lang_code, "js")

# Build non-oss content as unversioned
self._build_localized_non_oss_content(lang_code)

def _build_localized_oss_version(
self, lang_code: str, target_language: str
) -> None:
"""Build localized OSS content for a specific language version.

Args:
lang_code: Language code for the locale (e.g., "ko", "cn").
target_language: Target language for conditional blocks ("python" or "js").
"""
oss_dir = self.src_dir / lang_code / "oss"
if not oss_dir.exists():
return

# Get all files in the localized oss directory
all_files = [
file_path
for file_path in oss_dir.rglob("*")
if file_path.is_file() and not self.is_shared_file(file_path)
]

if not all_files:
logger.info("No files found in %s/oss/ directory", lang_code)
return

# Map target_language to directory name
# target_language is "python" or "js", but directory is "python" or "javascript"
lang_dir = self.language_url_names.get(target_language, target_language)

# Process files with progress bar
copied_count: int = 0
skipped_count: int = 0

with tqdm(
total=len(all_files),
desc=f"Building {lang_code}/oss/{lang_dir} files",
unit="file",
ncols=80,
bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]",
) as pbar:
for file_path in all_files:
# Calculate relative path from oss/ directory
relative_path = file_path.relative_to(oss_dir)

# Build to {lang_code}/oss/{lang_dir}/ structure
output_path = (
self.build_dir / lang_code / "oss" / lang_dir / relative_path
)

result = self._build_single_file(
file_path,
output_path,
target_language,
pbar,
f"{lang_code}/oss/{lang_dir}/{relative_path}",
)
if result:
copied_count += 1
else:
skipped_count += 1
pbar.update(1)

logger.info(
"✅ %s/oss/%s complete: %d files copied, %d files skipped",
lang_code,
lang_dir,
copied_count,
skipped_count,
)

def _build_localized_non_oss_content(self, lang_code: str) -> None:
"""Build non-OSS content for a localized directory.

Args:
lang_code: Language code for the locale (e.g., "ko", "cn").
"""
src_path = self.src_dir / lang_code
if not src_path.exists():
return

# Get all files EXCEPT those in the oss/ subdirectory
all_files = []
for file_path in src_path.rglob("*"):
if file_path.is_file() and not self.is_shared_file(file_path):
# Skip files that are in the oss/ subdirectory
try:
relative_to_lang = file_path.relative_to(src_path)
if relative_to_lang.parts and relative_to_lang.parts[0] == "oss":
continue
all_files.append(file_path)
except ValueError:
continue

if not all_files:
logger.info("No non-OSS files found in %s/ directory", lang_code)
return

# Process files with progress bar
copied_count: int = 0
skipped_count: int = 0

with tqdm(
total=len(all_files),
desc=f"Building {lang_code} non-OSS files",
unit="file",
ncols=80,
bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]",
) as pbar:
for file_path in all_files:
# Calculate relative path from lang directory
relative_path = file_path.relative_to(src_path)
# Build directly to {lang_code}/
output_path = self.build_dir / lang_code / relative_path

result = self._build_single_file(
file_path,
output_path,
"python", # Use python as default for non-OSS localized content
pbar,
f"{lang_code}/{relative_path}",
)
if result:
copied_count += 1
else:
skipped_count += 1
pbar.update(1)

logger.info(
"✅ %s non-OSS complete: %d files copied, %d files skipped",
lang_code,
copied_count,
skipped_count,
)

def _build_single_file(
self,
file_path: Path,
Expand Down
43 changes: 43 additions & 0 deletions src/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,49 @@
]
}
]
},
{
"language": "ko",
"products": [
{
"product": "Home",
"icon": "house",
"pages": [
"ko/index"
]
},
{
"product": "LangChain + LangGraph",
"icon": "link",
"description": "Open source frameworks",
"dropdowns": [
{
"dropdown": "Python",
"icon": "python",
"tabs": [
{
"tab": "LangChain",
"pages": [
"ko/oss/python/langchain/overview"
]
}
]
},
{
"dropdown": "JavaScript",
"icon": "square-js",
"tabs": [
{
"tab": "LangChain",
"pages": [
"ko/oss/javascript/langchain/overview"
]
}
]
}
]
}
]
}
]
},
Expand Down
140 changes: 140 additions & 0 deletions src/ko/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
title:
sidebarTitle: Home
mode: "custom"
---

This is a placeholder page. It should follow the same format as src/index.mdx.


<div class="mx-auto max-w-8xl px-0 lg:px-5" style={{ paddingBottom: "8rem" }}>
<div class="mdx-content prose prose-gray dark:prose-invert mx-4 pt-10">
<h1 class="flex whitespace-pre-wrap group font-semibold text-2xl sm:text-3xl mt-8">Documentation</h1>

LangChain is the platform for agent engineering. AI teams at Replit, Clay, Rippling, Cloudflare, Workday, and more trust LangChain's products to engineer reliable agents.

Our **open source frameworks** help you build agents:

- [**LangChain**](/oss/python/langchain/overview) helps you quickly get started building agents, with any model provider of your choice.
- [**LangGraph**](/oss/python/langgraph/overview) allows you to control every step of your custom agent with low-level orchestration, memory, and human-in-the-loop support. You can manage long-running tasks with durable execution.

[**LangSmith**](/langsmith/home) is a platform that helps AI teams use live production data for continuous testing and improvement. LangSmith provides:

- **Observability** to see exactly how your agent thinks and acts with detailed tracing and aggregate trend metrics.
- **Evaluation** to test and score agent behavior on production data and offline datasets for continuous improvement.
- **Deployment** to ship your agent in one click, using scalable infrastructure built for long-running tasks.

<Callout icon="bullhorn" color="#DFC5FE" iconType="regular">
LangGraph Platform is now [LangSmith Deployment](/langsmith/deployments). For more information, check out the [Changelog](https://changelog.langchain.com/announcements/product-naming-changes-langsmith-deployment-and-langsmith-studio).
</Callout>

<h2 class="flex whitespace-pre-wrap group font-semibold">Get started</h2>

<CardGroup cols={4}>
<Card title="Build your first agent with LangChain" icon="gear" href="/oss/python/langchain/quickstart" cta="Get started" />
<Card title="Sign up for LangSmith" icon="screwdriver-wrench" href="https://smith.langchain.com/" cta="Try LangSmith" />
<Card title="Build an advanced agent with LangGraph" icon="robot" href="/oss/python/langgraph/quickstart" cta="Get started"/>
<Card title="Enroll in LangChain Academy" icon="graduation-cap" href="https://academy.langchain.com/" cta="Get started"/>
</CardGroup>

<h2 class="flex whitespace-pre-wrap group font-semibold">Open source agent frameworks</h2>

<Tabs>
<Tab title="Python" icon="python">
<CardGroup cols={3}>
<Card
title="LangChain (Python)"
href="/oss/python/langchain/overview"
icon="link"
cta="Learn more"
>
Quickly get started building agents, with any model provider of your choice.
</Card>
<Card
title="LangGraph (Python)"
href="/oss/python/langgraph/overview"
icon="circle-nodes"
cta="Learn more"
>
Control every step of your custom agent with low-level orchestration, memory, and human-in-the-loop support.
</Card>
<Card
title="Deep Agents"
href="/oss/python/deepagents/overview"
icon="robot"
cta="Learn more"
>
Build agents that can tackle complex, multi-step tasks.
</Card>
</CardGroup>
</Tab>
<Tab title="TypeScript" icon="js">
<CardGroup cols={2}>
<Card
title="LangChain (TypeScript)"
href="/oss/javascript/langchain/overview"
icon="link"
cta="Learn more"
>
Quickly get started building agents, with any model provider of your choice.
</Card>
<Card
title="LangGraph (TypeScript)"
href="/oss/javascript/langgraph/overview"
icon="circle-nodes"
cta="Learn more"
>
Control every step of your custom agent with low-level orchestration, memory, and human-in-the-loop support.
</Card>
</CardGroup>
</Tab>
</Tabs>

<h2 class="flex whitespace-pre-wrap group font-semibold">LangSmith</h2>

<CardGroup cols={4}>
<Card
title="Observability"
href="/langsmith/observability"
icon="magnifying-glass"
cta="Learn more"
>
See exactly how your agent thinks and acts with detailed tracing and aggregate trend metrics.
</Card>
<Card
title="Evaluation"
href="/langsmith/evaluation"
icon="chart-simple"
cta="Learn more"
>
Test and score agent behavior on production data or offline datasets to continuously improve performance.
</Card>
<Card
title="Prompt Engineering"
href="/langsmith/prompt-engineering"
icon="terminal"
cta="Learn more"
>
Iterate on prompts with version control, prompt optimization, and collaboration features.
</Card>
<Card
title="Deployment"
href="/langsmith/deployments"
icon="rocket-launch"
cta="Learn more"
>
Ship your agent in one click, using scalable infrastructure built for long-running tasks.
</Card>
</CardGroup>

<Callout icon="lock" color="#DFC5FE" iconType="regular">
LangSmith meets the highest standards of data security and privacy with HIPAA, SOC 2 Type 2, and GDPR compliance. For more information, see the [Trust Center](https://trust.langchain.com/).
</Callout>
</div>
</div>

{/* Hack to hide the callout cards*/}
<div className="relative">
<div className="absolute top-0 left-0 w-screen h-48 bg-background-light dark:bg-background-dark z-10">
</div>
</div>
Loading
Loading