Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Alchemyst AI Retriever
---

# Alchemyst AI Retriever

[**Alchemyst AI**](https://getalchemystai.com) is the context cloud for LLMs and AI Agents, purpose-built to serve as the connective tissue of your entire AI stack. It provides a unified memory layer that bridges data ingestion, context management, orchestration, inference, and deployment. By acting as a central hub for context and knowledge, Alchemyst enables your AI systems to access, share, and persist information across tools, sessions, and workflows.

With seamless integrations at every layer, Alchemyst empowers you to:

- Aggregate and enrich data from diverse sources, making it accessible to LLMs and agents in real time.
- Maintain persistent, context-aware memory that enhances reasoning, retrieval, and generation.
- Orchestrate complex workflows by connecting specialized frameworks, libraries, and platforms.
- Deploy AI solutions that are modular, scalable, and easy to maintain.

## Setup

Goto [**Alchemyst Platform**](https://platform.getalchemystai.com/settings) to get API keys. Sign in with Google to sign up with a new account.

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/openai @langchain/core @langchain/community
```

## Usage

import AlchemystAiRetrieverExample from "/snippets/javascript-integrations/examples/retrievers/alchemystai.mdx";
import CodeBlock from "@theme/CodeBlock";

<CodeBlock language="typescript">{AlchemystAiRetrieverExample}</CodeBlock>
7 changes: 7 additions & 0 deletions src/oss/javascript/integrations/retrievers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ If you'd like to contribute an integration, see [Contributing integrations](/oss
## All retrievers

<Columns cols={3}>
<Card
title="Alchemyst AI Retriever"
icon="link"
href="/oss/integrations/retrievers/alchemystai-retriever"
arrow="true"
cta="View guide"
/>
<Card
title="ArxivRetriever"
icon="link"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
```typescript
import { AlchemystRetriever } from "@alchemystai/langchain-js";
import { StringOutputParser } from "@langchain/core/output_parsers";
import { RunnableSequence } from "@langchain/core/runnables";
import dotenv from "dotenv";
// filepath: /Users/anuran/Alchemyst/integrations/playground/example.ts

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");
},
new StringOutputParser()
]);

const query = "Tell me about Quantum Entanglement"; // Put your query here
const result = await pipeline.invoke(query);

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

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