Skip to content

Commit 51cfc7f

Browse files
authored
👌 IMPROVE: Docs for updated git config (#133)
1 parent 006dfe1 commit 51cfc7f

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

‎apps/baseai.dev/content/docs/guides/memory-from-git.mdx

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags:
88
- langbase
99
section: 'Memory'
1010
published: 2024-10-08
11-
modified: 2024-10-08
11+
modified: 2024-11-26
1212
---
1313

1414
# Create a Memory from git Repository
@@ -34,40 +34,51 @@ It will also prompt you if you want to create a memory from the current project
3434
Do you want to create memory from current project git repository? (yes/no) yes
3535
```
3636

37-
## Step #3 Provide directory
37+
It will create a memory at `baseai/memory/chat-with-repo` and track files in the current git repository. It prints the path of the memory created.
3838

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.
39+
Open that file in your editor, it looks like this:
4040

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.
41+
```ts
42+
import {MemoryI} from '@baseai/core';
4643

47-
## Step #4 Provide file extensions
44+
const chatWithRepoMemory = (): MemoryI => ({
45+
name: 'chat-with-repo',
46+
description: "My list of docs as memory for an AI agent pipe",
47+
git: {
48+
enabled: true,
49+
include: ['**/*'],
50+
gitignore: true,
51+
deployedAt: '',
52+
embeddedAt: ''
53+
}
54+
});
4855

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)
56+
export default chatWithRepoMemory;
5357
```
5458

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.
59+
Below is the explanation of the fields in the memory file:
5660

57-
## Step #5 Deploy the memory
61+
- `enabled`: Set to `true` to enable tracking of git repository.
62+
- `include`: Follows glob pattern to include files from the git repository. You can change the pattern to include only specific files or directories.
63+
- `gitignore`: Set to `true` to include `.gitignore` file in the memory.
64+
- `deployedAt`: Set to the commit hash where the memory was last deployed. It is used to track the changes in the memory for deployment. Try to avoid changing this field manually.
65+
- `embeddedAt`: Set to the commit hash where the memory was last embedded. It is used to track the changes in the memory for local development. Try to avoid changing this field manually.
66+
67+
## Step #3 Deploy the memory
5868

5969
Commit all the changes to git and deploy.
6070

6171
```bash
6272
npx baseai@latest deploy -m chat-with-repo
6373
```
6474

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-
6775
---
6876

69-
## Running the memory locally
77+
## Tracking changes from Git Repository
7078

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.
79+
That's it! Next time you make changes to the git repository, you can run the `deploy` command again to update the memory. Make sure to commit all the changes before deploying.
80+
81+
Similarly, if you are using memory locally, make sure to `embed` the memory again after commit before running the AI agent pipe. As a result, it automatically updates the memory with the latest changes and record the hashes in the memory file.
7282

7383
---
84+

0 commit comments

Comments
 (0)