Skip to main content

plugin for simonw's llm to add a langchain agent

Project description

llm_agent

Plugin for llm by the great simonw to add a simple langchain agent.

Features

  • Multiple search engines: duckduckgo, metaphor, tavily, wikipedia, pubmed, arxiv etc.
  • Browser tool: use playwright to browse the internet autonomously.
  • Math tool: calculator included
  • BigTask: a tool used to autonomously split a task into subtasks
  • Shell: you can opt in to give the llm access to your shell.
  • Files: you can opt in to give the llm access to your files. This is super handy for things like "Modify VAE.py to add docstrings, also add GPU compatibility and add tests."
  • Wallet safe: there is a timeout and recursion limit to avoid too high costs. Also the number of token used so far is displayed.
  • Persistent memory: if you use the user argument, you can just ask the LLM to memorize something (for example "I want you to memorize that I'm a computer science engineer." or "I want you to memorize that my prefer search engine for people related question is duckduckgo.")

Current tools available

  • agent

    • llm-math (calculator)
    • human (meaning it can decide to ask you for stuff)
    • BigTask (ability to call sub_agent to split the task into many subtasks, each subtask has access to the tools of sub_agent)
    • files (optional, read, write, list, search, move, copy)
    • shell (optional, any command)
    • memorize (optional, if 'user' argument is set this will be used to store information about the user if explicitly asked to remember it)
  • sub_agent (= almost the same as agent but is called to handle subtasks created by BigTask and does not have access to BigTask itself, making infinite recursion using BigTask impossible)

    • llm-math
    • human
    • search related:
      • browser tools (it can use playwright to navigate the web autonomously)
      • ddg-search (quick answers via duckduckgo, no API required)
      • tavily (optional, a search engine friendly to LLM, API key is required)
      • metaphor (optional, a search engine friendly to LLM, API key is required)
      • wikipedia (quick answers via wikipedia, not the whole article)
      • arxiv
      • pubmed (buggy at the moment)
    • files (if enabled)
    • shell (if enabled)

Note that if the arugment task_tool is set to False, BigTask tool will not appear and all tools of the sub_agent will be given to the agent instead.

Things I used it for

  • Using the BigTask tool: make it search information about bioaccumulation in salmon and in tuna to compare which is worst.
  • Using the files tool: make it modify a python code to implement various enhancement (worked incredibly well!)

How to

  • to install: llm install llm-agent-plugin
  • to run: llm chat -m agent
  • Very early stage, done mostly while procrastinating work. Will improve a lot.

TODO

  • find a way to implement streaming of tokens
  • many more to come. This is highly experimental and will be substantially improved

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm-agent-plugin-0.3.1.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

llm_agent_plugin-0.3.1-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file llm-agent-plugin-0.3.1.tar.gz.

File metadata

  • Download URL: llm-agent-plugin-0.3.1.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for llm-agent-plugin-0.3.1.tar.gz
Algorithm Hash digest
SHA256 efc730b58af616d96ca18ff9ddea6974cb6b473df302e5b8a1e2e84319404672
MD5 64cb364864b6ae8450eadd0c82a29969
BLAKE2b-256 1af7285c7a7fac3ead4e97183ea3772ae7880c9b5093a4a57ddaab6ceeeb813f

See more details on using hashes here.

File details

Details for the file llm_agent_plugin-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_agent_plugin-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60e7d77657b21645b6d24990f0b2a368ea1b9ca895aa44e6da139148e74a0429
MD5 81342fef1fa17f6ba18233e40ea126d1
BLAKE2b-256 48c6b647e1e7e44fafba1a92c941a36678486739a45e8f20dea6da2731d1fe7e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page