You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain-hub/README.md

79 lines
3.0 KiB
Markdown

1 year ago
# LangChainHub
| 🌐 This repo is getting replaced by our hosted LangChain Hub Product! Visit it at [https://smith.langchain.com/hub](https://smith.langchain.com/hub) 🌐 |
| --- |
1 year ago
## Introduction
1 year ago
Taking inspiration from Hugging Face Hub, LangChainHub is collection of all artifacts useful for working with LangChain primitives such as prompts, chains and agents.
The goal of this repository is to be a central resource for sharing and discovering high quality prompts, chains and agents that combine together to form complex LLM applications.
1 year ago
1 year ago
We are starting off the hub with a collection of prompts, and we look forward to the LangChain community adding to this collection. We hope to expand to chains and agents shortly.
1 year ago
## Contributing
1 year ago
Since we are using GitHub to organize this Hub, adding artifacts can best be done in one of three ways:
1. Create a fork and then open a PR against the repo.
2. Create an issue on the repo with details of the artifact you would like to add.
1 year ago
3. Add an artifact with the appropriate Google form:
- [Prompts](https://forms.gle/aAhZ6nEUybdzVbYq6)
Each of the different types of artifacts (listed below) will have different instructions on how to upload them.
Please refer to the appropriate documentation to do so.
1 year ago
## 📖 Prompts
1 year ago
At a high level, prompts are organized by use case inside the `prompts` directory.
To load a prompt in LangChain, you should use the following code snippet:
1 year ago
```python
1 year ago
from langchain.prompts import load_prompt
1 year ago
prompt = load_prompt('lc://prompts/path/to/file.json')
1 year ago
```
1 year ago
In addition to prompt files themselves, each sub-directory also contains a README explaining how best to use that prompt in the appropriate LangChain chain.
1 year ago
For more detailed information on how prompts are organized in the Hub, and how best to upload one, please see the documentation [here](./prompts/README.md).
1 year ago
1 year ago
## 🔗 Chains
At a high level, chains are organized by use case inside the `chains` directory.
To load a chain in LangChain, you should use the following code snippet:
```python
from langchain.chains import load_chain
chain = load_chain('lc://chains/path/to/file.json')
```
In addition to chain files themselves, each sub-directory also contains a README explaining what that chain contains.
For more detailed information on how chains are organized in the Hub, and how best to upload one, please see the documentation [here](./chains/README.md).
1 year ago
## 🤖 Agents
At a high level, agents are organized by use case inside the `agents` directory.
To load an agent in LangChain, you should use the following code snippet:
```python
from langchain.agents import initialize_agent
llm = ...
tools = ...
agent = initialize_agent(tools, llm, agent="lc://agents/self-ask-with-search/agent.json")
```
In addition to agent files themselves, each sub-directory also contains a README explaining what that agent contains.
For more detailed information on how agents are organized in the Hub, and how best to upload one, please see the documentation [here](./agents/README.md).
## 👷 Agent Executors
Coming soon!