REST API Server
MemOS provides a REST API server (written using FastAPI). Users can perform all operations through REST endpoints.
Loading...
APIs supported by MemOS REST API Server
Features
- Register a new user: Register a new user with configuration and default cube.
- Get suggestion queries: Get suggestion queries for a specific user.
- Get all memories for user: Get all memories for a specific user.
- Add a new memory: Create a new memory for a specific user.
- Search memories: Search memories for a specific user.
- Chat with MemOS: Chat with MemOS for a specific user. Returns SSE stream.
Running Locally
With Docker Compose
The Development Docker Compose comes pre-configured with postgres pgvector, neo4j and a server/history/history.db volume for the history database.
The only required environment variable to run the server is OPENAI_API_KEY.
Create a .env file in the server/ directory and set your environment variables. For example:
OPENAI_API_KEY=your-openai-api-key
Run the Docker container using Docker Compose:
docker compose up --build
Access the API at http://localhost:8000.
Making changes to the server code or the library code will automatically reload the server.
With Docker
Create a .env file in the current directory and set your environment variables. For example:
OPENAI_API_KEY=your-openai-api-key
Build the docker image locally.
docker build -t memos-api-server .
Run the Docker container:
docker run --env-file .env -p 8000:8000 memos-api-server
Access the API at http://localhost:8000.
Without Docker
Create a .env file in the current directory and set your environment variables. For example:
OPENAI_API_KEY=your-openai-api-key
Install Poetry for dependency management:
curl -sSL https://install.python-poetry.org | python3 -
Install all project dependencies and development tools:
make install
Start the FastAPI server:
uvicorn memos.api.product_api:app --reload
Access the API at http://localhost:8000
Your First Memory
Let’s build your first plaintext memory in MemOS! GeneralTextMemory is the easiest way to get hands-on with extracting, embedding, and searching simple text memories.
Examples
Congratulations - you've mastered the Quick Start and built your first working memory! Now it's time to see how far you can take MemOS by combining different memory types and features. Use these curated examples to inspire your own agents, chatbots, or knowledge systems.