Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ export EPISODIC_MEMORY_API_TOKEN=your-token

# Increase timeout for slow endpoints (milliseconds)
export EPISODIC_MEMORY_API_TIMEOUT_MS=3000000

# Save SDK session logs for debugging (default: false)
# When enabled, creates .jsonl files in ~/.claude/projects/<cwd-path>/
# where <cwd-path> is based on where the CLI/agent runs from
export EPISODIC_MEMORY_SAVE_SDK_LOGS=true
```

These settings only affect episodic-memory's summarization calls, not your interactive Claude sessions.
Expand All @@ -153,6 +158,7 @@ These settings only affect episodic-memory's summarization calls, not your inter
| Component | Uses custom config? |
|-----------|---------------------|
| Summarization | Yes (up to 10 calls/sync) |
| SDK session logs | Yes (SAVE_SDK_LOGS only) |
| Embeddings | No (local Transformers.js) |
| Search | No (local SQLite) |
| MCP tools | No |
Expand Down
2 changes: 2 additions & 0 deletions dist/summarizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { SUMMARIZER_CONTEXT_MARKER } from './constants.js';
* - EPISODIC_MEMORY_API_BASE_URL: Custom API endpoint
* - EPISODIC_MEMORY_API_TOKEN: Auth token for custom endpoint
* - EPISODIC_MEMORY_API_TIMEOUT_MS: Timeout for API calls (default: SDK default)
* - EPISODIC_MEMORY_SAVE_SDK_LOGS: Save SDK session files for debugging (default: false)
*/
function getApiEnv() {
const baseUrl = process.env.EPISODIC_MEMORY_API_BASE_URL;
Expand Down Expand Up @@ -48,6 +49,7 @@ async function callClaude(prompt, sessionId, useFallback = false) {
options: {
model,
max_tokens: 4096,
persistSession: process.env.EPISODIC_MEMORY_SAVE_SDK_LOGS === 'true',
env: getApiEnv(),
resume: sessionId,
// Don't override systemPrompt when resuming - it uses the original session's prompt
Expand Down
2 changes: 2 additions & 0 deletions src/summarizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { SUMMARIZER_CONTEXT_MARKER } from './constants.js';
* - EPISODIC_MEMORY_API_BASE_URL: Custom API endpoint
* - EPISODIC_MEMORY_API_TOKEN: Auth token for custom endpoint
* - EPISODIC_MEMORY_API_TIMEOUT_MS: Timeout for API calls (default: SDK default)
* - EPISODIC_MEMORY_SAVE_SDK_LOGS: Save SDK session files for debugging (default: false)
*/
function getApiEnv(): Record<string, string | undefined> | undefined {
const baseUrl = process.env.EPISODIC_MEMORY_API_BASE_URL;
Expand Down Expand Up @@ -56,6 +57,7 @@ async function callClaude(prompt: string, sessionId?: string, useFallback = fals
options: {
model,
max_tokens: 4096,
persistSession: process.env.EPISODIC_MEMORY_SAVE_SDK_LOGS === 'true',
env: getApiEnv(),
resume: sessionId,
// Don't override systemPrompt when resuming - it uses the original session's prompt
Expand Down