> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Alchemyst AI integration

> Integrate the Alchemyst AI Retriever into your Generative AI Application

# Alchemyst AI retriever

The [**Alchemyst AI Retriever**](https://getalchemystai.com) enables your generative AI applications to retrieve relevant context and knowledge. It sources this information from the Alchemyst platform. It provides a unified interface for accessing, searching, and retrieving data to enhance LLM and agent responses.

## Setup

1. If you don't have an account, [sign up for a new account](https://platform.getalchemystai.com/signup) on the Alchemyst Platform.
2. After logging in, go to [**Alchemyst Platform Settings**](https://platform.getalchemystai.com/settings) to get your API keys.

<Tip>
  See [this section for general instructions on installing LangChain packages](/oss/javascript/langchain/install).
</Tip>

<CodeGroup>
  ```sh npm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  npm i @alchemystai/langchain-js
  ```

  ```sh yarn theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  yarn add @alchemystai/langchain-js
  ```

  ```sh pnpm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pnpm add @alchemystai/langchain-js
  ```

  ```sh bun theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  bun add @alchemystai/langchain-js
  ```
</CodeGroup>

## Usage

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { AlchemystRetriever } from "@alchemystai/langchain-js";
import { RunnableSequence } from "@langchain/core/runnables";
import dotenv from "dotenv";

dotenv.config();

// Instantiate the retriever with your API key and optional config
const retriever = new AlchemystRetriever({
  apiKey: process.env.ALCHEMYST_AI_API_KEY!,
  similarityThreshold: 0.8,
  minimumSimilarityThreshold: 0.5,
  scope: "internal"
});

// Example: Use the retriever in a LangChain pipeline
async function main() {
  // Create a simple pipeline that retrieves documents and outputs their content
  const pipeline = RunnableSequence.from([
    async (input: string) => {
      const docs = await retriever.getRelevantDocuments(input);
      return docs.map(doc => doc.pageContent).join("\n---\n");
    }
  ]);

  const query = "Show me the latest HR policies"; // Put your business/practical query here
  const result = await pipeline.invoke(query);

  console.log("Retrieved Documents:\n", result);
}

main().catch(console.error);
```

## Support and feedback

For support, feedback, or to report issues, please visit the [Alchemyst AI Documentation](https://docs.getalchemystai.com), where you'll find the latest contact and community information.

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/retrievers/alchemystai-retriever.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
