Skip to content

Command-line interface: ragframework ingest / ragframework query #45

Description

@adaumsilva

Description

Add a small CLI (stdlib argparse, no new required deps) exposed as a console script:

ragframework ingest ./docs --index ./index --embedder huggingface --retriever faiss
ragframework query "How do I configure chunk overlap?" --index ./index --top-k 3
ragframework --version

Motivation

Lets people evaluate the framework in 60 seconds without writing Python, and gives maintainers a quick smoke test. Depends on retriever persistence for --index to be meaningful; until then the CLI can run ingest + query in one invocation.

Acceptance criteria

  • ragframework/cli.py with main(argv=None); [project.scripts] ragframework = "ragframework.cli:main" in pyproject.toml
  • Component selection by name with a small registry: --loader {auto,text,markdown,pdf,directory}, --chunker {fixed,recursive,sentence}, --embedder {random,huggingface}, --retriever {memory,faiss,chroma}, --generator {echo}; missing optional deps produce the standard install hint, exit code 1
  • --chunk-size, --chunk-overlap, --top-k map onto RAGConfig
  • query prints the answer, then sources as [n] <id> (<source>); --json prints a machine-readable RAGResponse
  • --verbose enables logging at INFO (see the logging issue)
  • Tests invoke main([...]) directly with tmp_path fixtures and the random/echo components; also python -m ragframework works (__main__.py)
  • README "Quick Start" gets a CLI subsection; CHANGELOG.md updated

Files to touch

  • ragframework/cli.py, ragframework/__main__.py — new
  • pyproject.toml
  • tests/test_cli.py — new
  • README.md

Resources

Estimated effort: Medium (half day)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions