Skip to content

Sommie09/brainy-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrainyDocs: AI-Powered Document Chat

Node.js TypeScript OpenAI Pinecone

Doc-Chat Workflow Doc-Chat Workflow

Project Overview

BrainyDocs is an AI-powered document chat application. It upload PDFs and ask questions in natural language, powered by embeddings and vector search and intelligently splits documents into overlapping chunks to give context-aware answers.

  • OpenAI text-embedding-3-small for generating embeddings
  • Pinecone as a high-performance vector database
  • TypeScript & Node.js for a clean backend

Doc-Chat Workflow

Features

  • Upload and parse PDFs
  • Convert text to vector embeddings
  • Store embeddings in Pinecone
  • Query documents with natural language
  • Chunk text intelligently for better answers

Installation

  1. Clone the repo:
git clone https://github.com/<your-username>/brainydocs.git
cd brainydocs
  1. Install dependencies:
npm install
  1. Create a .env file in the root:
OPENAI_API_KEY=your_openai_api_key
PINECONE_API_KEY=your_pinecone_api_key
PINECONE_INDEX_NAME=your_index_name

Running the Project

Ingest PDFs (generate embeddings and populate Pinecone)

npm run ingest

Chat with your documents

npm run chat

You can now type questions in the terminal and get AI-powered answers from your uploaded documents.

Project Structure

doc-chat/
├─ src/
│  ├─ ingest.ts        # PDF ingestion & embedding generation
│  ├─ chat.ts          # Interactive chat CLI
│  ├─ utils.ts         # Helper functions (chunking, embedding)
├─ docs/
│  └─ diagram.png      # Architecture diagram
├─ package.json
├─ tsconfig.json
└─ .env.example

Tips

  • Keep chunk size and overlap balanced for best results.
  • Make sure your Pinecone index dimension matches the embedding size (1536).
  • Use TypeScript’s strict mode for type-safe embeddings.

Next steps

Contributions are welcome! Open a PR or issue. Some ideas:

  • Add multi-document support
  • Improve chunking strategy

About

BrainyDocs is an AI-powered document chat application. Built with OpenAI text-embedding-3-small for generating embeddings, Pinecone as a high-performance vector database and TypeScript & Node.js for a clean backend.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors