跳到主要内容

Features and benefits

以下是Cogine的一些主要特性,更详细的介绍参见技术文档


NameDescriptionLangChainChidoriCogine
Decentralized dataUser's data are stored outside of the application and user controls its access permission from the applications
InteroperabilityOne agent can interoperate with any others even it is not developed by a same developerlimited to agents developed by a same developer and need to call API manuallylimited to agents developed by a same developer and need to call API manually
Multi-agent collaborationHas standard collaborating mechanism between User, System and AgentsNo standard mechanism and need to communicate case by case, also limited to a same developerNo standard mechanism and need to communicate case by case, also limited to a same developer
Function/Agent-level sand-boxingEvery agent and even a function can be isolated so that multi agents come from different can be running in a same memory environment safely
Conversational computingCode can talk to user, system or other agents to ask more information at any function location, the agent will be paused and continue to run when got response.
Logic-abstractionWe re-organized the whole program to make developers focused on logic of busniess and forget about the hardware, data and programing language abstraction.
Visual graph editingWe build a graph interaction which is as simple as Houdini and as powerful as any turning completed programming language.
Agent format standardWe defined a agent format standard to represent a turing completed agent program which can be loaded and runned dynamically so everyone can develop an agent to handle personal needs.some runtime in-memory agent objectsome runtime in-memory agent object
Virtual machine & Dynamical loading and runningCan load and run dynamically

与 LangChain 和 Chidori 在开发体验上的比较

基本上,在使用其它框架的时候,用户必须要全面学习Python,关注程序的结构,以及这些框架本身定义的各种复杂的类及其复杂的继承关系,然后使用这些特定的架构规则构建程序。 使用Cogine,你唯一需要关心的就是逻辑本身, 没有太多软件构造方面的负担。

First define a Story struct with editor:

std

Then define your component's input and output using the above defined struct also with editor:

std

Then define your logic flow:

std

Finally write your component's code with Lua:

fetch_top_hn.lua:

function updating()
    local story_ids = get_url("https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty")
    for i = 1, #story_ids do
        local url = string.format("https://hacker-news.firebaseio.com/v0/item/%s.json?print=pretty", story_ids[i])
        stories[i] = get_url(url)
    end
end

interpret_the_group.lua:

function updating()
    local prompt = string.format("Based on the following list of HackerNews threads, filter this list to only launches of new AI projects: %s", table_to_string(stories))
    local result = chat_completions("Please only return the result list as a RFC8259 compliant JSON format with no '\' character, no extra information", prompt)
    if result["ok"] == true then
        for i = 1, #result["content"] do
            local story = {}
            out_stories[i] = result["content"][i]
        end
    end
end

format_and_rank.lua:

function updating()
    local prompt = string.format("this list of new AI projects in markdown, ranking the most interesting projects from most interesting to least. %s", table_to_string(stories))
    local result = chat_completions("Please only return the result list as a RFC8259 compliant JSON format with no '\' character, no extra information",prompt)

    local msg = "The news with AI topics are:\n"
    if result["ok"] == true then
        for i = 1, #result["content"] do
            msg = string.format("%s%d. %s\n",msg,i,result["content"][i]["title"])
        end
    end
 
    message["content"] = msg
    message["receiver"] = "user"
end