src/configs
Foldercp .env.example .env
OPENAI_API_KEY
in .envCreate a new Index:
Give it a name
PINECONE_INDEX_NAME
in .envSet Dimensions to exactly 1536
(required for embedding models)
Set Metric to cosine
Select the free starter
Pod Type
On the side panel, Click on "API Keys"
ENVIRONMENT
locationPINECONE_ENVIRONMENT
in .envValue
PINECONE_API_KEY
in .envgit clone https://github.com/PaulGriz/DocGobbler
pnpm install
public/docs
Directorypublic/docs
folder is reccomended because it allows Next.js to easily link to sources files.pnpm run ingest
to chuck and vectorize docs into Pincone IndexLoading X chunks into pinecone...
where "X" is the number of vectors from your docs.src/configs/ai-configs.ts
and edit the QA_TEMPLATEQA_TEMPLATE
is the "System Prompt" for the AI. Customize it to fit your documents or objective for your own goals.CONDENSE_TEMPLATE
is 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 |
public/docs
folder