Git Product home page Git Product logo

idinsight / aaq-core Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 4.0 35.35 MB

Trustworthy question-answering AI plugin for chatbots in the social sector with advanced content performance analysis.

Home Page: https://ask-a-question.com

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 0.47% Python 68.28% Mako 0.07% Shell 0.04% Makefile 0.86% CSS 0.71% TypeScript 26.67% JavaScript 0.01% HCL 2.91%
faq faq-chatbot faq-system fastapi guardrails llms mkdocs-material rag react

aaq-core's Introduction

logo logo

Developer Docs | Features | Usage | Architecture | Funders and Partners

Ask A Question is a free and open-source tool created to help non-profit organizations, governments in developing nations, and social sector organizations use Large Language Models for responding to citizen inquiries in their native languages.

πŸ€Έβ€β™€οΈ Features

❓ LLM-powered search

Match your questions to content in the database using embeddings from LLMs.

πŸ€– LLM responses

Craft a custom reponse to the question using LLM chat and the content in your database

πŸ”Œ Integrate with your own chatbot

Connect to your own chatbot on platforms like Turn.io, Glific, and Typebot using our APIs.

πŸ“š Manage content

Use the AAQ App to add, edit, and delete content in the database (Sign up for a demo here)

🚨 Message Triaging

Identify urgent or important messages based on your own criteria.

πŸ§‘β€πŸ’Ό Content manager dashboard

See which content is the most sought after, the kinds of questions that receive poor feedback, identify missing content, and more

🚧 Upcoming

πŸ’¬ Conversation capability

Refine or clarify your question through conversation

πŸ“Ή Multimedia content

Respond with not just text but voice, images, and videos as well.

πŸ§‘β€πŸ’» Engineering dashboard

Monitor uptime, response rates, throughput HTTP reponse codes and more

Note

Looking for other features? Please raise an issue with [FEATURE REQUEST] before the title.

Usage

To get answers from your database of contents, you can use the /search endpoint. This endpoint returns the following:

  • Search results: Finds the most similar content in the database using cosine distance between embeddings.
  • (Optionally) LLM generated response: Crafts a custom response using LLM chat using the most similar content.

See docs or API docs for more details and other API endpoints.

❓ Simple content search

curl -X 'POST' \
  'https://[DOMAIN]/api/search' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <BEARER TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "query_text": "how are you?",
  "generate_llm_response": false,
  "query_metadata": {}
}'

πŸ€– With LLM response

The query looks the same as above, except generate_llm_response is set to true:

curl -X 'POST' \
  'https://[DOMAIN]/api/search' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <BEARER TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "query_text": "this is my question",
  "generate_llm_response": true,
  "query_metadata": {}
}'

πŸ“š Manage content

You can access the admin console at

https://[DOMAIN]/

Architecture

We use docker-compose to orchestrate containers with a reverse proxy that manages all incoming traffic to the service. The database and LiteLLM proxy are only accessed by the core app.

Flow

Documentation

See here for full documentation.

Funders and Partners

google_dot_org

aaq-core's People

Contributors

amiraliemami avatar dependabot[bot] avatar kristini-ho avatar lickem22 avatar markbotterill avatar mustafaakolawala avatar sidravi1 avatar suzinyou avatar tanmay-97 avatar tonyzhao6 avatar yvonnegitau avatar ziakhan04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aaq-core's Issues

[DMP 2024]: Voice API

Ticket Contents

Description

[Provide a brief description of the feature, including why it is needed and what it will accomplish.]
Ask A Question is a free and open-source tool created to help non-profit organizations, governments in developing nations, and social sector organizations utilize Large Language Models for responding to citizen inquiries in their native languages.

Create new voice response API: the API will allow users to send questions and receive responses from AAQ using voice notes. This will increase the accessibility of AAQ to users for whom speaking/listening is easier than writing/reading.

Goals & Mid-Point Milestone

Goals

By mid-point

  • Develop an API endpoint in AAQ for sending queries in text and receiving responses in voice (text-to-speech, TTS). The first iteration may use an external TTS API
  • Develop a TTS service for AAQ using an open-source model that can replace an external TTS API

By project end

  • Develop an API endpoint for sending questions as voice notes and receiving responses as voice notes (speech-to-text, text-to-speech)
  • Integrate the TTS service into AAQ infrastructure on AWS
  • Publish a short blog post on AAQ website about the changes

For every goal listed, there will be a few rounds of design-feedback-implementation with support from the mentors and wider AAQ team.

Setup/Installation

AAQ contribution guide is here: https://idinsight.github.io/aaq-core/develop/contributing/

You will be given access to our testing environment on AWS.

Expected Outcome

  1. AAQ users can query the voice endpoints for voice questions and/or voice response. This can be seamlessly integrated into AAQ’s chat flow manager of choice, Typebot.io.
  2. AAQ users have an option to use an open-source TTS/STT model instead of an external API.

Acceptance Criteria

No response

Implementation Details

You will build the APIs in our core_backend component, which is built in Python, using FastAPI.

Our database is PostgreSQL + pgvector for managing document embeddings (contents) as well as other transactional data.

For the TTS/STT service that serves open-sourced models, you will make it as platform-agnostic as possible, which often means using Docker, but the integration will be to AWS, as our demo environment sits in AWS. You will be able to lead the architecture design for such a service. Of course, our mentors and the wider AAQ team will be available to support and think it through together.

Mockups/Wireframes

No response

Product Name

Ask A Question

Organisation Name

IDinsight

Domain

Open Source Library

Tech Skills Needed

AWS, Database, Python

Mentor(s)

@amiraliemami @lickem22 are Data Scientists at IDinsight!

Category

API, Backend, Database, Delpoyment, AI

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.