Skip to main content
This reference page is a placeholder for v1. A future release will auto-generate it from the memic package docstrings on every SDK release. For now, refer to the API Reference for endpoint-level details.

Client

Memic

Memic(
    api_key: str = None,
    base_url: str = "https://api.memic.ai/api/v1",
    timeout: float = 30.0,
    max_retries: int = 3,
)
The main SDK client. If api_key is not provided, it reads from the MEMIC_API_KEY environment variable.

Context

client.me()

Return the organization, project, and environment resolved from the API key. Maps to: GET /me

Projects

client.projects.list()

Return all projects in the organization. Maps to: GET /projects

Files

client.files.upload(path: str)

Upload a file from the local filesystem. Handles init + PUT + confirm internally. Maps to: POST /files/init + presigned PUT + POST /files/{id}/confirm

client.files.list(page=1, page_size=50)

List files in the current environment. Maps to: GET /files

client.files.iter_all()

Iterator that yields every file, handling pagination transparently.

client.files.get_status(file_id: str)

Return the processing status of a file. Maps to: GET /files/{file_id}/status

client.files.delete(file_id: str)

Delete a file and all associated vectors/chunks. Maps to: DELETE /files/{file_id}

client.search(query: str, top_k: int = 5, filters: dict = None)

Run semantic search against the environment. Maps to: POST /search

Chat

client.chat(query_or_messages, ...)

Chat with documents in the environment. Accepts either a single query string or a full messages array for multi-turn conversations. Maps to: POST /chat

Prompts

client.prompts.get(name: str)

Return the live version of a managed prompt. The returned object has a .render(**kwargs) method for variable substitution. Maps to: GET /prompts/{name}

Exceptions

ExceptionWhen raised
AuthenticationError401 from the API
ForbiddenError403
NotFoundError404
RateLimitError429 (includes retry_after attribute)
ServerError5xx
NetworkErrorConnection/timeout issues

API Reference

Full REST API reference with try-it playground.