Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: lexiforest
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 10.7 KB
Statistics
  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.md

🐻 Ragbear

ragbear, short for RAG Bear, is an academic oriented RAG framework for building retrieval enhanced applications.

Why

existing solutions are too heavy.

But RAG should be simple, as simple as the following lines of code:

```py DEFAULT_PROMPT = """Please answer the question according to the references.

Question: {question}

References: {docs} """

question = "Has tiktok been banned in the US?"

docs = get_docs(question)

prompt = DEFAULT_PROMPT.format(question=question, "\n".join(docs))

completion = openai.chat.completion.create({..., prompt, ...})

print(completion.choices[0].message.content) ```

With ragbear, it's even simpler:

py ragbear.query("Has tiktok been banned in the US?")

But a lot fancier, too:

py ragbear.query( "Who is the father of Luke Skywalker?", model="http://localhost:8964", source=[ {"data": "http://localhost:8888", "type": "meilisearch"}, # query a meilisearch database ], rerank="newest", rewrite="query2doc", template=template, )

But you will need to optimize towards your academic or commercial goals, you need a framework.

Enter Ragbear, we follow the above pattern closely, but give you options to swap each parts of the pipeline. The code is concise and straightforward, no useless wrappers around wrappers. Just read it.

Unlike LangChain, we do not try to encapsulate every solution out there, because there is actually not too much to wrap at all. We would like to call ragbear a patter, rather than a framework.

Implemented algorithms

With ragbear, we want to incorporate the latest research ideas and put it into production. We have implemented the following algorithms, which you can easily apply in your app.

  • HyDE
  • REPLUG
  • Query2Doc

For example, to use the REPLUG method, it's as easy as:

```py import ragbear

ans = ragbear.query("Where was Steve Jobs born?", rewrite="replug") ```

Data

We support the following data query backend

  • DuckDuckGo, via python package duckduckgo_search
  • Local Dataset, via ANN engines, aks vector databases
    • hnswlib + sqlite
    • faiss + sqlite
    • pg_vector

Dependencies

  • An LLM API endpoint, you can use OpenAI API or local models with Ollama.
  • An data backend, use duckduckgo_search or local dataset.

Citation

If you find this project useful, please cite it as below:

@software{Lyonnet2024, author = {Alex Lyonnet, Shang Yu}, title = {RAGBear - various RAG methods implemented in one package}, year = {2024}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/oysteroil/ragbear}}, }

Owner

  • Login: lexiforest
  • Kind: user
  • Company: Riverside AI LLC

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Lyonnet"
  given-names: "Alex"
- family-names: "Yu"
  given-names: "Shang"
title: "RAGBear - various RAG methods implemented in one package"
version: 0.0.1
date-released: 2024-05-04
url: "https://github.com/oysteroil/ragbear"

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels