knowledge/__init__.py

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

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 manga

# 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)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key