The Knowledge Base is a crucial component of Moonlit Platform, serving as a repository for your domain knowledge. It consists of two main sections:
- Documents: For hosting large unstructured data
- Variables: For storing constant values that can be referenced in prompts
Adding Documents
There are three primary methods to add documents to your Knowledge Base:
- Upload files
- Import a single web page
- Import a sitemap
When adding documents, Moonlit scans the content and chunks it into smaller pieces, creating a system known as Retrieval Augmented Generation (RAGS).
Testing Your Knowledge Base
Before using your documents in apps, you can test them directly in the Knowledge Base:
- Click the "Test" button
- Enter a query
- An AI agent will semantically search the document chunks and provide a structured response with relevant information and citations
Using Knowledge Base in Apps
To utilize your Knowledge Base in Moonlit apps:
- Go to the Studio page and create a new app
- Add the "Retrieve Knowledge" function
- Configure the function with your query and select the appropriate store
- Enable "agentic retrieval" for more reliable results
The "Retrieve Knowledge" function typically precedes a chat model step in content generation workflows.
Research Agents
Moonlit offers a fourth method for populating documents through Research Agents, which will be covered in a separate lesson.
Key Takeaways
- The Knowledge Base consists of Documents and Variables sections
- Documents can be added through file upload, single web page import, or sitemap import
- Content is chunked for efficient retrieval
- Testing allows you to query your Knowledge Base before using it in apps
- The "Retrieve Knowledge" function enables the use of your Knowledge Base in Moonlit apps
- Research Agents provide an additional method for populating documents automatically