serverless-pdf-chat  by aws-samples

Serverless app for LLM-powered PDF chat using Amazon Bedrock

created 1 year ago
284 stars

Top 93.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a serverless application for querying PDF documents using natural language, powered by LLMs. It's designed for developers and researchers looking to build AI-powered document analysis tools on AWS. The solution leverages Amazon Bedrock for LLM capabilities, LangChain for orchestration, and other AWS serverless services for a scalable and cost-effective implementation.

How It Works

The application utilizes a serverless architecture where user-uploaded PDFs are processed by AWS Lambda functions. These functions extract text, generate embeddings using Amazon Bedrock's Titan Embeddings, and store these vectors in a FAISS index within S3. When a user queries the document, another Lambda function retrieves relevant document chunks from the FAISS index and passes them, along with conversation history from DynamoDB, to an LLM (like Claude v3 Sonnet) via Amazon Bedrock for response generation.

Quick Start & Requirements

  • Install: Clone the repository, then use AWS SAM CLI for deployment (sam build, sam deploy --guided).
  • Prerequisites: AWS SAM CLI, Python 3.11+, AWS account, Amazon Bedrock model access (Titan Embeddings, Claude v3 Sonnet recommended).
  • Setup: Requires AWS account configuration and Bedrock model access approval. Deployment time varies based on AWS resource provisioning.
  • Docs: AWS Serverless Blog

Highlighted Details

  • Integrates Amazon Bedrock for serverless LLM embedding and inference.
  • Uses LangChain for orchestrating LLM Q&A chains.
  • Leverages FAISS for efficient vector search.
  • Employs DynamoDB for managing conversational memory.
  • Frontend built with React, TypeScript, TailwindCSS, and Vite, deployable via AWS Amplify Hosting.
  • Includes Amazon Cognito for user authentication.

Maintenance & Community

This is an aws-samples repository, indicating official AWS examples. Contributions are welcome via standard GitHub pull requests.

Licensing & Compatibility

Licensed under the MIT-0 License, which permits commercial use and modification without significant restrictions.

Limitations & Caveats

The application is explicitly stated as not production-ready and is intended for demonstration and educational purposes. Security configurations (e.g., API Gateway logging, IAM role scoping) require manual review and adjustment for production deployments. Sensitive data may be logged to CloudWatch by default.

Health Check
Last commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
11 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.