Create Memory
Memory
Create Memory
Manually add a new AI memory to a repository
POST
Create Memory
Overview
Create a new memory entry for a repository. This allows you to manually add project rules, guidelines, or context that the AI should consider during code reviews.Authentication
Requires a valid JWT token in theAuthorization header:
Request Body
string
required
Repository in
owner/repo format (e.g., “acme/api-server”)string
required
Memory content - clear, descriptive text about the rule, pattern, or context
string
default:"project_rule"
Type of memory to create. Valid values:
project_rule: Project-specific guidelines and standardsarchitecture: System architecture and design decisionsproject_map: Codebase structure descriptions
Response
string
Unique ID of the created memory
string
Status of the operation (“added”)
Example Request
Example Response
Error Responses
Repository Not Connected
403 Forbidden
Memory Layer Not Available
503 Service Unavailable
Validation Error
422 Unprocessable Entity
Best Practices
Writing Effective Memories
Good:Memory Content Guidelines
- Be Specific: Include concrete details and examples
- Be Actionable: Describe what should be done, not just what to avoid
- Provide Context: Explain why the rule exists when relevant
- Use Clear Language: Avoid jargon unless it’s well-established in your team
- Keep it Focused: One rule or concept per memory
Use Cases
Add Security Requirements
Document Architecture Decisions
Add Testing Standards
Import Team Guidelines
Bulk Import from README
Notes
- Only
project_rule,architecture, andproject_mapmemory types can be manually created - Developer-specific memories (
contributor_profile,developer_pattern,developer_strength) are automatically learned from PR analysis - Memories are immediately available for use in future code reviews
- You must have the repository connected to your account to create memories
- Duplicate content is allowed - Mem0 will handle deduplication automatically