-
Clone the Repository:
- Clone the Couchbase-Ollama repository to your local machine.
-
Install Dependencies:
- Run
npm install
to install all project dependencies.
- Run
-
Environment Variables:
- Create a
.env
file based on the.env.example
provided. - Define the following environment variables in the
.env
file:DB_CONN_STR
: Connection string for Couchbase.DB_USERNAME
: Username for Couchbase.DB_PASSWORD
: Password for Couchbase.DB_BUCKET
: Name of the Couchbase bucket.DB_SCOPE
: Name of the Couchbase scope.DB_COLLECTION
: Name of the Couchbase collection.INDEX_NAME
: Name of the index in Couchbase.
- Create a
-
Set Ollama API URL:
- Set the Ollama API URL in the
.env
file.OLLAMA_URL=http://localhost:11434
- Set the Ollama API URL in the
-
Feed Documents to the Vector DB:
- Run
npm run feed
to scan all PDF files in the documents directory and create a database directory.
- Run
-
Ask the AI Some Questions:
- Use the
query.ts
script to ask questions to the AI model.npm run query "How many people work at Mercadona?"
- Use the
-
Run the Project:
- Start the project by running the necessary scripts and commands.
- Node.js
- Couchbase
- Hugging Face Transformers
- Langchain Community
- TypeScript
- The project allows users to interact with a database of documents and query the AI model for answers to their questions.
- Refer to the specific scripts and commands mentioned in the project for different functionalities.
- dotenv
- couchbase
- @langchain/community
- @xenova/transformers
- hnswlib-node
- langchain
- pdf-parse
- If you wish to contribute to the project, feel free to fork the repository, make your changes, and submit a pull request for review.