Skip to content

Commit dc18e2d

Browse files
Merge pull request #36 from priyanshujain/memory-system-redesign
Rename memory to history + build new memory system
2 parents bb63719 + d70b715 commit dc18e2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2962
-209
lines changed

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Project Guidelines
2+
3+
- Do not call the task done until it is fully complete and tested.
4+
- Always write tests for new features and bug fixes.
5+
- Do not dismiss bug as a pre-existing" issue even if it was present before your change. It does not matter, it's still your responsibility to fix it. When you see a bug, fix it. Don't ignore it.
6+
17
## Coding Guidelines
28

39
- Keep code simple and easy to read.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Think of it like a meal kit instead of a pre-made meal. You get the ingredients
2828

2929
| Component | What it does |
3030
|---|---|
31-
| **Sources** | Connectors for Gmail, WhatsApp, Apple Notes, and conversation memory |
31+
| **Sources** | Connectors for Gmail, WhatsApp, Apple Notes, and conversation history |
3232
| **Sync engine** | Background daemon (launchd/systemd) keeps your local data fresh |
3333
| **CLI** (`obk`) | Search, read, and send across all sources from the terminal |
3434
| **Assistant scaffolding** | Pre-configured Claude Code setup with skills for natural-language access |
@@ -114,8 +114,10 @@ Config and all synced data live under `~/.obk/` (override with `OBK_CONFIG_DIR`)
114114
│ └── data.db # Synced messages
115115
├── applenotes/
116116
│ └── data.db # Synced notes
117-
└── memory/
118-
└── data.db # Conversation history
117+
├── history/
118+
│ └── data.db # Conversation history
119+
└── user_memory/
120+
└── data.db # Personal facts about the user
119121
```
120122

121123
## Prerequisites

agent/integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func availableProviders(t *testing.T) []providerTestCase {
6262
providers = append(providers, providerTestCase{
6363
name: "gemini",
6464
provider: gemini.New(key),
65-
model: "gemini-2.0-flash",
65+
model: "gemini-2.5-flash",
6666
})
6767
}
6868
if project := os.Getenv("GOOGLE_CLOUD_PROJECT"); project != "" {
@@ -74,7 +74,7 @@ func availableProviders(t *testing.T) []providerTestCase {
7474
providers = append(providers, providerTestCase{
7575
name: "gemini-vertex",
7676
provider: gemini.New("", gemini.WithVertexAI(project, region), gemini.WithTokenSource(provider.GcloudTokenSource(account))),
77-
model: "gemini-2.0-flash",
77+
model: "gemini-2.5-flash",
7878
})
7979
}
8080

@@ -213,7 +213,7 @@ func TestIntegration_Streaming(t *testing.T) {
213213
ch, err := tc.provider.StreamChat(ctx, provider.ChatRequest{
214214
Model: tc.model,
215215
Messages: []provider.Message{provider.NewTextMessage(provider.RoleUser, "Say 'test-stream-ok' and nothing else.")},
216-
MaxTokens: 32,
216+
MaxTokens: 256,
217217
})
218218
if err != nil {
219219
t.Fatalf("StreamChat: %v", err)

agent/tools/skills_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestSearchSkills(t *testing.T) {
6666
Skills: []skills.IndexEntry{
6767
{Name: "email-read", Description: "Search and read emails from Gmail inbox"},
6868
{Name: "whatsapp-read", Description: "Search WhatsApp messages"},
69-
{Name: "memory-read", Description: "Recall past conversations"},
69+
{Name: "history-read", Description: "Recall past conversations"},
7070
},
7171
}
7272
if err := skills.SaveIndex(idx); err != nil {
@@ -82,8 +82,8 @@ func TestSearchSkills(t *testing.T) {
8282
if !strings.Contains(result, "email-read") {
8383
t.Errorf("expected email-read in results: %q", result)
8484
}
85-
if strings.Contains(result, "memory-read") {
86-
t.Errorf("unexpected memory-read in results: %q", result)
85+
if strings.Contains(result, "history-read") {
86+
t.Errorf("unexpected history-read in results: %q", result)
8787
}
8888
}
8989

assistant/.claude/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"hooks": [
1111
{
1212
"type": "command",
13-
"command": "obk memory capture"
13+
"command": "obk history capture && obk memory extract &"
1414
}
1515
]
1616
}

config/config.go

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ type Config struct {
1313
Models *ModelsConfig `yaml:"models,omitempty"`
1414
Gmail *GmailConfig `yaml:"gmail,omitempty"`
1515
WhatsApp *WhatsAppConfig `yaml:"whatsapp,omitempty"`
16-
Memory *MemoryConfig `yaml:"memory,omitempty"`
16+
History *HistoryConfig `yaml:"history,omitempty"`
1717
AppleNotes *AppleNotesConfig `yaml:"applenotes,omitempty"`
18+
UserMemory *UserMemoryConfig `yaml:"user_memory,omitempty"`
1819
Daemon *DaemonConfig `yaml:"daemon,omitempty"`
1920
Integrations *IntegrationsConfig `yaml:"integrations,omitempty"`
2021
}
@@ -69,7 +70,11 @@ type GmailConfig struct {
6970
Storage StorageConfig `yaml:"storage,omitempty"`
7071
}
7172

72-
type MemoryConfig struct {
73+
type HistoryConfig struct {
74+
Storage StorageConfig `yaml:"storage,omitempty"`
75+
}
76+
77+
type UserMemoryConfig struct {
7378
Storage StorageConfig `yaml:"storage,omitempty"`
7479
}
7580

@@ -137,7 +142,12 @@ func Default() *Config {
137142
Driver: "sqlite",
138143
},
139144
},
140-
Memory: &MemoryConfig{
145+
History: &HistoryConfig{
146+
Storage: StorageConfig{
147+
Driver: "sqlite",
148+
},
149+
},
150+
UserMemory: &UserMemoryConfig{
141151
Storage: StorageConfig{
142152
Driver: "sqlite",
143153
},
@@ -168,11 +178,17 @@ func (c *Config) applyDefaults() {
168178
if c.WhatsApp.Storage.Driver == "" {
169179
c.WhatsApp.Storage.Driver = "sqlite"
170180
}
171-
if c.Memory == nil {
172-
c.Memory = &MemoryConfig{}
181+
if c.History == nil {
182+
c.History = &HistoryConfig{}
183+
}
184+
if c.History.Storage.Driver == "" {
185+
c.History.Storage.Driver = "sqlite"
186+
}
187+
if c.UserMemory == nil {
188+
c.UserMemory = &UserMemoryConfig{}
173189
}
174-
if c.Memory.Storage.Driver == "" {
175-
c.Memory.Storage.Driver = "sqlite"
190+
if c.UserMemory.Storage.Driver == "" {
191+
c.UserMemory.Storage.Driver = "sqlite"
176192
}
177193
if c.AppleNotes == nil {
178194
c.AppleNotes = &AppleNotesConfig{}
@@ -206,11 +222,18 @@ func (c *Config) WhatsAppSessionDBPath() string {
206222
return filepath.Join(SourceDir("whatsapp"), "session.db")
207223
}
208224

209-
func (c *Config) MemoryDataDSN() string {
210-
if c.Memory.Storage.DSN != "" {
211-
return c.Memory.Storage.DSN
225+
func (c *Config) HistoryDataDSN() string {
226+
if c.History.Storage.DSN != "" {
227+
return c.History.Storage.DSN
228+
}
229+
return filepath.Join(SourceDir("history"), "data.db")
230+
}
231+
232+
func (c *Config) UserMemoryDataDSN() string {
233+
if c.UserMemory.Storage.DSN != "" {
234+
return c.UserMemory.Storage.DSN
212235
}
213-
return filepath.Join(SourceDir("memory"), "data.db")
236+
return filepath.Join(SourceDir("user_memory"), "data.db")
214237
}
215238

216239
func (c *Config) AppleNotesDataDSN() string {

0 commit comments

Comments
 (0)