Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cool project! #1

Open
sombraSoft opened this issue May 5, 2023 · 10 comments
Open

Cool project! #1

sombraSoft opened this issue May 5, 2023 · 10 comments

Comments

@sombraSoft
Copy link
Collaborator

Hey @orthagonal , I found your repo when searching for a Langchain implementation for elixir.
Are you accepting PRs? Let me know what are your plans for the repo!

@orthagonal
Copy link
Owner

Thanks a bunch! Yes I am accepting PRs, suggestions, advice, personal insults, etc. My tentative roadmap for first phase is:

  • basic docs for all the modules and functions (I'm doing that now).

  • "anchors", a @behavior at the end of a Chain where it does something to get in alignment, usually asking a human being or hard-coded program for confirmation before proceeding. The default implementation is for IO.puts/gets command line but the idea is you can implement your own behaviors for web, voice, gesture, whatever. I'm working on that now.

  • embeddings and vector database support. My hope is that the Daemon genserver can have some ready-to-use chains that help you embedify and store your data sources.

Chains:
-scrapeChain - already exists

  • queryChain - chain intended to query data, a queryChain has an optional :query anchor, so it shows you what it found and asks if it looks right.
  • actionChain - chain intended to perform actions, an actionChain requires an :effector anchor, so it shows you what it's going to do, warns you of potential dangers and gets permission to actually do it.

GenServers:

  • Scraper - already exists
  • Inquisitor - GenServer that stores and executes queryChains, inquisitors can be trusted because queryChains have no side effects, so anchors are optional.
  • Daemon - GenServer that stores and executes actionChains. Daemons can't be trusted because their chains have side effects, so anchors are mandatory and have to tell you what they're going to do, warn about consequences and then get your permission before proceeding.

I already have scrapeChain and Scraper that basically work. The goal is that Daemon, Inquisitor and Scraper are high-level general-purpose AI agents that come with a toolbelt for common generic tasks so casual users can just jump right in. But people can also dig in and make their own custom chains as well.

@sethcalebweeks
Copy link
Collaborator

What's the best way to contribute to this project? I was about to start working on the same thing, but came across this project. I'm looking to build a conversational bot with history and the ability to use tools. We built a couple chains in Elixir using EEX to store the prompts. Would you be open to meeting with me to see if we can collaborate on this project? Thanks!

@orthagonal
Copy link
Owner

orthagonal commented May 5, 2023

I'm definitely up for meeting contributors, I should be available any time today. What's best way for you?
I'm on both the elixir discord server and slack channels if that helps, just let me know.

@sethcalebweeks
Copy link
Collaborator

I couldn't figure out how to get into Slack, but I just joined Discord. My username is sethcalebweeks there. Tried finding you under the name orthogonal, but couldn't find you.

@orthagonal
Copy link
Owner

orthagonal commented May 5, 2023 via email

@BigSpaces
Copy link
Collaborator

@orthagonal and @sethcalebweeks I would humbly like to join this conversation and see if I can do something to contribute. I am quite a newbie to Elixir (and programming in general). My goal was to implement the functionalities of AI into Elixir code and this is how I came to this project (didn't want to start learning python to do a couple things, really).

It would be amazing to achieve some type of AutoGPT functionality, but with the power of Elixir.

I am in discord under @BigSpaces

@BigSpaces
Copy link
Collaborator

Found @orthagonal and sent a friend request :)

@cpursley
Copy link

cpursley commented Aug 7, 2023

Not sure if this is the right place to ask, but how can we use Bumblebee with scraper? I went looking through the docs (and test) and tried running a few experiments without luck. Thanks!

@orthagonal
Copy link
Owner

orthagonal commented Aug 8, 2023

You should be able to back the scraper with any of the language model providers in the API wrapper, in the scraper example I think you can just replace:

openai_provider = %LangChain.Providers.OpenAI.LanguageModel{
model_name: "gpt-3.5-turbo",
max_tokens: 25,
temperature: 0.5,
n: 1
}

with (eg):

bumblebee_provider = %LangChain.Providers.Bumblebee.LanguageModel{
model_name: "distilgpt2",
max_new_tokens: 25,
temperature: 0.5
}

Bumblebee will download the Huggingface model specified by model_name to your local cache and try to run it on your GPU, so you'll need Nx and a beefy machine to run most of those. Let me know if you run into any problems.

@cpursley
Copy link

cpursley commented Aug 8, 2023

Thanks. That returned an error, I'll open an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants