Giter Site home page Giter Site logo

localagent's Introduction

Local Agent

English | 简体中文

Agent 实现

  1. 本项目探索使用 Agent 从本地文件中处理数据,进而生成复杂内容。例如,输入与特定行业相关的文档,基于此生成行业分析报告。
  2. 由于存在 token 数量的限制,我们不能将大量数据直接交由语言模型处理。传统的 embedding 数据库提供的功能相对基础,多半只能处理简单的问答情形。

原理

  1. 采用了典型的 Tasken Driven 的 Agent 结构;
  2. 使用了 OpenAI 的 function call API,以及 Langchain 的语言模型;
  3. 考虑到 embedding 数据库功能单一,只能确保任务精细化,以便语言模型可以从数据库中找到对应的数据或信息;
  4. 需要对 prompt 进行大量修改和调整,以创建足够细的任务。例如,如果在 embedding 数据库中未找到内容,可能是因为任务划分不够细致,需进行再次处理(本库未体现);
  5. Prompt 采用标准的 ReAct 形式。

待完成

  1. 实现 prompt 的 ToT (Tree of Thoughts),用以处理复杂的数据或逻辑推理问题;
  2. 自动生成 prompt。目前,根据任务调整 prompt 的工作量很大;
  3. 由于请求数多,embedchain 经常会出现 OpenAI 请求超时的问题,需要本地实现进行调整;
  4. 添加更多的工具;修改 wikipedia 的 tool;

代码实现

  1. 基于 OpenAI 和 Langchain,使用了 Chromadb 的本地数据库;
  2. 为了快速实现功能,借用了大量来自 aurelio-labs/funkagent 和 embedchain/embedchain 的代码。# Local Agent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.