| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository |
| route-controller | files |
| route-action | disambiguate |
| fetch-nonce | v2:c197d82d-da25-28a0-359d-1ee3e740ccbc |
| current-catalog-service-hash | f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb |
| request-id | 969E:FC5BE:1A6FB0F:230E375:6B0155E2 |
| html-safe-nonce | e047e67113f2e6098145a9a4927a982adf2ae8e64b928a8a348fcfc6221eb771 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjlFOkZDNUJFOjFBNkZCMEY6MjMwRTM3NTo2QjAxNTVFMiIsInZpc2l0b3JfaWQiOiIzMjczNDIzNjQ1ODYyNjE0NDk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 987983b7f97acd2cefee8541c314bdab02932da9c18f51e5582d240e54b9b2f0 |
| hovercard-subject-tag | repository:1450458788 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | // |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/marcelgood/rag-example |
| twitter:image | https://opengraph.githubassets.com/110caaca657161fbde5becb5ef347490da97629968cc450802d9f12a65e56d8e/marcelgood/rag-example |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/110caaca657161fbde5becb5ef347490da97629968cc450802d9f12a65e56d8e/marcelgood/rag-example |
| og:image:alt | A step-by-step RAG learning project in Node.js and TypeScript: document search (vector, hybrid, re-ranking), text-to-SQL, evals, MCP servers, the Vercel AI SDK and LangChain, plus sign-in and multi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-cache |
| go-import | github.com/marcelgood/rag-example git https://github.com/marcelgood/rag-example.git |
| octolytics-dimension-user_id | 1584834 |
| octolytics-dimension-user_login | marcelgood |
| octolytics-dimension-repository_id | 1450458788 |
| octolytics-dimension-repository_nwo | marcelgood/rag-example |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1450458788 |
| octolytics-dimension-repository_network_root_nwo | marcelgood/rag-example |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/marcelgood/rag-example#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmarcelgood%2Frag-example |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmarcelgood%2Frag-example |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=marcelgood%2Frag-example |
| Reload | https://github.com/marcelgood/rag-example |
| Reload | https://github.com/marcelgood/rag-example |
| Reload | https://github.com/marcelgood/rag-example |
| marcelgood | https://github.com/marcelgood |
| rag-example | https://github.com/marcelgood/rag-example |
| Code | https://github.com/marcelgood/rag-example |
| Issues | https://github.com/marcelgood/rag-example/issues |
| Pull requests | https://github.com/marcelgood/rag-example/pulls |
| Actions | https://github.com/marcelgood/rag-example/actions |
| Projects | https://github.com/marcelgood/rag-example/projects |
| Security and quality | https://github.com/marcelgood/rag-example/security |
| Insights | https://github.com/marcelgood/rag-example/pulse |
| https://github.com/marcelgood/rag-example |
| rag-example | https://github.com/marcelgood/rag-example |
| Notifications | https://github.com/login?return_to=%2Fmarcelgood%2Frag-example |
| Fork0 (0) | https://github.com/login?return_to=%2Fmarcelgood%2Frag-example |
| Star0 (0) | https://github.com/login?return_to=%2Fmarcelgood%2Frag-example |
| anthropic | https://github.com/topics/anthropic |
| better-auth | https://github.com/topics/better-auth |
| claude | https://github.com/topics/claude |
| embeddings | https://github.com/topics/embeddings |
| evals | https://github.com/topics/evals |
| hybrid-search | https://github.com/topics/hybrid-search |
| lancedb | https://github.com/topics/lancedb |
| langchain | https://github.com/topics/langchain |
| llm | https://github.com/topics/llm |
| mcp | https://github.com/topics/mcp |
| model-context-protocol | https://github.com/topics/model-context-protocol |
| multi-tenancy | https://github.com/topics/multi-tenancy |
| nodejs | https://github.com/topics/nodejs |
| ollama | https://github.com/topics/ollama |
| rag | https://github.com/topics/rag |
| reranking | https://github.com/topics/reranking |
| retrieval-augmented-generation | https://github.com/topics/retrieval-augmented-generation |
| text-to-sql | https://github.com/topics/text-to-sql |
| typescript | https://github.com/topics/typescript |
| vercel-ai-sdk | https://github.com/topics/vercel-ai-sdk |
| Readme | https://github.com/marcelgood/rag-example#readme-ov-file |
| Activity | https://github.com/marcelgood/rag-example/activity |
| 0 forks | https://github.com/marcelgood/rag-example/forks |
| Report repository | https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fmarcelgood%2Frag-example&report=marcelgood+%28user%29 |
| Branches | https://github.com/marcelgood/rag-example/branches |
| Tags | https://github.com/marcelgood/rag-example/tags |
| https://github.com/marcelgood/rag-example/branches |
| https://github.com/marcelgood/rag-example/tags |
| 11 Commits | https://github.com/marcelgood/rag-example/commits/main/ |
| https://github.com/marcelgood/rag-example/commits/main/ |
| bin | https://github.com/marcelgood/rag-example/tree/main/bin |
| bin | https://github.com/marcelgood/rag-example/tree/main/bin |
| data | https://github.com/marcelgood/rag-example/tree/main/data |
| data | https://github.com/marcelgood/rag-example/tree/main/data |
| db | https://github.com/marcelgood/rag-example/tree/main/db |
| db | https://github.com/marcelgood/rag-example/tree/main/db |
| evals | https://github.com/marcelgood/rag-example/tree/main/evals |
| evals | https://github.com/marcelgood/rag-example/tree/main/evals |
| src | https://github.com/marcelgood/rag-example/tree/main/src |
| src | https://github.com/marcelgood/rag-example/tree/main/src |
| .env.example | https://github.com/marcelgood/rag-example/blob/main/.env.example |
| .env.example | https://github.com/marcelgood/rag-example/blob/main/.env.example |
| .gitattributes | https://github.com/marcelgood/rag-example/blob/main/.gitattributes |
| .gitattributes | https://github.com/marcelgood/rag-example/blob/main/.gitattributes |
| .gitignore | https://github.com/marcelgood/rag-example/blob/main/.gitignore |
| .gitignore | https://github.com/marcelgood/rag-example/blob/main/.gitignore |
| .node-version | https://github.com/marcelgood/rag-example/blob/main/.node-version |
| .node-version | https://github.com/marcelgood/rag-example/blob/main/.node-version |
| README.md | https://github.com/marcelgood/rag-example/blob/main/README.md |
| README.md | https://github.com/marcelgood/rag-example/blob/main/README.md |
| package-lock.json | https://github.com/marcelgood/rag-example/blob/main/package-lock.json |
| package-lock.json | https://github.com/marcelgood/rag-example/blob/main/package-lock.json |
| package.json | https://github.com/marcelgood/rag-example/blob/main/package.json |
| package.json | https://github.com/marcelgood/rag-example/blob/main/package.json |
| tsconfig.json | https://github.com/marcelgood/rag-example/blob/main/tsconfig.json |
| tsconfig.json | https://github.com/marcelgood/rag-example/blob/main/tsconfig.json |
| README | https://github.com/marcelgood/rag-example |
| https://github.com/marcelgood/rag-example#rag-example-in-nodejs |
| Ollama | https://ollama.com |
| https://github.com/marcelgood/rag-example#contents |
| How RAG works | https://github.com/marcelgood/rag-example#how-rag-works |
| The pieces | https://github.com/marcelgood/rag-example#the-pieces |
| Files | https://github.com/marcelgood/rag-example#files |
| Setup | https://github.com/marcelgood/rag-example#setup |
| Ask questions | https://github.com/marcelgood/rag-example#ask-questions |
| Things to try | https://github.com/marcelgood/rag-example#things-to-try |
| Part 2: questions over a relational database (text-to-SQL) | https://github.com/marcelgood/rag-example#part-2-questions-over-a-relational-database-text-to-sql |
| Part 3: evaluating answer quality (evals) | https://github.com/marcelgood/rag-example#part-3-evaluating-answer-quality-evals |
| The three parts of an eval | https://github.com/marcelgood/rag-example#the-three-parts-of-an-eval |
| What gets measured | https://github.com/marcelgood/rag-example#what-gets-measured |
| hit@k and MRR | https://github.com/marcelgood/rag-example#the-retrieval-measures-explained |
| How to use it | https://github.com/marcelgood/rag-example#how-to-use-it |
| Next step: an LLM as the grader | https://github.com/marcelgood/rag-example#next-step-an-llm-as-the-grader |
| Part 4: the database tools as an MCP server | https://github.com/marcelgood/rag-example#part-4-the-database-tools-as-an-mcp-server |
| Purpose-built tools instead of SQL | https://github.com/marcelgood/rag-example#purpose-built-tools-instead-of-sql |
| Run it | https://github.com/marcelgood/rag-example#run-it |
| What the eval showed | https://github.com/marcelgood/rag-example#what-the-eval-showed |
| Use the server from Claude Code | https://github.com/marcelgood/rag-example#use-the-server-from-claude-code |
| Part 5: the tool loop with the Vercel AI SDK | https://github.com/marcelgood/rag-example#part-5-the-tool-loop-with-the-vercel-ai-sdk |
| Two ways to use it | https://github.com/marcelgood/rag-example#two-ways-to-use-it |
| What the AI SDK does for you | https://github.com/marcelgood/rag-example#what-the-ai-sdk-does-for-you |
| Other options | https://github.com/marcelgood/rag-example#other-options |
| Part 6: authentication and multi-tenancy | https://github.com/marcelgood/rag-example#part-6-authentication-and-multi-tenancy |
| How a question flows | https://github.com/marcelgood/rag-example#how-a-question-flows |
| Run it | https://github.com/marcelgood/rag-example#run-it-1 |
| Where the tenant is enforced | https://github.com/marcelgood/rag-example#where-the-tenant-is-enforced |
| The tokens | https://github.com/marcelgood/rag-example#the-tokens |
| What the eval checks | https://github.com/marcelgood/rag-example#what-the-eval-checks |
| What a production system adds | https://github.com/marcelgood/rag-example#what-a-production-system-adds |
| Part 7: better document search with LangChain | https://github.com/marcelgood/rag-example#part-7-better-document-search-with-langchain |
| Four ways to find chunks | https://github.com/marcelgood/rag-example#four-ways-to-find-chunks |
| Try it | https://github.com/marcelgood/rag-example#try-it |
| What the eval showed | https://github.com/marcelgood/rag-example#what-the-eval-showed-1 |
| What LangChain did here | https://github.com/marcelgood/rag-example#what-langchain-did-here |
| https://github.com/marcelgood/rag-example#how-rag-works |
| https://github.com/marcelgood/rag-example#the-pieces |
| https://github.com/marcelgood/rag-example#files |
| https://github.com/marcelgood/rag-example#setup |
| ollama.com/download | https://ollama.com/download |
| https://github.com/marcelgood/rag-example#ask-questions |
| https://github.com/marcelgood/rag-example#things-to-try |
| https://github.com/marcelgood/rag-example#part-2-questions-over-a-relational-database-text-to-sql |
| https://github.com/marcelgood/rag-example#part-3-evaluating-answer-quality-evals |
| https://github.com/marcelgood/rag-example#the-three-parts-of-an-eval |
| https://github.com/marcelgood/rag-example#what-gets-measured |
| https://github.com/marcelgood/rag-example#the-retrieval-measures-explained |
| https://github.com/marcelgood/rag-example#how-to-use-it |
| https://github.com/marcelgood/rag-example#next-step-an-llm-as-the-grader |
| https://github.com/marcelgood/rag-example#part-4-the-database-tools-as-an-mcp-server |
| Model Context Protocol | https://modelcontextprotocol.io |
| https://github.com/marcelgood/rag-example#purpose-built-tools-instead-of-sql |
| https://github.com/marcelgood/rag-example#run-it |
| https://github.com/marcelgood/rag-example#what-the-eval-showed |
| https://github.com/marcelgood/rag-example#use-the-server-from-claude-code |
| https://github.com/marcelgood/rag-example#part-5-the-tool-loop-with-the-vercel-ai-sdk |
| Vercel AI SDK | https://ai-sdk.dev |
| https://github.com/marcelgood/rag-example#two-ways-to-use-it |
| https://github.com/marcelgood/rag-example#what-the-ai-sdk-does-for-you |
| https://github.com/marcelgood/rag-example#other-options |
| https://github.com/marcelgood/rag-example#part-6-authentication-and-multi-tenancy |
| https://github.com/marcelgood/rag-example#how-a-question-flows |
| https://github.com/marcelgood/rag-example#run-it-1 |
| better-auth | https://www.better-auth.com |
| Hono | https://hono.dev |
| https://github.com/marcelgood/rag-example#where-the-tenant-is-enforced |
| https://github.com/marcelgood/rag-example#the-tokens |
| scrypt | https://en.wikipedia.org/wiki/Scrypt |
| https://github.com/marcelgood/rag-example#what-the-eval-checks |
| https://github.com/marcelgood/rag-example#what-a-production-system-adds |
| https://github.com/marcelgood/rag-example#part-7-better-document-search-with-langchain |
| LangChain | https://js.langchain.com |
| https://github.com/marcelgood/rag-example#four-ways-to-find-chunks |
| BM25 | https://en.wikipedia.org/wiki/Okapi_BM25 |
| https://github.com/marcelgood/rag-example#try-it |
| https://github.com/marcelgood/rag-example#what-the-eval-showed-1 |
| Part 3 | https://github.com/marcelgood/rag-example#the-retrieval-measures-explained |
| https://github.com/marcelgood/rag-example#what-langchain-did-here |
| anthropic | https://github.com/topics/anthropic |
| better-auth | https://github.com/topics/better-auth |
| claude | https://github.com/topics/claude |
| embeddings | https://github.com/topics/embeddings |
| evals | https://github.com/topics/evals |
| hybrid-search | https://github.com/topics/hybrid-search |
| lancedb | https://github.com/topics/lancedb |
| langchain | https://github.com/topics/langchain |
| llm | https://github.com/topics/llm |
| mcp | https://github.com/topics/mcp |
| model-context-protocol | https://github.com/topics/model-context-protocol |
| multi-tenancy | https://github.com/topics/multi-tenancy |
| nodejs | https://github.com/topics/nodejs |
| ollama | https://github.com/topics/ollama |
| rag | https://github.com/topics/rag |
| reranking | https://github.com/topics/reranking |
| retrieval-augmented-generation | https://github.com/topics/retrieval-augmented-generation |
| text-to-sql | https://github.com/topics/text-to-sql |
| typescript | https://github.com/topics/typescript |
| vercel-ai-sdk | https://github.com/topics/vercel-ai-sdk |
| Readme | https://github.com/marcelgood/rag-example#readme-ov-file |
| Activity | https://github.com/marcelgood/rag-example/activity |
| 0 forks | https://github.com/marcelgood/rag-example/forks |
| Report repository | https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fmarcelgood%2Frag-example&report=marcelgood+%28user%29 |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |