llama-index managed postgresml integration
Project description
LlamaIndex Managed Integration: PostgresML
PostgresML provides an all in one platform for production ready RAG applications.
Setup
First, make sure you have the latest LlamaIndex version installed and a connection string to your PostgresML database.
If you don't already have a connection string, you can get one on postgresml.org.
pip install llama-index-indices-managed-postgresml
Usage
Getting started is easy!
import os
os.environ[
"PGML_DATABASE_URL"
] = "..." # Can provide in the environment or constructor later on
from llama_index.core import Document
from llama_index.indices.managed.postgresml import PostgresMLIndex
# Create an index
index = PostgresMLIndex.from_documents(
"llama-index-test-1", [Document.example()]
)
# Connect to an index
index = PostgresMLIndex("llama-index-test-1")
You can use the index as a retriever
# Create a retriever from an index
retriever = index.as_retriever()
results = retriever.retrieve("What managed index is the best?")
print(results)
You can also use the index as a query engine
# Create an engine from an index
query_engine = index.as_query_engine()
response = retriever.retrieve("What managed index is the best?")
print(response)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for llama_index_indices_managed_postgresml-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9770d6f29fad239ca6c106dabe493d39d52ff84c791a0facd732993220524600 |
|
MD5 | 71988c88296920d4b25b116c58b85a8f |
|
BLAKE2b-256 | 836654f6e8b7070309970ed5e68c8a81a9e11aa742b7a29e1d1a625d29498a2b |
Close
Hashes for llama_index_indices_managed_postgresml-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14c9f965b7730bb257a565e0fa4a98ef767ad32ec89da08f8d2853c04ce7f02c |
|
MD5 | 918f3ecc785b8f1c7d46cc762c4471c7 |
|
BLAKE2b-256 | 463604b96befee7601d2934fda49f4e613400f96ae09e0cf973d17eea961b99b |