Skip to content

Commit 5dcb3f0

Browse files
authored
Merge branch 'main' into feature/java-sdk
2 parents 5a473a5 + 216f03f commit 5dcb3f0

Some content is hidden

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

44 files changed

+3610
-589
lines changed

.github/workflows/agent-memory-client.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,9 @@ jobs:
3131
working-directory: agent-memory-client
3232
run: uv sync --extra dev
3333

34-
- name: Lint with Ruff
35-
working-directory: agent-memory-client
36-
run: uv run ruff check agent_memory_client
37-
38-
- name: Check formatting with Ruff formatter
39-
working-directory: agent-memory-client
40-
run: uv run ruff format --check agent_memory_client
41-
42-
- name: Type check with mypy
43-
working-directory: agent-memory-client
44-
run: uv run mypy agent_memory_client
34+
- name: Run pre-commit
35+
run: |
36+
uv run pre-commit run --all-files
4537
4638
- name: Run tests
4739
working-directory: agent-memory-client
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Agent Memory Server CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- 'server/v*.*.*'
8+
pull_request:
9+
branches: [main]
10+
11+
jobs:
12+
build:
13+
name: Build package
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.12'
22+
23+
- name: Install build tools
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install build
27+
28+
- name: Build package
29+
run: python -m build
30+
31+
- name: Upload dist artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: dist
35+
path: dist/*
36+
37+
publish-testpypi:
38+
name: Publish to TestPyPI
39+
needs: build
40+
if: startsWith(github.ref, 'refs/tags/server/') && contains(github.ref, '-test')
41+
runs-on: ubuntu-latest
42+
environment: testpypi
43+
permissions:
44+
id-token: write
45+
contents: read
46+
steps:
47+
- name: Download dist artifact
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: dist
51+
path: dist
52+
53+
- name: Publish package to TestPyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
repository-url: https://test.pypi.org/legacy/
57+
packages-dir: dist/
58+
59+
publish-pypi:
60+
name: Publish to PyPI
61+
needs: build
62+
if: startsWith(github.ref, 'refs/tags/server/') && !contains(github.ref, '-test')
63+
runs-on: ubuntu-latest
64+
environment: pypi
65+
permissions:
66+
id-token: write
67+
contents: read
68+
steps:
69+
- name: Download dist artifact
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: dist
73+
path: dist
74+
75+
- name: Publish package to PyPI
76+
uses: pypa/gh-action-pypi-publish@release/v1
77+
with:
78+
packages-dir: dist/
79+
80+
# Tag Format Guide:
81+
# - For TestPyPI (testing): server/v1.0.0-test
82+
# - For PyPI (production): server/v1.0.0
83+
#
84+
# Use the script: python scripts/tag_and_push_server.py --test (for TestPyPI)
85+
# python scripts/tag_and_push_server.py (for PyPI)
86+
#
87+
# This workflow uses PyPI Trusted Publishing (OIDC). Ensure the project is configured
88+
# on PyPI to trust this GitHub repository before releasing.

.github/workflows/python-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Python Tests
33
on:
44
push:
55
branches: [ main ]
6+
tags:
7+
- 'server/v*.*.*'
8+
- 'client/v*.*.*'
69
pull_request:
710
branches: [ main ]
811

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,4 @@ libs/redis/docs/.Trash*
236236
TASK_MEMORY.md
237237
*.code-workspace
238238
/agent-memory-client/agent-memory-client-java/.gradle/
239+
augment*.md

Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
112112
# You may override with DISABLE_AUTH=true in development.
113113
ENV DISABLE_AUTH=false
114114

115-
# Default to development mode (no separate worker needed).
116-
# For production, override the command to remove --no-worker and run a separate task-worker container.
115+
# Default to development mode using the API's default backend (Docket). For
116+
# single-process development without a worker, add `--task-backend=asyncio` to
117+
# the api command.
117118
# Examples:
118-
# Development: docker run -p 8000:8000 redislabs/agent-memory-server
119+
# Development: docker run -p 8000:8000 redislabs/agent-memory-server agent-memory api --host 0.0.0.0 --port 8000 --task-backend=asyncio
119120
# Production API: docker run -p 8000:8000 redislabs/agent-memory-server agent-memory api --host 0.0.0.0 --port 8000
120121
# Production Worker: docker run redislabs/agent-memory-server agent-memory task-worker --concurrency 10
121-
CMD ["agent-memory", "api", "--host", "0.0.0.0", "--port", "8000", "--no-worker"]
122+
CMD ["agent-memory", "api", "--host", "0.0.0.0", "--port", "8000"]
122123

123124
# ============================================
124125
# AWS VARIANT - Includes AWS Bedrock support
@@ -142,10 +143,11 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
142143
# You may override with DISABLE_AUTH=true in development.
143144
ENV DISABLE_AUTH=false
144145

145-
# Default to development mode (no separate worker needed).
146-
# For production, override the command to remove --no-worker and run a separate task-worker container.
146+
# Default to development mode using the API's default backend (Docket). For
147+
# single-process development without a worker, add `--task-backend=asyncio` to
148+
# the api command.
147149
# Examples:
148-
# Development: docker run -p 8000:8000 redislabs/agent-memory-server:aws
150+
# Development: docker run -p 8000:8000 redislabs/agent-memory-server:aws agent-memory api --host 0.0.0.0 --port 8000 --task-backend=asyncio
149151
# Production API: docker run -p 8000:8000 redislabs/agent-memory-server:aws agent-memory api --host 0.0.0.0 --port 8000
150152
# Production Worker: docker run redislabs/agent-memory-server:aws agent-memory task-worker --concurrency 10
151-
CMD ["agent-memory", "api", "--host", "0.0.0.0", "--port", "8000", "--no-worker"]
153+
CMD ["agent-memory", "api", "--host", "0.0.0.0", "--port", "8000"]

README.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ docker-compose up
3131
docker run -p 8000:8000 \
3232
-e REDIS_URL=redis://your-redis:6379 \
3333
-e OPENAI_API_KEY=your-key \
34-
redislabs/agent-memory-server:latest
34+
redislabs/agent-memory-server:latest \
35+
agent-memory api --host 0.0.0.0 --port 8000 --task-backend=asyncio
3536
```
3637

37-
The default image runs in development mode (`--no-worker`), which is perfect for testing and development.
38+
By default, the image runs the API with the **Docket** task backend, which
39+
expects a separate `agent-memory task-worker` process for non-blocking
40+
background tasks. The example above shows how to override this to use the
41+
asyncio backend for a single-container development setup.
3842

3943
**Production Deployment**:
4044

@@ -74,8 +78,8 @@ uv install --all-extras
7478
# Start Redis
7579
docker-compose up redis
7680

77-
# Start the server (development mode)
78-
uv run agent-memory api --no-worker
81+
# Start the server (development mode, asyncio task backend)
82+
uv run agent-memory api --task-backend=asyncio
7983
```
8084

8185
### 2. Python SDK
@@ -155,10 +159,39 @@ result = await executor.ainvoke({"input": "Remember that I love pizza"})
155159
# Start MCP server (stdio mode - recommended for Claude Desktop)
156160
uv run agent-memory mcp
157161

158-
# Or with SSE mode (development mode)
159-
uv run agent-memory mcp --mode sse --port 9000 --no-worker
162+
# Or with SSE mode (development mode, default asyncio backend)
163+
uv run agent-memory mcp --mode sse --port 9000
164+
```
165+
166+
### MCP config via uvx (recommended)
167+
168+
Use this in your MCP tool configuration (e.g., Claude Desktop mcp.json):
169+
170+
```json
171+
{
172+
"mcpServers": {
173+
"memory": {
174+
"command": "uvx",
175+
"args": ["--from", "agent-memory-server", "agent-memory", "mcp"],
176+
"env": {
177+
"DISABLE_AUTH": "true",
178+
"REDIS_URL": "redis://localhost:6379",
179+
"OPENAI_API_KEY": "<your-openai-key>"
180+
}
181+
}
182+
}
183+
}
160184
```
161185

186+
Notes:
187+
- API keys: Set either `OPENAI_API_KEY` (default models use OpenAI) or switch to Anthropic by setting `ANTHROPIC_API_KEY` and `GENERATION_MODEL` to an Anthropic model (e.g., `claude-3-5-haiku-20241022`).
188+
189+
- Make sure your MCP host can find `uvx` (on its PATH or by using an absolute command path).
190+
- macOS: `brew install uv`
191+
- If not on PATH, set `"command"` to the absolute path (e.g., `/opt/homebrew/bin/uvx` on Apple Silicon, `/usr/local/bin/uvx` on Intel macOS). On Linux, `~/.local/bin/uvx` is common. See https://docs.astral.sh/uv/getting-started/
192+
- For production, remove `DISABLE_AUTH` and configure proper authentication.
193+
194+
162195
## Documentation
163196

164197
📚 **[Full Documentation](https://redis.github.io/agent-memory-server/)** - Complete guides, API reference, and examples

agent-memory-client/agent_memory_client/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
# Re-export essential models for convenience
1919
ModelNameLiteral,
2020
)
21+
from .tool_schema import ToolSchema, ToolSchemaCollection
2122

2223
__all__ = [
2324
# Client classes
2425
"MemoryAPIClient",
2526
"MemoryClientConfig",
2627
"create_memory_client",
28+
# Tool schema classes
29+
"ToolSchema",
30+
"ToolSchemaCollection",
2731
# Exceptions
2832
"MemoryClientError",
2933
"MemoryValidationError",

0 commit comments

Comments
 (0)