Skip to content

docs: core public API design — phased implementation plan#44

Draft
ashwing wants to merge 3 commits into
vllm-project:mainfrom
ashwing:feat/core-public-api
Draft

docs: core public API design — phased implementation plan#44
ashwing wants to merge 3 commits into
vllm-project:mainfrom
ashwing:feat/core-public-api

Conversation

@ashwing
Copy link
Copy Markdown
Contributor

@ashwing ashwing commented May 29, 2026

Summary

Design reference for the agentic-core public API extensions. This doc defines what we're building on top of PR #46's base executor loop.

Ownership split:

Implementation phases (each = one PR):

Phase Scope Depends On
1 SSEEventType expansion + accumulator FunctionCall detection nothing (lands on main)
2 LoopDecision + dispatch_tools() + execute_loop() PR #46
3 Streaming tee (forward to client + accumulate) PR #46
4 Tool executor traits + mock impls (MCP, web_search, vector_store) Phase 2

What changed in this update:

Test Plan

Design doc only — no code changes. Verification via follow-up implementation PRs with integration tests.

@maralbahari
Copy link
Copy Markdown
Collaborator

@ashwing Thank you for the job on this PR , it clarifies general functions required in the core module howeverI have a concern with this is that the design implementations are based on agent assumptions on some input output which is not explicit and once the actual implementation is in place the design might not be working well and developer would need to make so much changes and the review process would become complex.
I feel we should focus on actual small feature implementation with benchmarks and a smoke test of each small feature so we know the actual usage of each module and their purpose.

@ashwing
Copy link
Copy Markdown
Contributor Author

ashwing commented Jun 2, 2026

Fair point — stubs that drift from implementation would just create rework. I'll shift the approach: instead of landing all the type definitions at once, I'll implement one complete slice end-to-end (e.g., rehydrate_conversation with a real test against your store layer from PR #33) so the types are validated by actual usage rather than assumptions.

The design doc stays as a reference for the overall direction, but the PRs will be small, tested features — one step function at a time with integration tests proving the interfaces work.

@ashwing ashwing force-pushed the feat/core-public-api branch from 59f1ae4 to 1232f6e Compare June 2, 2026 19:17
@ashwing ashwing changed the title feat: agentic-core public API — types, traits, and executor stubs docs: agentic-core public API design proposal Jun 2, 2026
@ashwing
Copy link
Copy Markdown
Contributor Author

ashwing commented Jun 2, 2026

Updated — stripped the code stubs and kept this as a pure design doc for inline review. Implementation will follow as separate small PRs with integration tests against the store layer.

@leseb @franciscojavierarceo @maralbahari would appreciate your review on the design direction in docs/design/core-public-api.md. Happy to adjust based on feedback before starting implementation.

@ashwing ashwing force-pushed the feat/core-public-api branch 6 times, most recently from d92b158 to 3501d67 Compare June 2, 2026 21:35
@maralbahari
Copy link
Copy Markdown
Collaborator

Updated — stripped the code stubs and kept this as a pure design doc for inline review. Implementation will follow as separate small PRs with integration tests against the store layer.

@leseb @franciscojavierarceo @maralbahari would appreciate your review on the design direction in docs/design/core-public-api.md. Happy to adjust based on feedback before starting implementation.

Thank you @ashwing for the proposal. I have a simple response/conversation flow in #46. this PR only implements the stateful agent loop for simple input text messages it might look big because of the integration tests and cassettes records against OpenAI's conversation and responses api for assessment. However the agentic-loop is not complete with function_calls, instructions the default tool calls as your proposal which contains a bigger skeleton to ship. as discussed on slack we can work on #46 to have a more explicit implementation and complete the agentic-loop. I think could start with implementation to complete the function_calls and handling reasoning tokens etc?

@ashwing
Copy link
Copy Markdown
Contributor Author

ashwing commented Jun 3, 2026

@maralbahari sounds good — I reviewed PR #46 and left some comments there. Makes sense for you to own the stateful text flow as the base, and I'll build function_calls, tool dispatch, and the looped execution on top once #46 lands. The design doc here stays as the reference for the broader skeleton.

ashwing added 2 commits June 3, 2026 16:53
Consolidated proposal incorporating leseb's expanded 14-function
vision with phased implementation plan. Intended for inline
PR review per @franciscojavierarceo's request.

Ref: vllm-project#42
Signed-off-by: Ashwin Giridharan <girida@amazon.com>
…dation

Reframes the design doc as a hybrid reference:
- Acknowledges PR vllm-project#46 (maralbahari) as the base executor loop
- Defines clear ownership boundaries (base loop vs tool dispatch)
- Organizes into 4 implementation phases, each = one PR
- Phase 1 (SSE events) independent of PR vllm-project#46
- Phases 2-4 build on top of PR vllm-project#46

Removes speculative API surface (AgenticState, AgenticConfig, full
trait definitions) in favor of concrete code snippets matching actual
implementation targets. Keeps just enough detail to execute follow-up
PRs without over-specifying.

Signed-off-by: Ashwin Giridharan <girida@amazon.com>
@ashwing ashwing changed the title docs: agentic-core public API design proposal docs: core public API design — phased implementation plan Jun 3, 2026
@ashwing ashwing force-pushed the feat/core-public-api branch from 3501d67 to bc210e5 Compare June 3, 2026 23:56
- Phase 1 correctly depends on PR vllm-project#46 (accumulator.rs lives there)
- call_inference is sync fn returning lazy stream, not async
- persist_response takes explicit handler params (noted)
- Native async traits instead of #[async_trait] (Rust 1.85)
- Removed undefined ContextSize type, use &str
- Phase 2 explicitly non-streaming (streaming gated on Phase 3)
- Removed max_iterations redundancy from dispatch_tools params
- ADR-01 reference reworded as paraphrase not quote

Signed-off-by: Ashwin Giridharan <girida@amazon.com>
@ashwing
Copy link
Copy Markdown
Contributor Author

ashwing commented Jun 4, 2026

@franciscojavierarceo @maralbahari @leseb Gentle nudge to review the updated implementation plan. The doc is now minimal with work items phased out.

Thank you @ashwing I have responded to your questions in #46 (comment)
for the SSE events and handling them during streaming in more details would need your feedback on it thanks.


### Phase 4: Tool Executor Traits + Mock Implementations (depends on Phase 2)

**PR scope:** `executor/tools/` module.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the tools it should be on just agentic-core/tools as ADR-03
we need to keep the modules in agentic-core as small as possible to avoid circular imports and dependencies so it is easier to maintain as well.


### Phase 3: Streaming Tee (depends on PR #46)

**PR scope:** `executor/stream_tee.rs`, refactor `run_stream` path.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as SSE streaming grows we can also maintain them in their own small module in agentic-core.


## Open Questions

1. **`execute_loop` vs refactoring `execute`:** Should the loop wrapper be a new function or replace PR #46's `execute()`? Pending maralbahari's response on PR #46 review.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the execute in #46 is temporary as the entire loop is not complete with whole functionality since it is only validating text-only responses. so that we can test each small component and verify their correctness as we implement each composable pieces.
we shall write the last execute_loop once we have all the pieces in.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants