├── backend
├── src
│ ├── chain.ts
│ ├── parser.ts
│ ├── constants.ts
│ ├── ingest.ts
│ └── _index.ts
├── README.md
├── .gitignore
├── babel.config.cjs
├── tsup.config.js
├── .env.example
├── jest.env.cjs
├── .prettierrc
├── jest.config.cjs
├── tsconfig.json
├── LICENSE
├── .eslintrc.cjs
└── package.json
├── frontend
├── .prettierrc
├── .eslintrc.json
├── public
│ ├── favicon.ico
│ └── images
│ │ └── github-mark.svg
├── vercel.json
├── next.config.js
├── postcss.config.js
├── app
│ ├── utils
│ │ ├── constants.tsx
│ │ └── sendFeedback.tsx
│ ├── globals.css
│ ├── page.tsx
│ ├── components
│ │ ├── InlineCitation.tsx
│ │ ├── AutoResizeTextarea.tsx
│ │ ├── SourceBubble.tsx
│ │ ├── EmptyState.tsx
│ │ ├── ChatWindow.tsx
│ │ └── ChatMessageBubble.tsx
│ ├── layout.tsx
│ └── api
│ │ ├── get_trace
│ │ └── route.ts
│ │ ├── feedback
│ │ └── route.ts
│ │ └── chat
│ │ └── stream_log
│ │ └── route.ts
├── .env.example
├── .gitignore
├── tailwind.config.ts
├── tsconfig.json
└── package.json
├── .vscode
└── settings.json
├── assets
└── images
│ ├── Chat_Your_Data.gif
│ ├── langsmith_trace.png
│ ├── langsmith_feedback.png
│ ├── orbstack_running_chroma.png
│ └── orbstack_running_chroma_pgsql.png
├── .yarnrc.yml
├── turbo.json
├── package.json
├── LICENSE
├── .github
└── workflows
│ ├── update-index.yml
│ └── ci.yml
├── PRODUCTION.md
├── .gitignore
├── README.md
├── DEPLOYMENT.md
├── LANGSMITH.md
├── RUN_LOCALLY.md
├── CONCEPTS.md
├── MODIFY.md
└── .yarn
└── plugins
└── @yarnpkg
└── plugin-typescript.cjs
/backend/src/chain.ts:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/src/parser.ts:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/README.md:
--------------------------------------------------------------------------------
1 | # Chat LangChainJS Backend
--------------------------------------------------------------------------------
/frontend/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "endOfLine": "lf"
3 | }
4 |
--------------------------------------------------------------------------------
/frontend/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cSpell.words": [
3 | "productionized"
4 | ]
5 | }
--------------------------------------------------------------------------------
/backend/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const WEAVIATE_DOCS_INDEX_NAME = "LangChain_agent_docs";
2 |
--------------------------------------------------------------------------------
/backend/.gitignore:
--------------------------------------------------------------------------------
1 | index.cjs
2 | index.js
3 | index.d.ts
4 | index.d.cts
5 | node_modules
6 | dist
7 | .yarn
8 |
--------------------------------------------------------------------------------
/frontend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/langchain-ai/chat-langchainjs/HEAD/frontend/public/favicon.ico
--------------------------------------------------------------------------------
/frontend/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "git": {
3 | "deploymentEnabled": {
4 | "main": false
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/assets/images/Chat_Your_Data.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/langchain-ai/chat-langchainjs/HEAD/assets/images/Chat_Your_Data.gif
--------------------------------------------------------------------------------
/assets/images/langsmith_trace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/langchain-ai/chat-langchainjs/HEAD/assets/images/langsmith_trace.png
--------------------------------------------------------------------------------
/frontend/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | module.exports = nextConfig;
5 |
--------------------------------------------------------------------------------
/frontend/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/assets/images/langsmith_feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/langchain-ai/chat-langchainjs/HEAD/assets/images/langsmith_feedback.png
--------------------------------------------------------------------------------
/assets/images/orbstack_running_chroma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/langchain-ai/chat-langchainjs/HEAD/assets/images/orbstack_running_chroma.png
--------------------------------------------------------------------------------
/backend/babel.config.cjs:
--------------------------------------------------------------------------------
1 | // babel.config.js
2 | module.exports = {
3 | presets: [["@babel/preset-env", { targets: { node: true } }]],
4 | };
5 |
--------------------------------------------------------------------------------
/assets/images/orbstack_running_chroma_pgsql.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/langchain-ai/chat-langchainjs/HEAD/assets/images/orbstack_running_chroma_pgsql.png
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | nodeLinker: node-modules
2 |
3 | plugins:
4 | - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
5 | spec: "@yarnpkg/plugin-typescript"
6 |
7 | yarnPath: .yarn/releases/yarn-3.4.1.cjs
--------------------------------------------------------------------------------
/frontend/app/utils/constants.tsx:
--------------------------------------------------------------------------------
1 | const apiBasePath = process.env.VERCEL_URL
2 | ? `https://${process.env.VERCEL_URL}`
3 | : `http://localhost:3000`;
4 | export const apiBaseUrl = `${apiBasePath}/api`;
5 |
--------------------------------------------------------------------------------
/backend/tsup.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "tsup";
2 |
3 | export default defineConfig({
4 | entry: ["src/*.ts"],
5 | format: ["esm"],
6 | dts: true, // Generate declaration file (.d.ts)
7 | splitting: false,
8 | sourcemap: true,
9 | clean: true,
10 | });
--------------------------------------------------------------------------------
/frontend/.env.example:
--------------------------------------------------------------------------------
1 | # ------------------LangSmith tracing------------------
2 | LANGCHAIN_TRACING_V2=true
3 | LANGCHAIN_ENDPOINT="https://api.smith.langchain.com"
4 | LANGCHAIN_API_KEY=
5 | LANGCHAIN_PROJECT=
6 | # -----------------------------------------------------
7 |
8 | WEAVIATE_API_KEY=
9 | WEAVIATE_URL=
10 | WEAVIATE_INDEX_NAME=
11 |
12 | FIREWORKS_API_KEY=
13 |
14 | OPENAI_API_KEY=
15 |
--------------------------------------------------------------------------------
/backend/.env.example:
--------------------------------------------------------------------------------
1 | # ------------------LangSmith tracing------------------
2 | LANGCHAIN_TRACING_V2=true
3 | LANGCHAIN_ENDPOINT="https://api.smith.langchain.com"
4 | LANGCHAIN_API_KEY=
5 | LANGCHAIN_PROJECT=
6 | # -----------------------------------------------------
7 |
8 | WEAVIATE_API_KEY=
9 | WEAVIATE_URL=
10 | WEAVIATE_INDEX_NAME=
11 | FORCE_UPDATE=true
12 | RECORD_MANAGER_DB_URL=
13 | OPENAI_API_KEY=
--------------------------------------------------------------------------------
/frontend/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | body {
6 | color: #f8f8f8;
7 | background: #131318;
8 | }
9 |
10 | body input,
11 | body textarea {
12 | color: black;
13 | }
14 |
15 | a {
16 | color: #2d7bd4;
17 | }
18 |
19 | a:hover {
20 | border-bottom: 1px solid;
21 | }
22 |
23 | p {
24 | margin: 8px 0;
25 | }
26 |
27 | code {
28 | color: #ffa500;
29 | }
30 |
31 | li {
32 | padding: 4px;
33 | }
34 |
--------------------------------------------------------------------------------
/frontend/app/page.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import { v4 as uuidv4 } from "uuid";
4 | import { ChatWindow } from "../app/components/ChatWindow";
5 | import { ToastContainer } from "react-toastify";
6 |
7 | import { ChakraProvider } from "@chakra-ui/react";
8 |
9 | export default function Home() {
10 | return (
11 |