Skip to content

Agent Builder MVP Spec

DJrOf edited this page Apr 26, 2024 · 33 revisions

Current release

Our 2024-04-08 chat UI release focuses on three data models - User, Thread, Message - with the user able to select a different model per message.

Upcoming releases

We have two upcoming releases:

  • End of April - Agent Builder Phase 1
  • End of Q2 - Agent Builder Phase 2

Agent Builder Phase 1

Here we add support for Agent and File, enabling our own version of the "GPT Builder" / "GPT Store" functionality

Agents can be created with:

  • name
  • description
  • instructions
  • welcome_message

Agent HasMany Files

Files are converted to vector embeddings and added to the agent's knowledge base enabling RAG

Stretch goal: User can also add Links to an Agent's knowledge base. Links are converted to Markdown and vectorized similar to files

Agents will be listed for discovery on the OpenAgents Store along with usage stats to determine revenue share

Stretch goal #2: In addition to be being available in our UI, Agents can be interacted with via API

What the agent does behind the scenes is managed by a set of plugins/nodes operating in series to return an output given an initial input.

The necessary plugins/nodes and implementation, currently under development, are:

  • fetch plugin
  • vector plugin
  • search plugin
  • semantic routes (so that the user can use the agent via OA chat UI)

Pages needed

  • Create Agent
Screenshot 2024-04-18 alle 17 44 37

Agent Builder MVP Roadmap

Front-end

(controller+view - testing currently)

Back-end

  • Fix gRPC issue
  • Needed plugins for the RAG Agent (Search, vectorize, Fetch)
  • Add semantic routes so that the agent can be used via the chat UI

Requirements

Requirement 1

  • Get the user submitted document into a text format (likely markdown but plain text is also ok): this means:
  • defining supported formats : plaintext, pdf, url to html pages, ...?
  • write something to get the document to a text file (eg. url scraper, pdf parser etc) it doesn't matter how, as long as we get the text format out

Requirement 2

  • Figure a way to get an LLM to answer with a "fully qualified question" given a prompt and a conversation history between user and assistant

Requirement 3

Figure out how to pass large data on the events

Laravel - gRPC Connection

OpenAgents gRPC Client doc here.

Use this function and you will get the request for RAG: requestContext($poolAddress, $query, $documents = [], $k = 1, $max_tokens = 512, $overlap = 128,$encryptFor=null).

  • $poolAddress is the host
  • $query is the LLM generated rag query from the user input + chat history
  • $documents are the knowledge files (array of URLs)
  • $k is how many chunks to return
  • $max_tokens is numbers of tokens for text chunk
  • $overlap is overlap between chunks
  • $encryptForencrypts for a specific provider, so it can see it’s content

Example (max token & overlap):

Params

  • $max-token = 2
  • $overlap = 1

Res:

“The quick brown fox ” becomes “The quick” “quick brown” “brown fox”

Webhook path

/webhook/nostr

Payments

In Phase 1 we'll begin implementing the Flow of Funds plan.

Agent runs will require Agent Credit that can be purchased with Bitcoin/Lightning or credit card via Stripe.

Spent agent credit will be split into rev-share like mentioned in the Flow of Funds doc.

Pricing will be an upcharge on top of the underlying compute, with a fixed multiplier like 2x.

Stretch goal: Plugins will have their own fee set on top of compute. Alternately we push this to phase 2.

Agent Builder Phase 2

Here we add support for Run, Node, Flow, Plugin via a drag-and-drop editor.

Detailed explanation of Agent Builder phase 2 here.