https://github.com/daved01/ragcore
A library to build retrieval-augmented generation apps with just a few lines of code.
https://github.com/daved01/ragcore
artificial-intelligence development large-language-models machine-learning retrieval-augmented-generation
Last synced: 3 months ago
JSON representation
A library to build retrieval-augmented generation apps with just a few lines of code.
- Host: GitHub
- URL: https://github.com/daved01/ragcore
- Owner: daved01
- License: mit
- Created: 2023-08-07T15:52:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-13T12:39:24.000Z (3 months ago)
- Last Synced: 2026-03-14T01:21:51.776Z (3 months ago)
- Topics: artificial-intelligence, development, large-language-models, machine-learning, retrieval-augmented-generation
- Language: Python
- Homepage: https://daved01.github.io/ragcore/
- Size: 3.42 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# RAG Core
A Retrieval-Augmented Generation library with a CLI interface. Build RAG applications with just a few commands and a configuration file.
## Supported setups
| Databases | LLMs | Embeddings | Document types |
| ----------------------- | -------------- | -------------- | --------------- |
| Chroma (local) | OpenAI | OpenAI | PDF |
| Pinecone (remote) | AzureOpenAI | AzureOpenAI | |
For more details see the [documentation](https://daved01.github.io/ragcore/).
# Installation
To install, run
```bash
pip install ragcore
```
or clone and build from source
```bash
git clone https://github.com/daved01/ragcore.git
cd ragcore
pip install .
```
If everything worked, running
```bash
ragcore -h
```
should show you some information about `ragcore`.
# A Simple Example
To build an application with OpenAI or AzureOpenAI LLMs and embeddings, and a local database, first set your OpenAI [API key](https://platform.openai.com/api-keys) as described [here](https://platform.openai.com/docs/quickstart/step-2-setup-your-api-key):
```bash
export OPENAI_API_KEY=[your token]
```
Then, create a config file `config.yaml` like this in the root of your project:
```bash
database:
provider: "chroma"
number_search_results: 5
base_dir: "data/database"
splitter:
chunk_overlap: 256
chunk_size: 1024
embedding:
provider: "openai"
model: "text-embedding-model"
llm:
provider: "openai"
model: "gpt-model"
```
And finally, create your application using this config file:
```python
from ragcore import RAGCore
app = RAGCore() # pass config= if not in root
# Upload a document "My_Book.pdf"
app.add(path="My_Book.pdf")
# Now you can ask questions
answer = app.query(query="What did the elk say?")
print(answer.content)
# List the document's title and content on which the response is based
for doc in answer.documents:
print(doc.title, " | ", doc.content)
# List all documents in the database
print(app.get_titles())
# You can delete by title
app.delete(title="My_Book")
```
And that's it! For more information, as well as an overview of supported integrations check out the [documentation](https://daved01.github.io/ragcore/).