Quick Start
Run an agent from Python, or start the local Studio server Near talks to.
Quick Start
Two valid first runs. Pick one. They are not the same loop.
| Path | Entry | Loop |
|---|---|---|
| SDK | Agent + Task + AgentExecutor | Classic task executor in agenticx/core/agent_executor.py |
| Studio / Near | agx serve then the desktop app | AgentRuntime.run_turn in agenticx/runtime/agent_runtime.py |
Path A — embed in Python
python
1from agenticx import Agent, Task, AgentExecutor2from agenticx.llms import OpenAIProvider3from agenticx.tools.function_tool import tool45@tool(name="add", description="Add two integers.")6def add(a: int, b: int) -> int:7 return a + b89agent = Agent(10 name="Analyst",11 role="Data analysis helper",12 goal="Answer numeric questions",13 organization_id="my-org",14)15task = Task(16 id="sum-1",17 description="What is 42 + 58?",18 expected_output="The integer sum",19)2021executor = AgentExecutor(22 llm_provider=OpenAIProvider(model="gpt-4o"),23 tools=[add],24)25result = executor.run(agent=agent, task=task)26print(result)
You need a working provider key in the environment. Details: Agent Runtime, Tools.
Path B — local Studio for Near
bash
1agx serve --host 127.0.0.1 --port 8000
Desktop usually spawns this for you on 127.0.0.1 with an ephemeral port, then writes ~/.agenticx/serve.port and ~/.agenticx/serve.token. If you start it yourself, Near must point at that host and port.
agx studio is the terminal REPL, not the FastAPI process. See Studio Server.
Path C — one-shot CLI
bash
1agx run "Summarize what AgenticX is in two sentences"
Use this to check that the provider config works before opening the desktop UI.
If nothing happens
agx --versionfails → package not on thisPATH- Provider 401 → key missing or wrong env
- Desktop empty avatars / history →
agx serveis not listening (check~/.agenticx/serve.port) - Tool loop stops early → raise
runtime.max_tool_rounds/AGX_MAX_TOOL_ROUNDSin Configuration