Google Cloud Introduces Open Knowledge Format (OKF): A Vendor-Neutral Markdown Spec for Giving AI Agents Curated Context
Google Cloud has recently introduced the Open Knowledge Format (OKF), an open specification that formalizes the LLM-wiki pattern. This new format aims to provide a vendor-neutral markdown specification for giving AI agents curated context. In this article, we will break down the OKF, its components, and how it works.
What is Open Knowledge Format (OKF)?
The Open Knowledge Format is an open specification that defines a standard way of representing knowledge in a format that can be easily consumed by AI agents. It is based on the LLM-wiki pattern, which involves creating a directory of markdown files with YAML frontmatter that provide context to AI agents. The OKF is designed to be vendor-neutral, allowing developers to create and share knowledge bundles that can be used across different AI platforms.
How Does OKF Work?
An OKF bundle is a directory of markdown files with YAML frontmatter. Each markdown file represents a concept, and the YAML frontmatter provides additional metadata about the concept. The only required field in the YAML frontmatter is the “type” field, which specifies the type of concept being represented.
For example, a markdown file for a concept like “dog” might have the following YAML frontmatter:
---
type: entity
---
The markdown file would then contain a description of the concept, including any relevant information or context.
Design Principles of OKF
The OKF is based on three design principles:
- Simplicity: The OKF is designed to be simple and easy to use. The specification is lightweight and flexible, making it easy for developers to create and share knowledge bundles.
- Modularity: The OKF is designed to be modular, allowing developers to create and share individual concepts or bundles of concepts. This makes it easy to build and maintain large knowledge bases.
- Extensibility: The OKF is designed to be extensible, allowing developers to add new types of concepts or metadata as needed. This makes it easy to adapt the OKF to new use cases or applications.
Reference Tools for OKF
Google has shipped several reference tools for the OKF, including a Python consumer and an interactive bundle explorer. These tools make it easy for developers to work with OKF bundles and to create their own knowledge bases.
The Python consumer is a library that allows developers to read and write OKF bundles. It provides a simple API for working with OKF concepts and bundles, making it easy to integrate the OKF into existing applications.
The interactive bundle explorer is a web-based tool that allows developers to explore and visualize OKF bundles. It provides a graphical interface for navigating the concepts and relationships in an OKF bundle, making it easy to understand and work with complex knowledge bases.
OKF vs. RAG
The OKF is similar to the Retrieval-Augmented Generator (RAG) format, which is also used for representing knowledge in AI systems. However, there are some key differences between the two formats.
The RAG format is more focused on the retrieval of information from a knowledge base, while the OKF is more focused on the representation of knowledge itself. The OKF provides a more flexible and extensible way of representing knowledge, making it easier to adapt to new use cases and applications.
Working with OKF
To get started with the OKF, developers can use the reference tools provided by Google. The Python consumer can be used to read and write OKF bundles, while the interactive bundle explorer can be used to explore and visualize OKF bundles.
Developers can also create their own OKF bundles by writing markdown files with YAML frontmatter. The only required field in the YAML frontmatter is the “type” field, which specifies the type of concept being represented.
For example, the following code creates a simple OKF bundle with two concepts:
import os
# Create a directory for the OKF bundle
bundle_dir = "my_bundle"
os.makedirs(bundle_dir, exist_ok=True)
# Create a markdown file for the first concept
with open(os.path.join(bundle_dir, "concept1.md"), "w") as f:
f.write("---\n")
f.write("type: entity\n")
f.write("---\n")
f.write("This is the first concept.\n")
# Create a markdown file for the second concept
with open(os.path.join(bundle_dir, "concept2.md"), "w") as f:
f.write("---\n")
f.write("type: entity\n")
f.write("---\n")
f.write("This is the second concept.\n")
This code creates a directory called “my_bundle” and two markdown files called “concept1.md” and “concept2.md”. Each markdown file has a YAML frontmatter with a “type” field that specifies the type of concept being represented.
Conclusion
The Open Knowledge Format (OKF) is a new specification from Google Cloud that provides a vendor-neutral markdown spec for giving AI agents curated context. The OKF is based on the LLM-wiki pattern and provides a simple, modular, and extensible way of representing knowledge. The specification includes a Python consumer and an interactive bundle explorer, making it easy for developers to work with OKF bundles and to create their own knowledge bases.
The OKF has the potential to revolutionize the way we represent knowledge in AI systems, providing a flexible and extensible way of capturing complex relationships and concepts. As the use of AI continues to grow, the OKF is likely to play an increasingly important role in the development of intelligent systems.
We hope this article has provided a helpful introduction to the OKF and its potential applications. We encourage developers to explore the OKF in more detail and to start building their own OKF bundles today.

