avatarLaxfed Paulacy

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1612

Abstract

ode> with the datasets you need. For example, to access 10-K and 10-Qs and retrieve the top 6 chunks for a given query, use the following code:</p><div id="5ba1"><pre><span class="hljs-keyword">from</span> langchain.retrievers import KayAiRetriever

retriever = KayAiRetriever.create(<span class="hljs-attribute">dataset_id</span>=<span class="hljs-string">"company"</span>, data_types=[<span class="hljs-string">"10-K"</span>, <span class="hljs-string">"10-Q"</span>], <span class="hljs-attribute">num_contexts</span>=6)</pre></div><p id="bebd">Now you can plug this context into your existing prompts and pass it to your favorite LLM.</p><h2 id="a61b">Use Cases</h2><p id="be49">SEC Filings are large, unstructured documents that capture crucial information about US public companies. Here are a few examples of how users are utilizing this data:</p><ul><li>Analyzing Financial Performance</li><li>Identifying Sales Opportunities</li><li>Monitoring Industry Trends</li><li>Compliance Research</li></ul><h2 id="8cd5">Behind the Scenes: Infrastructure</h2><p id="3e4f">The infrastructure behind RAG systems consists of three essential components: data, representation, and retrieval.</p><h2 id="be2e">Collecting data</h2><p id="837f">Cybersyn builds derived data products from proprietary and public datasets, including SEC Filings, and loads them onto the Snowflake Marketplace. This significantly improves ease of access to the data.</p><h2 id="d3dc">Generating embeddings</h2><p id="99dc">After enriching the raw text data with company and document metadata, an embedding model is chosen. In this case, <code>

Options

gte-base</code> was selected. To handle SEC data, dynamic variable chunking based on sections is implemented, and Ray's parallelization framework is used for offline batch embedding jobs.</p><h2 id="2104">Optimizing Retrieval</h2><p id="6bc4">The retrieval process involves building a Query Intent Classifier (QIC) powered by LLMs, and dynamically selecting between vector search and hybrid search. Additionally, Cohere’s Re-rank is applied to the retrieved chunks.</p><h2 id="e4c4">Resources and Next Steps</h2><p id="2ca8">For further exploration, you can refer to the SEC Retriever on LangChain, Cybersyn’s LLM Training Essentials, Snowflake Marketplace, and Kay’s Github.</p><div id="3874" class="link-block"> <a href="https://readmedium.com/langchain-hub-langchain-prompt-024c190fa24e"> <div> <div> <h2>LANGCHAIN — Hub Langchain Prompt</h2> <div><h3>First, solve the problem. Then, write the code. — John Johnson</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*nu7ZXSdSXeo6aCLEJYoZpg.jpeg)"></div> </div> </div> </a> </div><p id="dd88">This tutorial provides a comprehensive overview of Kay x Cybersyn x LangChain and demonstrates how to utilize the SEC Retriever API for financial data processing. By following the provided code snippets and examples, developers can easily integrate this powerful tool into their applications.</p></article></body>

LANGCHAIN — What Is Kay X Cybersyn X Langchain?

Programming isn’t about what you know; it’s about what you can figure out. — Chris Pine

Kay x Cybersyn x LangChain is a collaborative effort to make financial data processing more accessible. The SEC Retriever on LangChain, powered by Kay and Cybersyn, allows developers to retrieve context from SEC Filings for generative and conversational agents. Here’s a tutorial on how to get started with this API and an overview of the infrastructure behind it.

Getting Started

First, install Kay (pip install kay) and obtain your free API key on Kay.ai.

Initialize the KayAiRetriever with the datasets you need. For example, to access 10-K and 10-Qs and retrieve the top 6 chunks for a given query, use the following code:

from langchain.retrievers import KayAiRetriever

retriever = KayAiRetriever.create(dataset_id="company", data_types=["10-K", "10-Q"], num_contexts=6)

Now you can plug this context into your existing prompts and pass it to your favorite LLM.

Use Cases

SEC Filings are large, unstructured documents that capture crucial information about US public companies. Here are a few examples of how users are utilizing this data:

  • Analyzing Financial Performance
  • Identifying Sales Opportunities
  • Monitoring Industry Trends
  • Compliance Research

Behind the Scenes: Infrastructure

The infrastructure behind RAG systems consists of three essential components: data, representation, and retrieval.

Collecting data

Cybersyn builds derived data products from proprietary and public datasets, including SEC Filings, and loads them onto the Snowflake Marketplace. This significantly improves ease of access to the data.

Generating embeddings

After enriching the raw text data with company and document metadata, an embedding model is chosen. In this case, gte-base was selected. To handle SEC data, dynamic variable chunking based on sections is implemented, and Ray's parallelization framework is used for offline batch embedding jobs.

Optimizing Retrieval

The retrieval process involves building a Query Intent Classifier (QIC) powered by LLMs, and dynamically selecting between vector search and hybrid search. Additionally, Cohere’s Re-rank is applied to the retrieved chunks.

Resources and Next Steps

For further exploration, you can refer to the SEC Retriever on LangChain, Cybersyn’s LLM Training Essentials, Snowflake Marketplace, and Kay’s Github.

This tutorial provides a comprehensive overview of Kay x Cybersyn x LangChain and demonstrates how to utilize the SEC Retriever API for financial data processing. By following the provided code snippets and examples, developers can easily integrate this powerful tool into their applications.

Langchain
X
Cybersyn
ChatGPT
Kay
Recommended from ReadMedium