Component evidence

knowledge/__init__.py

mangaba_ai · mangaba/knowledge/__init__.py · python · MIT
ai

A RAG-style grounding layer for ingesting diverse data sources and retrieving semantic context for AI prompts.

Source preview first 800 characters · full source over MCP
# Source: https://github.com/Mangaba-ai/mangaba_ai | License: MIT | Copyright 2024 Mangaba AI
# Provided via justclaw.it.com; keep this notice with the code.
"""Knowledge subsystem for Mangaba AI v3.0.

A RAG-style grounding layer: curated reference material (files, URLs, raw
strings) ingested once and retrieved semantically at prompt time. Distinct
from :mod:`mangaba.memory`, which records what happened during a run.

Example::

    from mangaba.knowledge import Knowledge, StringKnowledgeSource, PDFKnowledgeSource

    knowledge = Knowledge(
        embedding=my_embedding,
        sources=[
            StringKnowledgeSource(content="Mangaba AI orchestrates agent crews."),
            PDFKnowledgeSource(file_path="handbook.pdf"),
        ],
    )
    context = knowledge.to_context_string("

... (truncated -- full source via MCP)