claude-mem 3.3.7 → 3.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -46
- package/dist/bin/cli.d.ts +2 -0
- package/dist/bin/cli.js +179 -0
- package/dist/commands/compress.d.ts +2 -0
- package/dist/commands/compress.js +27 -0
- package/dist/commands/hooks.d.ts +19 -0
- package/dist/commands/hooks.js +131 -0
- package/dist/commands/install.d.ts +2 -0
- package/dist/commands/install.js +836 -0
- package/dist/commands/load-context.d.ts +2 -0
- package/dist/commands/load-context.js +151 -0
- package/dist/commands/logs.d.ts +2 -0
- package/dist/commands/logs.js +76 -0
- package/dist/commands/migrate-to-jsonl.d.ts +5 -0
- package/dist/commands/migrate-to-jsonl.js +99 -0
- package/dist/commands/restore.d.ts +1 -0
- package/dist/commands/restore.js +20 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +136 -0
- package/dist/commands/trash-empty.d.ts +3 -0
- package/dist/commands/trash-empty.js +56 -0
- package/dist/commands/trash-view.d.ts +1 -0
- package/dist/commands/trash-view.js +101 -0
- package/dist/commands/trash.d.ts +6 -0
- package/dist/commands/trash.js +49 -0
- package/dist/commands/uninstall.d.ts +2 -0
- package/dist/commands/uninstall.js +107 -0
- package/dist/constants.d.ts +271 -0
- package/dist/constants.js +199 -0
- package/dist/core/compression/TranscriptCompressor.d.ts +79 -0
- package/dist/core/compression/TranscriptCompressor.js +585 -0
- package/dist/core/orchestration/PromptOrchestrator.d.ts +165 -0
- package/dist/core/orchestration/PromptOrchestrator.js +182 -0
- package/dist/lib/time-utils.d.ts +5 -0
- package/dist/lib/time-utils.js +70 -0
- package/dist/prompts/constants.d.ts +126 -0
- package/dist/prompts/constants.js +161 -0
- package/dist/prompts/index.d.ts +10 -0
- package/dist/prompts/index.js +11 -0
- package/dist/prompts/templates/analysis/AnalysisTemplates.d.ts +13 -0
- package/dist/prompts/templates/analysis/AnalysisTemplates.js +94 -0
- package/dist/prompts/templates/context/ContextTemplates.d.ts +119 -0
- package/dist/prompts/templates/context/ContextTemplates.js +399 -0
- package/dist/prompts/templates/hooks/HookTemplates.d.ts +175 -0
- package/dist/prompts/templates/hooks/HookTemplates.js +394 -0
- package/dist/prompts/templates/hooks/HookTemplates.test.d.ts +7 -0
- package/dist/prompts/templates/hooks/HookTemplates.test.js +127 -0
- package/dist/shared/config.d.ts +4 -0
- package/dist/shared/config.js +41 -0
- package/dist/shared/error-handler.d.ts +22 -0
- package/dist/shared/error-handler.js +142 -0
- package/dist/shared/logger.d.ts +19 -0
- package/dist/shared/logger.js +51 -0
- package/dist/shared/paths.d.ts +28 -0
- package/dist/shared/paths.js +100 -0
- package/dist/shared/settings.d.ts +41 -0
- package/dist/shared/settings.js +81 -0
- package/dist/shared/types.d.ts +145 -0
- package/dist/shared/types.js +78 -0
- package/docs/STATUS.md +155 -0
- package/docs/chroma-backend-migration.md +161 -0
- package/docs/landing-page-outline.md +287 -0
- package/docs/multi-platform-builds.md +96 -0
- package/docs/plans/cloud-service-plan.md +274 -0
- package/docs/plans/fix-response-format-issue.md +61 -0
- package/docs/plans/restructure-session-hook-output.md +102 -0
- package/docs/plans/session-start-hook-investigation.md +45 -0
- package/docs/plans/src-reorganization-plan.md +181 -0
- package/docs/plans/terminal-effects-decision.md +22 -0
- package/docs/plans/terminal-effects-integration.md +82 -0
- package/docs/plans/trash-bin-feature-plan.md +240 -0
- package/docs/plans/trash-bin-minimal-plan.md +102 -0
- package/docs/reference/bun-single-executable.md +584 -0
- package/docs/reference/cc-output-styles.md +99 -0
- package/docs/reference/chroma-mcp-project-memory-example.md +80 -0
- package/docs/reference/chroma-mcp-team-example.md +92 -0
- package/docs/reference/claude-code/cc-hooks.md +787 -0
- package/docs/reference/claude-code/cc-status-line.md +202 -0
- package/docs/reference/claude-code/hook-configuration.md +173 -0
- package/docs/reference/claude-code/hook-responses.md +127 -0
- package/docs/reference/claude-code/hooks.md +175 -0
- package/docs/reference/claude-code/mcp-configuration.md +133 -0
- package/docs/reference/claude-code/session-start-hook.md +82 -0
- package/docs/reference/load-context-format-example.md +33 -0
- package/docs/reference/mcp-sdk/mcp-typescript-sdk-readme.md +1323 -0
- package/docs/reference/mcp-sdk/server-implementation.md +286 -0
- package/docs/reference/mcp-sdk/stdio-transport.md +345 -0
- package/docs/todos/fix-response-format-tasks.md +43 -0
- package/docs/todos/implementation-todos.md +280 -0
- package/docs/todos/restructure-hook-output-tasks.md +103 -0
- package/docs/todos/session-start-hook-fix.md +26 -0
- package/docs/todos/terminal-effects-tasks.md +42 -0
- package/docs/todos/trash-bin-implementation-todos.md +348 -0
- package/docs/todos/trash-bin-minimal-todos.md +27 -0
- package/package.json +56 -6
- package/claude-mem +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
### Project Memory Example
|
|
2
|
+
|
|
3
|
+
Claude's context window has limits - long conversations eventually get truncated, and chats don't persist between sessions. Using Chroma as an external memory store solves these limitations, allowing Claude to reference past conversations and maintain context across multiple sessions.
|
|
4
|
+
|
|
5
|
+
First, tell Claude to use Chroma for memory as part of the project setup:
|
|
6
|
+
```
|
|
7
|
+
Remember, you have access to Chroma tools.
|
|
8
|
+
At any point if the user references previous chats or memory, check chroma for similar conversations.
|
|
9
|
+
Try to use retrieved information where possible.
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This prompt instructs Claude to:
|
|
13
|
+
- Proactively check Chroma when memory-related topics come up
|
|
14
|
+
- Search for semantically similar past conversations
|
|
15
|
+
- Incorporate relevant historical context into responses
|
|
16
|
+
|
|
17
|
+
To store the current conversation:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Please chunk our conversation into small chunks and store it in Chroma for future reference.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
or
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
can you chunk our entire conversation into small, embeddable text chunks (not the code, but describe it so you can recreate it if necessary). no longer than a couple lines each. then, add it to the chroma collection for this project.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Claude will:
|
|
30
|
+
1. Break the conversation into smaller chunks (typically 512-1024 tokens)
|
|
31
|
+
- Chunking is necessary because:
|
|
32
|
+
- Large texts are harder to search semantically
|
|
33
|
+
- Smaller chunks help retrieve more precise context
|
|
34
|
+
- It prevents token limits in future retrievals
|
|
35
|
+
2. Generate embeddings for each chunk
|
|
36
|
+
3. Add metadata like timestamps and detected topics
|
|
37
|
+
4. Store everything in your Chroma collection
|
|
38
|
+
|
|
39
|
+
Later, you can access past conversations naturally:
|
|
40
|
+
```
|
|
41
|
+
What did we discuss previously about the authentication system?
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Claude will:
|
|
45
|
+
1. Search Chroma for chunks semantically related to authentication
|
|
46
|
+
2. Filter by timestamp metadata for last week's discussions
|
|
47
|
+
3. Incorporate the relevant historical context into its response
|
|
48
|
+
|
|
49
|
+
This setup is particularly useful for:
|
|
50
|
+
- Long-running projects where context gets lost
|
|
51
|
+
- Teams where multiple people interact with Claude
|
|
52
|
+
- Complex discussions that reference past decisions
|
|
53
|
+
- Maintaining consistent context across multiple chat sessions
|
|
54
|
+
|
|
55
|
+
### Advanced Features
|
|
56
|
+
|
|
57
|
+
The Chroma MCP server supports:
|
|
58
|
+
|
|
59
|
+
- **Collection Management**: Create and organize separate collections for different projects
|
|
60
|
+
- **Document Operations**: Add, update, or delete documents
|
|
61
|
+
- **Search Capabilities**:
|
|
62
|
+
- Vector similarity search
|
|
63
|
+
- Keyword-based search
|
|
64
|
+
- Metadata filtering
|
|
65
|
+
- **Batch Processing**: Efficient handling of multiple operations
|
|
66
|
+
|
|
67
|
+
## Troubleshooting
|
|
68
|
+
|
|
69
|
+
If you encounter issues:
|
|
70
|
+
|
|
71
|
+
1. Verify your configuration file syntax
|
|
72
|
+
2. Ensure all paths are absolute and valid
|
|
73
|
+
3. Try using full paths for `uvx` with `which uvx` and using that path in the config
|
|
74
|
+
4. Check the Claude logs (paths listed above)
|
|
75
|
+
|
|
76
|
+
## Resources
|
|
77
|
+
|
|
78
|
+
- [Model Context Protocol Documentation](https://modelcontextprotocol.io/introduction)
|
|
79
|
+
- [Chroma MCP Server Documentation](https://github.com/chroma-core/chroma-mcp)
|
|
80
|
+
- [Claude Desktop Guide](https://docs.anthropic.com/claude/docs/claude-desktop)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
### Team Knowledge Base Example
|
|
2
|
+
|
|
3
|
+
Let's say your team maintains a knowledge base of customer support interactions. By storing these in Chroma Cloud, team members can use Claude to quickly access and learn from past support cases.
|
|
4
|
+
|
|
5
|
+
First, set up your shared knowledge base:
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
import chromadb
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
|
|
11
|
+
# Connect to Chroma Cloud
|
|
12
|
+
client = chromadb.HttpClient(
|
|
13
|
+
ssl=True,
|
|
14
|
+
host='api.trychroma.com',
|
|
15
|
+
tenant='your-tenant-id',
|
|
16
|
+
database='support-kb',
|
|
17
|
+
headers={
|
|
18
|
+
'x-chroma-token': 'YOUR_API_KEY'
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Create a collection for support cases
|
|
23
|
+
collection = client.create_collection("support_cases")
|
|
24
|
+
|
|
25
|
+
# Add some example support cases
|
|
26
|
+
support_cases = [
|
|
27
|
+
{
|
|
28
|
+
"case": "Customer reported issues connecting their IoT devices to the dashboard.",
|
|
29
|
+
"resolution": "Guided customer through firewall configuration and port forwarding setup.",
|
|
30
|
+
"category": "connectivity",
|
|
31
|
+
"date": "2024-03-15"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"case": "User couldn't access admin features after recent update.",
|
|
35
|
+
"resolution": "Discovered role permissions weren't migrated correctly. Applied fix and documented process.",
|
|
36
|
+
"category": "permissions",
|
|
37
|
+
"date": "2024-03-16"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
# Add documents to collection
|
|
42
|
+
collection.add(
|
|
43
|
+
documents=[case["case"] + "\n" + case["resolution"] for case in support_cases],
|
|
44
|
+
metadatas=[{
|
|
45
|
+
"category": case["category"],
|
|
46
|
+
"date": case["date"]
|
|
47
|
+
} for case in support_cases],
|
|
48
|
+
ids=[f"case_{i}" for i in range(len(support_cases))]
|
|
49
|
+
)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Now team members can use Claude to access this knowledge.
|
|
53
|
+
|
|
54
|
+
In your claude config, add the following:
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"chroma": {
|
|
59
|
+
"command": "uvx",
|
|
60
|
+
"args": [
|
|
61
|
+
"chroma-mcp",
|
|
62
|
+
"--client-type",
|
|
63
|
+
"cloud",
|
|
64
|
+
"--tenant",
|
|
65
|
+
"your-tenant-id",
|
|
66
|
+
"--database",
|
|
67
|
+
"support-kb",
|
|
68
|
+
"--api-key",
|
|
69
|
+
"YOUR_API_KEY"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Now you can use the knowledge base in your chats:
|
|
77
|
+
```
|
|
78
|
+
Claude, I'm having trouble helping a customer with IoT device connectivity.
|
|
79
|
+
Can you check our support knowledge base for similar cases and suggest a solution?
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Claude will:
|
|
83
|
+
1. Search the shared knowledge base for relevant cases
|
|
84
|
+
2. Consider the context and solutions from similar past issues
|
|
85
|
+
3. Provide recommendations based on previous successful resolutions
|
|
86
|
+
|
|
87
|
+
This setup is particularly powerful because:
|
|
88
|
+
- All support team members have access to the same knowledge base
|
|
89
|
+
- Claude can learn from the entire team's experience
|
|
90
|
+
- Solutions are standardized across the organization
|
|
91
|
+
- New team members can quickly get up to speed on common issues
|
|
92
|
+
|