Skip to content

Add REST API server mode #9

@ahmed-sekka

Description

@ahmed-sekka

Description

Add an optional REST API server to enable integration with web applications and other tools.

Proposed command

ragctl serve --port 8000 --host 0.0.0.0

API Endpoints

POST /api/v1/chunk          - Process single document
POST /api/v1/batch          - Process multiple documents (async)
GET  /api/v1/jobs/{id}      - Get job status
GET  /api/v1/health         - Health check
GET  /api/v1/info           - System info
GET  /docs                  - OpenAPI documentation

Tasks

  • Add fastapi and uvicorn to optional dependencies
  • Create src/core/api/ module
  • Implement endpoints with proper error handling
  • Add OpenAPI/Swagger documentation
  • Add ragctl serve command
  • Add rate limiting option
  • Write API tests
  • Add Docker support

Example request

curl -X POST http://localhost:8000/api/v1/chunk \
  -F "file=@document.pdf" \
  -F "strategy=semantic" \
  -F "max_tokens=400"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions