- Turkey Facts: https://docgobbler.vercel.app/
- Tax Advice from IRS 2022 Publications: https://irs-pub-search.vercel.app/
- ✅ Chat with Multiple Documents & File Types
- ✅ API Streaming
- ✅ View Context Sources & Metadata
- ✅ Easy to Customize the Entire Project via the
src/configsFolder - ✅ Light/Dark Mode Theme Switching
- Copy the .env example file:
cp .env.example .env - Get an OpenAI API Key - Link
- Enter as
OPENAI_API_KEYin .env
- Enter as
- Make a Pinecone Account (free) - Link
Create a new Index:
-
Give it a name
- Enter as
PINECONE_INDEX_NAMEin .env
- Enter as
-
Set Dimensions to exactly
1536(required for embedding models) -
Set Metric to
cosine -
Select the free
starterPod Type
On the side panel, Click on "API Keys"
- Copy the
ENVIRONMENTlocation- Enter as
PINECONE_ENVIRONMENTin .env
- Enter as
- Reveal and Copy the
Value- Enter as
PINECONE_API_KEYin .env
- Enter as
git clone https://github.com/PaulGriz/DocGobblerpnpm install- Note: The
public/docsfolder is reccomended because it allows Next.js to easily link to sources files.
- Note: This can take a few minutes. Do not abort the command!
- You should see
Loading X chunks into pinecone...where "X" is the number of vectors from your docs.
- The
QA_TEMPLATEis the "System Prompt" for the AI. Customize it to fit your documents or objective for your own goals. - The
CONDENSE_TEMPLATEis not as important, and I'm using the standard prompt from other Langchain projects.
pnpm run dev
Use the src/configs/ folder to make this project your own!
-
ai-configs.ts: For Model Parameters, Ingest Settings, and Prompts -
ui-configs.ts: For Project Titles, UI Messages, Placeholders, and More -
metadata.ts: For the Next.js App's Metadata -
env.ts: Uses zod to validate env variables. Not needed, just used for basic type/error checking.
All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
pnpm i |
Installs dependencies |
pnpm ingest |
Chucks docs in the public/docs/ folder and uploads vectors to Pinecone |
pnpm dev |
Starts the local development server at localhost:3000 |
- Add more Langchain file loaders
- Improve metadata typing, error handling, missing data fallbacks
- Write documentation how to edit and use metadata from different file types in the
public/docsfolder - Allow users to upload files directly from the web interface
- Add an "About" Page
- Add a "Prompting Tips" Page
- Add User Authentication & Multiple Chat Histories/Sessions
- Reach out to me on Twitter: @PaulGrizII
- Submit a PR or Feature Request
- Langchain Blog on Similar Project
- Next.js Docs
