Skip to main content
Back to timeline
mastra.aiSource publication:

Mastra gives agents a shared Knowledge store: pages scoped to org, user or thread, and agents can write as well as read

Synopsis

Mastra released Knowledge, a shared store that organizes company documents, policies and decisions as named Markdown pages with scopes, giving agents company-wide context. Previously agents could get context from instructions, retrieval-augmented generation, skills, or tools that query APIs and databases, but those paths are usually read-only and need manual updates when information changes. Knowledge works with signals, Mastra's context engineering primitive, to bring relevant knowledge into an agent's context and keep it current while the agent runs, and agents can search, read and write pages within the scopes they can access.

Source-provided article image: Introducing Knowledge for Mastra Agents
mastra.ai

Interpretation

Agents can now receive shared context that spans an organization, drawn from a set of documents, policies or decisions organized as pages, rather than relying only on training data or one-off instructions. Before, agents could be given context through instructions, retrieval-augmented generation, skills, or tools that query APIs and databases, but those routes are usually read-only and each needs manual intervention when information changes. Knowledge works directly with signals, Mastra's context engineering primitive, which brings the right knowledge into an agent's context and keeps it current while the agent runs.

Knowledge stores information as named Markdown documents called pages, and each page lives in a scope that decides which organizations, users or conversations have read and write access. knowledgeMemoryScopes() declares three scopes: org, shared with everyone in an organization; resource, visible to one user; and thread, limited to one conversation. Setting tools: true gives agents five Knowledge tools: knowledge_search finds pages and notes matching a query, knowledge_list lists pages in a scope, knowledge_read reads a page, knowledge_page creates or edits a page, and knowledge_note adds a note to a page.

Writing lets the knowledge base update through use, with the agent writing a page to the scope that matches the request, so "save that for the team" writes to org. For reading, the agent searches and reads pages across all three scopes, org, resource and thread, in one call. Knowledge is stored in the configured storage provider, which creates its own mastra_knowledge_* tables the first time Knowledge is used, including mastra_knowledge_pages for each page's name, description and Markdown body, mastra_knowledge_notes for notes added to pages, mastra_knowledge_mentions for links between pages, and mastra_knowledge_pins for pinned pages.

Perspective

Knowledge is in alpha, and its API may change between releases. Agents can only answer from what is in Knowledge, so content usually needs to be in place before they start, which can be done from existing documents or through Mastra Connect on the Mastra platform.

Knowledge is in alpha and its API may change between releases. Importers are planned for the next release to connect sources such as Notion, Confluence, Linear, Zendesk and Fireflies more easily, and are not yet available.