Git Product home page Git Product logo

build-on-aws / llm-rag-vectordb-python Goto Github PK

View Code? Open in Web Editor NEW
78.0 5.0 15.0 103.45 MB

Explore sample applications and tutorials demonstrating the prowess of Amazon Bedrock with Python. Learn to integrate Bedrock with databases, use RAG techniques, and showcase experiments with langchain and streamlit.

License: MIT No Attribution

Python 19.27% HTML 0.46% CSS 0.18% JavaScript 0.76% Jupyter Notebook 63.68% Dockerfile 0.11% Shell 0.13% TypeScript 15.41%
amazon-bedrock langchain-python llms node-js python3 rag

llm-rag-vectordb-python's Introduction

GitHub stars GitHub license

โ˜๏ธ๐Ÿ Getting started with Amazon Bedrock, RAG, and Vector database in Python

๐Ÿ” Introduction

In this repository, you'll find sample applications and tutorials that showcase the power of Amazon Bedrock with Python. These resources are designed to help Python developers understand how to harness Amazon Bedrock in building generative AI-enabled applications. You'll also discover how to integrate Bedrock with vector databases using RAG (Retrieval-augmented generation), and services like Amazon Aurora, RDS, and OpenSearch. Additionally, get insights into using langchain and streamlit to create applications that demonstrate your experiments effectively.

๐Ÿ“‘ Table of Contents

๐Ÿ“š๐Ÿฆœ Unified AI Q&A: Harnessing pgvector, Amazon Aurora & Amazon Bedrock

Craft sophisticated Q&A bots for specialized tasks, and experience the union of pgvector with Amazon Aurora PostgreSQL and the prowess of Titan LLMs under the RAG paradigm.

  • ๐Ÿ“– Guide & Setup
  • ๐ŸŒ  Key Features:
    • Seamless integration with Streamlit.
    • Efficient backend with Amazon Bedrock and Aurora.

Preview

๐Ÿš€ Integrated Fullstack Showcase

Harness the power of Stable Diffusion AI using Amazon Bedrock.

  • ๐Ÿ–ฅ Live Demo
  • ๐Ÿ“– Guide & Setup
  • ๐ŸŒ  Key Features:
    • Seamless integration: Lambda, API Gateway, Bedrock, Amplify
    • Deployment via Serverless stack.

Showcase

๐Ÿ“„ Resume Screening App

Streamline resume screening based on specific job descriptions.

  • ๐Ÿ“– Guide & Setup
  • ๐ŸŒ  Key Features:
    • Seamless integration with Streamlit.
    • Efficient backend with Amazon Bedrock and Aurora.

Screening

๐Ÿค Building Bonds

Revolutionize introductions by fetching LinkedIn profiles and generating engaging summaries.

  • ๐Ÿ“– Guide & Setup
  • ๐ŸŒ  Key Features:
    • Instant LinkedIn profile retrieval.
    • Automated summaries & ice-breakers via Amazon Bedrock and LangChain.

Bonds

๐Ÿ“Š Data Analysis Tool

Analyze CSV data with a streamlined Streamlit application.

  • ๐Ÿ“– Guide & Setup
  • ๐ŸŒ  Key Features:
    • Smooth UI with Streamlit.
    • Advanced functions via Langchain.

Analysis

๐Ÿฅ˜ Instant Recipe Generator

Build a streamlined Streamlit application to generate recipes given an image of all the ingredients.

  • ๐Ÿ“– Guide & Setup
  • ๐ŸŒ  Key Features:
    • Smooth web application interface via Streamlit.
    • Advanced functionalities through Langchain.
    • Integration with Hugging Face.
    • Generative AI applications with Amazon Bedrock.

Recipe

๐Ÿ’ผ Getting Started

  1. ๐Ÿ“ฅ Clone this repository.
  2. ๐Ÿ—‚ Navigate to the desired project directory:
  3. ๐Ÿ”ง Set up a virtual environment, .env files, and install dependencies as outlined in each README.
  4. ๐Ÿš€ Launch the desired Streamlit app and delve in!

๐Ÿ”’ Security

See more on security.

๐Ÿ“œ License

Licensed under the MIT-0 License. View License.

llm-rag-vectordb-python's People

Contributors

amazon-auto avatar debnsuma 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

llm-rag-vectordb-python's Issues

searching-from-my-data : ValueError: invalid literal for int() with base 10: 'None'

Traceback:


File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/app.py", line 284, in <module>
    main()
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/app.py", line 267, in main
    st.session_state.conversation = get_conversation_chain(get_vectorstore(None), selected_llm)
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/app.py", line 75, in get_vectorstore
    raise e  # Raise the exception to see the actual error
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/app.py", line 69, in get_vectorstore
    return PGVector(
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/langchain/vectorstores/pgvector.py", line 126, in __init__
    self.__post_init__()
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/langchain/vectorstores/pgvector.py", line 134, in __post_init__
    self._conn = self.connect()
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/langchain/vectorstores/pgvector.py", line 151, in connect
    engine = sqlalchemy.create_engine(self.connection_string)
File "<string>", line 2, in create_engine
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned
    return fn(*args, **kwargs)  # type: ignore[no-any-return]
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 548, in create_engine
    u = _url.make_url(url)
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 838, in make_url
    return _parse_url(name_or_url)
File "/var/www/python/llm-rag-vectordb-python/searching-from-my-data/data-search-env/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 899, in _parse_url
    components["port"] = int(components["port"])

env

PGVECTOR_DRIVER='psycopg2'
PGVECTOR_USER='postgres'
PGVECTOR_PASSWORD='12345'
PGVECTOR_HOST='postdemo124.cluster-ch7t2d1ht3ag.us-east-1.rds.amazonaws.com'
PGVECTOR_PORT=5432
PGVECTOR_DATABASE='table1'

app.py

CONNECTION_STRING = PGVector.connection_string_from_db_params(
    driver=os.environ.get("PGVECTOR_DRIVER"),
    user=os.environ.get("PGVECTOR_USER"),
    password=os.environ.get("PGVECTOR_PASSWORD"),
    host=os.environ.get("PGVECTOR_HOST"),
    port=os.environ.get("PGVECTOR_PORT"), 
    database=os.environ.get("PGVECTOR_DATABASE")
)

Currently using SQLAlchemy 2.0.23 , psycopg 3.1.10

tried to cast the port to int
port=int(os.environ.get("PGVECTOR_PORT", 5432)),
It throws Can't load plugin: sqlalchemy.dialects:postgresql.None

image

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.