Loading...
Loading...
How to write well-structured Basic Memory notes: frontmatter, observations with semantic categories, relations with wiki-links, and best practices for building a rich knowledge graph. Use when creating or improving notes.
npx skill4agent add basicmachines-co/basic-memory-skills memory-notes---
title: API Design Decisions
tags: [api, architecture, decisions]
---
# API Design Decisions
The API team evaluated multiple approaches for the public API during Q1. After
prototyping both REST and GraphQL, the team chose REST due to broader ecosystem
support and simpler caching semantics. This note captures the key decisions and
their rationale, along with open questions still to resolve.
## Observations
- [decision] Use REST over GraphQL for simplicity #api
- [requirement] Must support versioning from day one
- [risk] Rate limiting needed for public endpoints
## Relations
- implements [[API Specification]]
- depends_on [[Authentication System]]
- relates_to [[Performance Requirements]]---
title: Note Title # required — becomes the entity name in the knowledge graph
tags: [tag1, tag2] # optional — for organization and filtering
type: note # optional — defaults to "note", use custom types with schemas
permalink: custom-path # optional — auto-generated from title if omitted
---title# Headingtypepermalinktitledirectoryspecs/api-design-decisionsmemory://specs/api-design-decisionsNote: When using, you don't write frontmatter yourself. Thewrite_note,title,tags, andnote_typeare separate parameters — Basic Memory generates the frontmatter automatically. Yourmetadataparameter is just the markdown body starting withcontent.# Heading
- [category] Content of the observation #optional-tag[category] content- [decision] Use PostgreSQL for primary data store
- [risk] Third-party API has no SLA guarantee
- [technique] Exponential backoff for retry logic #resilience
- [question] Should we support multi-tenancy at the DB level?
- [preference] Use Bun over Node for new projects
- [lesson] Always validate webhook signatures server-side
- [status] active
- [flavor] Ethiopian beans work best with lighter roasts[decision] Use JWT[decision] Use JWT with 15-minute expiry for API auth[risk] Rate limiting needed #api #securitysearch_notes("[decision]")- relation_type [[Target Note Title]][[...]]| Type | Purpose | Example |
|---|---|---|
| One thing implements another | |
| Dependencies | |
| General connection | |
| Hierarchy/composition | |
| Enhancement or elaboration | |
| Things that work together | |
| Source material | |
| Supersedes another note | |
| Runtime/build dependency | |
| Alternative approaches | |
We evaluated [[GraphQL Approach]] but decided against it because
the team has more experience with REST. See [[API Specification]]
for the full contract.references[[Future Topic]]build_contextbuild_context(url="memory://note-title")taught_byblockstested_inmemory://memory://api-design-decisions # by permalink (title → kebab-case)
memory://docs/authentication # by file path
memory://docs/authentication.md # with extension (also works)
memory://auth* # wildcard prefix
memory://docs/* # wildcard suffix
memory://project/*/requirements # path wildcardsmemory://main/specs/api-design # "main" project, "specs/api-design" path
memory://research/papers/crdt # "research" projectbuild_context# Get a note and its connected context
build_context(url="memory://api-design-decisions")
# Wildcard — gather all docs
build_context(url="memory://docs/*")
# Direct read by permalink
read_note(identifier="memory://api-design-decisions")# Searching for an entity that might already exist
search_notes(query="Kubernetes Migration")
search_notes(query="k8s migration")
search_notes(query="container migration")edit_notewrite_noteedit_note# Append a new observation to an existing note
edit_note(
identifier="API Design Decisions",
operation="append",
section="Observations",
content="- [decision] Switched to OpenAPI 3.1 for spec generation #api"
)
# Fix outdated information
edit_note(
identifier="API Design Decisions",
operation="find_replace",
find_text="- [status] draft",
content="- [status] approved"
)
# Add a new relation
edit_note(
identifier="API Design Decisions",
operation="append",
section="Relations",
content="- depends_on [[Rate Limiter]]"
)write_note(
title="API Design Decisions",
directory="architecture",
tags=["api", "architecture"],
content="""# API Design Decisions
The API team evaluated REST and GraphQL during Q1 planning. After prototyping
both approaches, we chose REST for the public API — broader ecosystem support,
simpler caching with HTTP semantics, and a lower learning curve for external
consumers. GraphQL remains an option for internal services where query
flexibility matters more.
## Observations
- [decision] Use REST for public API #api
- [requirement] Support API versioning from v1
## Relations
- implements [[API Specification]]
- relates_to [[Backend Architecture]]"""
)architecture/api-design-decisionsmemory://architecture/api-design-decisionsedit_note# Append new observations
edit_note(
identifier="API Design Decisions",
operation="append",
section="Observations",
content="- [decision] Use OpenAPI 3.1 for spec generation #api"
)
# Add a new relation
edit_note(
identifier="API Design Decisions",
operation="append",
section="Relations",
content="- depends_on [[Rate Limiter]]"
)move_notemove_note(
identifier="API Design Decisions",
destination_path="archive/api-design-decisions.md"
)[[wiki-links]]memory://[category] contentedit_noteAPI Design DecisionsApi Design decisions/reflect/defrag