Replies: 7 comments
-
|
This is an important change. Given the length of the description, I prefer to have a meeting and report the results here. |
Beta Was this translation helpful? Give feedback.
-
|
Can @Yicong-Huang, @zuozhiw , @Xiao-zhen-Liu and @aglinxinyuan chime in on this ? |
Beta Was this translation helpful? Give feedback.
-
|
I'm ok with the idea. |
Beta Was this translation helpful? Give feedback.
-
|
I do believe you are talking about managing metadata of agents, which is the CRUD of creating agent as a resource. There is one thing missing in the discussion, which is the access control service, the access grant of which user can manage which agent should be routed to that service. After an agent is created, the access control service should gate it as a resource: only user who has certain privilege can access the agent. Please add that part into the discussion. I agree such metadata it should be persisted. and agree with the proposal in general. Let's see the details after you revise the discussion. One more thing, which I think you partially touched upon, is how do user collaborate with agents. There are in general two ways:
I think this needs a further, possibly separate, discussion. |
Beta Was this translation helpful? Give feedback.
-
|
this is a natural step to add persistence, the table schema overall looks good , some comments on the DDL
after we store the created by user id access control should be fairly simple and reuse whatever we have right now. |
Beta Was this translation helpful? Give feedback.
-
|
We have a few efforts related to new resources, such as Agent services, "Templates," and ML models. To simplify the design, I wonder whether we can do the following:
|
Beta Was this translation helpful? Give feedback.
-
Authentication foundation + per-deployment-mode setupSplitting agent access control into two layers makes the rollout incremental:
The authentication layer is a gateway concern, so it's wired up differently in each deployment mode: Kubernetes (Envoy Gateway) — canonical path, mirroring how computing-unit / executions / pve are already authorized:
Docker Compose (single-node, nginx) — nginx is the gateway, so use its ext-authz equivalent, location /api/agents {
auth_request /_agent_auth;
proxy_pass http://agent-service:3001;
# ...existing ws-upgrade headers...
}
location = /_agent_auth {
internal;
# $request_uri makes access-control see /api/auth/api/agents/... — same shape Envoy produces,
# so the SAME authorize() branch handles both gateways.
proxy_pass http://access-control-service:9096/api/auth$request_uri;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
}The Bare-metal dev (Angular Frontend (all modes): attach the JWT to every agent call — Net: ship authentication now (allow-all authz), and this discussion's ownership model becomes the per-agent authorization step layered on top. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
In #4495, a new microservice,
agent-service, is introduced to manageTexeraAgentinstances that help users do data science using natural language and workflows. After this change, the architecture becomes the following:The diagrams below show the service traffic when users CRUD
TexeraAgentresources:The diagrams below show the service traffic when users collaborate with
TexeraAgent, andTexeraAgentperforms ReAct:Problem Of Current Design
agent-servicecurrently managesTexeraAgentas in-memory objects with no access control. This introduces two major issues:agent-servicegoes down, the agent trace is lost.Proposal: Treat TexeraAgent As A Resource
Texera already manages several kinds of resources: users, workflows, datasets, computing units, and workflow executions. To solve the problems above,
TexeraAgentshould be treated as another resource type. Agents are persisted intexera_db, managed by Postgres, and are owned by a user.Relational DB Schema Change
A new entity,
agent, is added. One user can own multiple agents throughagent.uid -> user.uid.The schema of the
agententity is:Column responsibilities:
aidUUIDuidINTnameVARCHAR(128)model_typeVARCHAR(256)gpt-4o-mini.configJSONBreact_stepsJSONBcreation_timeTIMESTAMPconfigcontains durable agent settings only. It should include data such as:{ "systemPrompt": "...", "tools": [ { "name": "addOperator", "description": "...", "inputSchema": {}, "enabled": true } ], "settings": { "maxOperatorResultCharLimit": 2000, "maxOperatorResultCellCharLimit": 2000, "operatorResultSerializationMode": "tsv", "toolTimeoutSeconds": 240, "executionTimeoutMinutes": 4, "disabledTools": [], "maxSteps": 100, "allowedOperatorTypes": ["CSVFileScan", "Filter"] } }react_stepsstores the durable ReAct state as a JSON array. Each element represents one user or agent step and may include nested tool calls, tool results, token usage, and workflow snapshots:[ { "id": "step-...", "messageId": "msg-...", "stepId": 0, "timestamp": 1780217116417, "role": "user", "content": "Analyze this workflow", "isBegin": true, "isEnd": true, "messageSource": "chat" } ]The table intentionally does not store workflow ID, computing unit ID, workflow name, or user JWT. Those values are request-scoped and are supplied when the user sends an agent task. This avoids stale workflow bindings, stale computing unit bindings, and persisted credentials.
Service Traffic Change
The traffic when users CRUD agents becomes:
The traffic when users collaborate with agents becomes:
Access Control
All agent APIs require authentication. The agent service validates JWTs using the same secret as the rest of Texera, loaded from:
Access rules:
uid.agent.uid = caller.uid.Unauthorized requests return
401. Authenticated users accessing another user's agent return403.Persistence Flow
Beta Was this translation helpful? Give feedback.
All reactions