Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF Upload Proof of Concept #117

Open
wants to merge 6 commits into
base: v1-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ GOOGLE_CLOUD_API_KEY=
# [Optional, Search] Google Custom/Programmable Search Engine ID
# https://programmablesearchengine.google.com/
GOOGLE_CSE_ID=

# [Optional] Pinecone API key and environment
PINECONE_API_KEY=
PINECONE_ENVIRONMENT=
PINECONE_INDEX_NAME=
PINECONE_NAME_SPACE=
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# PDF Upload Proof of Concept Using Langchain JS and Pinecone Vector Storage

## Drag and Drop PDF Files into the browser

This project allows the user to
1. Drag and drop PDF files into the browser
2. Create embeddings of the PDF files and upload them to Pinecone
3. Chat with the documents and extract useful information

It is meant to help developers who are familiar with Javascript/Typescript better leverage more advanced tooling and can serve as a bare-bones template or provide some useful code snippets to be reused.

Create a .env file based off of .env.example.

You will need `OPENAI_API_KEY`, `PINECONE_API_KEY`, `PINECONE_ENVIRONMENT`, and `PINECONE_INDEX_NAME`

`npm install`

`npm run dev`

Go to `localhost:3000/files`

Drag and drop a PDF file (or multiple PDF files) and click Upload

https://github.com/michaelcreatesstuff/big-agi-in-memory-pdf-upload-poc/assets/21146258/720bb347-3524-4194-9fc5-783c5352fb2c

Wait for the upload to finish.

Ask a question about the documents you just uploaded. This chat with the documents does not seem to cost anything.


<img width="1728" alt="chat" src="https://github.com/michaelcreatesstuff/big-agi-in-memory-pdf-upload-poc/assets/21146258/5d3ded9c-2d78-433f-acee-fdc415f1624c">





# `BIG-AGI` 🤖💬

Welcome to `big-AGI`, FKA `nextjs-chatgpt-app`. 👋🎉
Expand Down
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const nextConfig = {
config.experiments = {
asyncWebAssembly: true,
layers: true,
// https://github.com/vercel/next.js/issues/43382#issuecomment-1408989720
topLevelAwait: true,
};

return config;
Expand Down
Loading