Skip to content
Open
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
17 changes: 14 additions & 3 deletions libs/deepagents-cli/deepagents_cli/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,19 @@ def get_system_prompt() -> str:
Returns:
The system prompt string (without agent.md content)
"""
return f"""### Current Working Directory
cwd = Path.cwd()
return f"""<env>
Working directory: {cwd}
</env>

The filesystem backend is currently operating in: `{Path.cwd()}`
### File System and Paths

**IMPORTANT - Path Handling:**
- All file paths must be absolute paths (e.g., `{cwd}/file.txt`)
- Use the working directory from <env> to construct absolute paths
- Example: To create a file in your working directory, use `{cwd}/research_project/file.md`
- Special paths starting with `/memories/` access persistent storage across sessions
- Never use relative paths - always construct full absolute paths

### Memory System Reminder

Expand Down Expand Up @@ -158,7 +168,8 @@ def create_agent_with_config(model, assistant_id: str, tools: list):

# Composite backend: current working directory for default, agent directory for /memories/
backend = CompositeBackend(
default=FilesystemBackend(), routes={"/memories/": long_term_backend}
default=FilesystemBackend(),
routes={"/memories/": long_term_backend},
)

# Use the same backend for agent memory middleware
Expand Down