MemPalace Agent is a small OpenAI-compatible proxy that sits in front of any LLM endpoint and gives it memory.
It does three things:
- loads MemPalace wake-up context
- searches verbatim memory on each request
- writes the conversation back into the palace
Your model endpoint stays yours. MemPalace stays local.
Main module: agent.py
Install
Run
AGENT_LLM_BASE_URL="http://localhost:8000/v1" \ AGENT_LLM_MODEL="your-model" \ uv run agent.py --data ~/my-agent
By default the proxy serves on http://127.0.0.1:8001/v1.
You can also bind it explicitly:
AGENT_BASE_URL="http://0.0.0.0:8889/v1" \ AGENT_LLM_BASE_URL="http://192.168.0.124:8888/v1" \ AGENT_LLM_MODEL="your-model" \ uv run agent.py --data ~/my-agent
Then point any OpenAI-compatible client at:
Example
curl http://127.0.0.1:8001/v1/chat/completions \ -X POST \ -H 'Content-Type: application/json' \ --data-raw '{"messages":[{"role":"user","content":"whats my name?"}],"stream":false}' # { "choices": [ { "message": { "role": "assistant", "content": "Your name is Sebastian." } } ] }
Environment
AGENT_LLM_BASE_URL: backend LLM base URLAGENT_LLM_API_KEY: optional bearer token for the backendAGENT_LLM_MODEL: model forced by the proxyAGENT_LLM_FORCE_MODEL: iftrue, ignore request model and useAGENT_LLM_MODELAGENT_LLM_EXTRA_HEADERS: JSON object of extra backend headersAGENT_BASE_URL: proxy bind URLAGENT_HOST: proxy bind hostAGENT_PORT: proxy bind port
Legacy LLM_BASE_URL, LLM_API_KEY, and LLM_MODEL are also accepted.
Endpoints
POST /v1/chat/completionsGET /v1/modelsGET /v1/healthPOST /v1/memory/searchGET /v1/memory/status
Notes
- The memory store lives under
--data/.mempalace/ - Use
127.0.0.1or a real host when connecting clients; do not send client traffic to0.0.0.0 - Streaming is supported
























