Skip to content

Commit 725071b

Browse files
authored
πŸ“– DOC: git synced memory (#37)
1 parent 8d439e2 commit 725071b

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: 'Deploy Memory to Langbase'
3+
description: "Deploy a memory on Langbase using the BaseAI CLI."
4+
tags:
5+
- baseai
6+
- auth
7+
- langbase
8+
- deploy
9+
- memory
10+
section: 'Deployment'
11+
published: 2024-09-24
12+
modified: 2024-09-24
13+
---
14+
15+
# Deploy Memory to Langbase
16+
17+
Deploy a memory on [Langbase](https://langbase.com/) using the BaseAI CLI. Before you deploy a memory, make sure you are [authenticated](/docs/deployment/authentication) with the BaseAI CLI.
18+
19+
---
20+
21+
## Deploy a memory
22+
23+
Pass the memory name to the `deploy` command using the `--memory` flag or `-m` for short.
24+
25+
```bash
26+
npx baseai@latest deploy -m <memory-name>
27+
```
28+
29+
Single memory deploy follows the [deploy Workflow](/docs/deployment/deploy#deployment-workflow).
30+
31+
---
32+
33+
## Overwrite an existing memory
34+
35+
Overwrite an existing memory on Langbase using the `--overwrite` flag or `-o` for short.
36+
37+
```bash
38+
npx baseai@latest deploy -m <memory-name> -o
39+
```
40+
41+
For the git synced memory, `-o` is neglected and the new changes are pushed to the Langbase memory.
42+
43+
---
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: 'Create Memory from Git Repository'
3+
description: "Create a memory from a git repository using BaseAI CLI."
4+
tags:
5+
- baseai
6+
- memory
7+
- git
8+
- langbase
9+
section: 'Memory'
10+
published: 2024-10-08
11+
modified: 2024-10-08
12+
---
13+
14+
# Create a Memory from git Repository
15+
16+
Create a memory from a git repository using BaseAI CLI.
17+
18+
---
19+
20+
## Step #1 Create memory in your existing git repository
21+
22+
Create a new memory using the `memory` command in root of project. It will ask you for name and description of the memory.
23+
24+
Let's use the name `chat-with-repo` for this example.
25+
26+
```bash
27+
npx baseai@latest memory
28+
```
29+
30+
## Step #2 Allow memory to track git repository
31+
32+
It will also prompt you if you want to create a memory from the current project git repository. Select `yes`.
33+
```
34+
Do you want to create memory from current project git repository? (yes/no) yes
35+
```
36+
37+
## Step #3 Provide directory
38+
39+
Next, it will ask you which directory or subdirectory you want to use for the memory. You can select the current directory or any subdirectory.
40+
41+
```
42+
Enter the path to the directory to track (relative to current directory):
43+
```
44+
45+
Provide the path relative to the root of the project directory that you want to use for the memory. E.g., `src/content/docs`, to use the `docs` directory in the `src/content` directory.
46+
47+
## Step #4 Provide file extensions
48+
49+
Next, it will ask you which files extensions you want to track. You can provide a comma-separated list of file extensions. E.g., `.mdx,.md` to track markdown files. Alternatively, you can provide `*` to track all files.
50+
51+
```
52+
Enter file extensions to track (use * for all, or comma-separated list, e.g., .md,.mdx)
53+
```
54+
55+
That's it! It creates a memory at `baseai/memory/chat-with-repo` in your current directory that tracks the git repository directory and file extensions you provided.
56+
57+
## Step #5 Deploy the memory
58+
59+
Commit all the changes to git and deploy.
60+
61+
```bash
62+
npx baseai@latest deploy -m chat-with-repo
63+
```
64+
65+
Next time you want to update the memory with the latest changes from the git repository, you can run the `deploy` command again. Make sure to commit all the changes before deploying.
66+
67+
---
68+
69+
## Running the memory locally
70+
71+
You can embed the memory locally using the `embed` command. Just like any other memory and use it with a Pipe. Follow the [quickstart guide](/docs/memory/quickstart) to see how to embed and use the memory.
72+
73+
---

β€Žapps/baseai.dev/src/data/navigation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ const navigationData: NavigationItem[] = [
179179
title: 'Deploy All',
180180
href: '/docs/deployment/deploy'
181181
},
182+
{
183+
title: 'Deploy Memory',
184+
href: '/docs/deployment/memory'
185+
},
182186
{
183187
title: 'Deploy Document',
184188
href: '/docs/deployment/document'
@@ -216,6 +220,10 @@ const navigationData: NavigationItem[] = [
216220
{
217221
title: 'Build Next.js App with BaseAI',
218222
href: '/docs/guides/nextjs-with-baseai'
223+
},
224+
{
225+
title: 'Create Memory from Git Repo',
226+
href: '/docs/guides/memory-from-git'
219227
}
220228
]
221229
}

0 commit comments

Comments
Β (0)