{"id":18464934,"url":"https://github.com/neondatabase-labs/ask-neon","last_synced_at":"2025-10-20T06:20:07.566Z","repository":{"id":103222748,"uuid":"608265055","full_name":"neondatabase-labs/ask-neon","owner":"neondatabase-labs","description":"Chatbot: Search your own knowledge base by semantic similarity","archived":false,"fork":false,"pushed_at":"2024-01-09T16:32:17.000Z","size":2920,"stargazers_count":59,"open_issues_count":18,"forks_count":7,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-23T09:24:10.899Z","etag":null,"topics":["ai","chatbot","embeddings","openai","postgres","postgresql"],"latest_commit_sha":null,"homepage":"https://neon.tech/ai","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neondatabase-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-01T16:56:25.000Z","updated_at":"2025-02-25T17:56:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6d2a119-9f6d-4280-9cb4-bf018fee0439","html_url":"https://github.com/neondatabase-labs/ask-neon","commit_stats":null,"previous_names":["neondatabase-labs/ask-neon"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fask-neon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fask-neon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fask-neon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fask-neon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neondatabase-labs","download_url":"https://codeload.github.com/neondatabase-labs/ask-neon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804483,"owners_count":20998993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chatbot","embeddings","openai","postgres","postgresql"],"created_at":"2024-11-06T09:11:33.507Z","updated_at":"2025-10-20T06:20:02.512Z","avatar_url":"https://github.com/neondatabase-labs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgres Q\u0026A\n\n![Screen_Recording_2023-03-01_at_17_58_11_AdobeExpress (1)](https://user-images.githubusercontent.com/13738772/222217144-2c741b78-7a27-44ed-be95-6a3ee3e42cbe.gif)\n\nPostgres Q\u0026A is a project that demonstrates how to use word embeddings and Postgres to build a chatbot. The chatbot is implemented using Vercel Edge Functions and the @neondatabase/serverless driver, and relies on OpenAI's GPT-3 API to generate responses.\n\n## Getting started\n\nTo get started with this project, you'll need to have:\n\n- A Neon account, and project.\n- an API key for the OpenAI GPT API, which you can obtain from https://openai.com/.\n\nOnce you have the prerequisites installed, follow these steps to get the project up and running:\n\nClone the repository:\n\n```bash\ngit clone https://github.com/neondatabase/postgres-qa.git\ncd ask-postgres\n```\n\n## Prepare the data\n\n### Import embeddings to Neon\n\nThis section is derived from OpenAI’s cookbook example. You can use the Python code here to build a web crawler and extract the text you need to create embeddings. We’ve already created the text files based on https://www.postgresql.org/docs/, which you can find in `data/text` directory.\n\nTo get started, move to the `data` directory create a new environment and install the dependencies:\n\n```bash\ncd data\npython -m venv env\nsource env/bin/activate\npip install -r requirements.txt\n```\n\nImport the schema to your database:\n\n```bash\npsql \u003cdatabase-url\u003e -f database.sql\n```\n\nLet’s now add `DATABASE_URL` and `OPENAI_API_KEY` to our environment variables:\n\n```bash\nexport DATABASE_URL=\u003cYOUR_NEON_CONEECTION_STRING\u003e OPENAI_API_KEY=\u003cYOUR_OPENAI_API_KEY\u003e\n```\n\nRun `main.py` to import the emebbeding to your Neon database:\n\n```bash\npython main.py\n```\n\nRelax and grab a cup of coffee as this section might take 10min to process!\n\nExpcted result:\n\n```bash\nSaving to CSV...\nLoading tokenizer...\nEmbedding text...\nConnecting to database...\nDone!\n```\n\nInstall the project dependencies:\n\n```bash\ncd app\nnpm install\n```\n\nCreate a .env file\n\n```bash\ntouch .env.local\n```\n\nSet the following environment variables:\n\n```\nOPENAI_API_KEY= Your OpenAI API key.\nDATABASE_URL= The connection URL for your Neon database.\n```\n\nStart the server:\n\n```bash\nnpm run dev\n```\n\n## Contributing\n\nWe welcome contributions to this project! If you find a bug, have a suggestion, or want to contribute code, please open an issue or pull request on the GitHub repository.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneondatabase-labs%2Fask-neon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneondatabase-labs%2Fask-neon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneondatabase-labs%2Fask-neon/lists"}