Code Monkey home page Code Monkey logo

servifai's Introduction

ServifAI

A mini framework built on top of Langchain and Llamaindex to provide LLM powered Autonomous Agents as a simplified service to assist users with their tasks.

PyPI PyPI

Overview

ServifAI (Task-based Agent) = LLM + Memory + Planning + Toolbox

agent_pic

Instead of feeding all kinds of tools to a single agent and confusing it while selection, ServifAI narrows down the selection by combining only necessary tools on basis of the task at hand.

Read this article to get an overview on Agents.

Currently we only support OpenAI models. If you are privacy concerned you should apply for Azure OpenAI services. The reason for not yet supporting opensource local models are:

  • You need a lot of money - either to buy a great GPU or host it on cloud with a great GPU
  • even if you tick the first point, it won't help you much as currently opensource models are good for chat but lag behind OpenAI models in enabling complex agent workflows

Current Supported Tasks:

Tasks Toolbox Tools Required File Extensions
default DuckDuckGo + LLM Math + PAL Math None
qna_local_docs Vector Index + Knowledge Graphs PDF/DOCX

Installation

Works best with Poetry

poetry add servifai

With pip, you might have to install dependencies manually

pip install servifai

Usage

Create a .env file for openai

OPENAI_API_KEY='sk-...'

Run Python Code

from servifai import ServifAI
myagent = ServifAI()

while True:
    text_input = input("Me: ")
    if text_input == "exit":
        break
    response = myagent.chat(text_input)
    print(f'ServifAI: {response}\n')

Output

Me: I am feeling bored at home, provide me a list of places in bengaluru to chill out on a sunday.
ServifAI: Here is a list of places in Bengaluru to chill out on a Sunday:

1. Cubbon Park
2. Rasta Cafe
3. Skandagiri
4. Uttari Betta Sunrise
5. Ranganathaswamy Betta
6. Adventure Camping at Nandi Hills
7. Riverside Manchanabele
8. Caving at AntaraGange
9. Clubbing at Hard Rock Café
10. High Ultra lounge
11. Toit
12. Dinning at Empire Hotel

These are just a few options, and there are many more places in Bengaluru where you can relax and have a good time on a Sunday.

Me: Too many options for a day. Provide a itinerary instead for one day
ServifAI: Based on the search results, here is a suggested one-day itinerary for Bengaluru:

Morning: Start your day with a visit to Cubbon Park and enjoy the greenery. Join the locals on their early morning walk.

Afternoon: Indulge in a classic South Indian breakfast and then head to Savandurga, a famous place known for its temples and rock climbing.

Evening: Explore the vibrant streets of Bengaluru and visit popular spots like MG Road or Brigade Road for shopping and dining.

Night: End your day by experiencing the nightlife of Bengaluru at one of the city's popular clubs or lounges.

Please note that this is just a suggested itinerary and you can customize it based on your preferences and interests.

Me: Do you think this would be possible to complete based on today's weather?
ServifAI: Based on the weather forecast, it is possible to complete the activity you mentioned. The maximum temperature in Bengaluru is expected to be around 32 degrees Celsius today.

Me: exit

Check Examples for more.

TODO:

  • Add support for popular unstructured data formats
  • Add support for other VectorDBs
  • Add other task based tools
  • Add support for structured data formats
  • Support for OpenAI funcs

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.