AI Application Starter Kit
1.0.0
A starter kit for building AI applications using Neon as a vector database.
Clone the repository:
git clone https://github.com/imabutahersiddik/AI-Application-Starter-Kit.git
cd ai-starter-kitInstall dependencies:
npm installSet up your database:
.env file in the root directory and add your database URL:
DATABASE_URL=postgres://user:password@localhost:5432/mydb
Run the application:
npm start{
"input": "Hello, how are you?"
}{
"response": "I'm doing well, thank you!"
}{
"query": "Find similar documents"
}{
"results": [
{"id": 1, "title": "Document 1", "content": "Content of document 1"},
{"id": 2, "title": "Document 2", "content": "Content of document 2"}
]
}To make requests to your endpoints using curl, you can use the following examples for both the chatbot and semantic search endpoints.
To send a POST request to the chatbot endpoint, use this command:
curl -X POST http://localhost:3000/chat
-H "Content-Type: application/json"
-d '{"input": "Hello, how are you?"}'To send a POST request to the semantic search endpoint, use this command:
curl -X POST http://localhost:3000/search
-H "Content-Type: application/json"
-d '{"query": "Find similar documents"}'-X POST: Specifies the request method as POST.http://localhost:3000/chat or http://localhost:3000/search: The URL of the endpoint.-H "Content-Type: application/json": Sets the request header to indicate that the content type is JSON.-d '{...}': The data being sent in JSON format.These commands will allow you to test your API endpoints from the command line using curl.
chatbot_responses and documents) and that the pgvector extension is installed.