dhee/is the main package. Core logic lives indhee/core/(decay, echo, fusion, conflict), while the user-facing API and orchestration live indhee/memory/.- Integrations are split by concern:
dhee/llms/(Gemini/OpenAI mocks),dhee/embeddings/,dhee/vector_stores/, anddhee/db/. - Configuration and utilities live in
dhee/configs/anddhee/utils/. - Entry points/examples:
dhee/mcp_server.py(MCP server) anddhee/example_agent.py. - Tests are simple pytest files in the repo root and package, e.g.
test_echomem.py,dhee/test_quick.py,dhee/test_no_api.py.
pip install -e ".[dev]"installs dev extras (pytest, pytest-asyncio).pip install -e ".[gemini,qdrant]"installs optional runtime dependencies for Gemini + Qdrant.pytestruns all tests discovered undertest_*.py.python -m dhee.mcp_serverorengram-mcpruns the MCP server entry point.
- Python 3.9+ codebase; follow PEP 8 with 4-space indentation.
- Use
snake_casefor functions/variables,PascalCasefor classes, andUPPER_SNAKE_CASEfor constants. - No formatter/linter is configured in
pyproject.toml; keep style consistent with surrounding files.
- Test framework:
pytestwithpytest-asynciofor async cases. - Name new tests
test_*.pyand place them in the repo root or withindhee/alongside related modules. - Keep tests isolated from external services unless explicitly marked or documented.
- Git history shows short, imperative messages (e.g., “added category layer”, “Add EchoMem…”). Keep commits concise and descriptive without enforced scopes.
- PRs should include a brief summary, tests run (e.g.,
pytest), and note any API keys or optional dependencies required to validate the change.
- Gemini requires
GEMINI_API_KEY(orGOOGLE_API_KEY). OpenAI usesOPENAI_API_KEYvia the SDK. - Never commit secrets; document new environment variables in README or this file when introduced.
Follow these rules for cross-agent continuity on every new task/thread.
- Before answering substantive repo/task questions, call
get_last_session:
user_id:"default"unless providedrequester_agent_id:"codex"repo: absolute workspace path- Include
agent_idonly when the user explicitly asks to continue from a specific source agent.
-
If no handoff session exists, continue normally and use memory tools as needed.
-
On major milestones and before pausing/ending, call
save_session_digestwith:
task_summaryrepostatus("active","paused", or"completed")decisions_made,files_touched,todos_remainingblockers,key_commands,test_resultswhen availableagent_id:"codex",requester_agent_id:"codex"
- Prefer Engram MCP handoff tools over shell/SQLite inspection for continuity.
Target agent profile: Codex/agent-runner.