npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

advent-ai

v1.1.4

Published

Advent provides easy access to your semantic kernel via HTTP API, console or WASM.

Downloads

9

Readme

Advent

Advent is a ⚡️quick start kit ⚡️for Microsoft Semantic Kernel.

Advent automatically discovery both semantic and native skills from a folder, and exposes all the discovery skills via a REST API. And Advent uses Qdrant as the persistent semantic memory.

Get Started


Install

Using your favorite Node.js package management tool(mine is pnpm), run:

pnpm i advent-ai

API server

To use Advent API server for you awesome AI app, you can put your semantic and native skills under the skills folder. Provide a simple config file call advent.json:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information"
    }
  },
  "Port": 6666,
  "Skills": [
    "./skills"
  ],
  "Models": {
    "Text": "text-davinci-003",
    "Chat": "gpt-3.5-turbo",
    "Embedding": "text-embedding-ada-002"
  },
  "Memory": {
    "Type": "Qdrant",
    "Host": "http://localhost",
    "Port": "6333"
  }
}

Make sure you have .NET Core and Qdrant installed, then run the following command to start the server:

npx advent api

The API of the server is really simple:

  • List all available skills as HAL JSON
    • GET https://localhost:6666/api/skills
  • Get detailed skill description
    • GET https://localhost:6666/api/skills/{skill}/{function}
  • Execute functions
    • POST https://localhost:6666/api/asks?iterations={iterations}

In order to execute functions, the following JSON must be provided.

{
  "variables": [
    {
      "key": "INPUT",
      "value": "...."
    }
  ],
  "pipeline": [],
  "skills": []
}

variables is an array of kay value pair, for the input to the kernel.

pipeline is the chained or piped functions would like to run. For example, the following json will run TextSkill.Uppercase and TextSkill.TrimEnd as piped functions:

{
  "variables": [
    {
      "key": "INPUT",
      "value": " lowercase"
    }
  ],
  "pipeline": [
    {
      "skill": "TextSkill",
      "name": "Uppercase"
    },
    {
      "skill": "TextSkill",
      "name": "TrimEnd"
    }
  ],
  "skills": []
}

If no functions specified, it will run PlannerSkill.CreatePlan and PlannerSkill.ExecutePlan by default (a.k.a, archive goal). And the iterations query parameter will be used to determine how many times should the kernel try before the plan execute successfully.

skills indicates which skills will be used during the execution. Since the planner tend to use most of the available functions, the result plan might be too long. And can't fit within the token limits. Then skills could be used to tell the kernel exactly which skills should the plan be based on.

Every API call should provide OpenAI API key via HTTP headers:

| Header | | |------------------------------|-----------------------------------------| | x-advent-text-completion-key | OpenAI API key for text completion | | x-advent-chat-completion-key | OpenAI API key for chat completion | | x-advent-embedding-key | OpenAI API key for embedding generation |

And if you use the same key for different purposes, you only need to provide x-advent-text-completion-key.

Embeddings indexing

Semantic memory with "embeddings" is growing in popularity when a set of documents needed to be provide for LLM. To index documents, run the following command:

npx advent index <path to folder> -c <collection name> -i .md .txt 

That's it. Have fun with AI 🧗‍!

License


Advent is licensed under the MIT License.