Skip to main content

cuga-knowledge-rag

Use when the user wants a cuga agent to ingest, search, or answer questions from documents (PDF/DOCX/XLSX/PPTX/HTML/Markdown/images) - RAG / knowledge base features.

설치로 이동

소스 정보

저장소
cuga-project/cuga-harness-kit
최근 소스 활동
2026년 8월 11일 18:29
감지된 SKILL.md 언어
영어
스타
3
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
cuga-knowledge-rag
description
Use when the user wants a cuga agent to ingest, search, or answer questions from documents (PDF/DOCX/XLSX/PPTX/HTML/Markdown/images) - RAG / knowledge base features.
# Knowledge base (RAG) cuga has a built-in knowledge base: local vector store + **Docling** for parsing/normalizing documents before chunking and embedding, so ingestion stays self-contained with no external document service. Knowledge is **enabled by default** (`enable_knowledge=True`); the SDK auto-injects knowledge tools/awareness so the agent knows what's available and how to search it. ## Try it ```bash uv run cuga start demo_knowledge ``` Full walkthrough with sample docs: `docs/examples/knowledge_demo/` in a cuga-agent checkout. ## Programmatic use ```python from cuga import CugaAgent import asyncio agent = CugaAgent(enable_knowledge=True) async def main(): await agent.knowledge.ingest("/path/to/quarterly_report.pdf") result = await agent.invoke("What does the report say about Q4 revenue?") print(result.answer) # agent searches the knowledge base automatically results = await agent.knowledge.search("Q4 revenue figures") for r in results: print(f"{r['filename']} (page {r['page']}): {r['text'][:100]}") docs = await agent.knowledge.list_documents() await agent.aclose() asyncio.run(main()) ``` ## Scoping ```python # Session-scoped: temporary, tied to one conversation thread await agent.knowledge.ingest("/path/to/file.pdf", scope="session", thread_id="user-session-123") results = await agent.knowledge.search("query", scope="session", thread_id="user-session-123") # Agent-scoped (default): permanent, shared across conversations await agent.knowledge.ingest("/path/to/file.pdf", scope="agent") ``` Use `session` scope for per-conversation uploads that shouldn't leak between users; use `agent` scope for a shared reference corpus. ## Disabling ```python agent = CugaAgent(tools=[my_tools], enable_knowledge=False) ``` ## Supported types & tuning PDF, DOCX, XLSX, PPTX, HTML, Markdown, images, and more (via Docling). Embedding provider (`fastembed` default/local, `huggingface`, `openai`, `ollama`, `openrouter`) plus model/batch/concurrency are set under `[knowledge.embeddings]` in `settings.toml` or via `--embeddings-*` CLI flags. Switching provider/model invalidates existing vectors (different dimensionality) — the manage UI (`cuga start manager`) surfaces a "re-index recommended" banner when that happens. Full provider matrix: https://docs.cuga.dev/docs/sdk/knowledge/
GitHub에서 보기