agentx-kit 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. agentx_kit-0.2.0/.github/workflows/publish.yml +43 -0
  2. agentx_kit-0.2.0/.gitignore +18 -0
  3. agentx_kit-0.2.0/DESIGN.md +98 -0
  4. agentx_kit-0.2.0/LICENSE +21 -0
  5. agentx_kit-0.2.0/PKG-INFO +289 -0
  6. agentx_kit-0.2.0/README.md +194 -0
  7. agentx_kit-0.2.0/RESEARCH.md +70 -0
  8. agentx_kit-0.2.0/pyproject.toml +96 -0
  9. agentx_kit-0.2.0/src/agentx/__init__.py +55 -0
  10. agentx_kit-0.2.0/src/agentx/cli.py +230 -0
  11. agentx_kit-0.2.0/src/agentx/config.py +34 -0
  12. agentx_kit-0.2.0/src/agentx/frameworks/__init__.py +5 -0
  13. agentx_kit-0.2.0/src/agentx/frameworks/crewai_agent.py +52 -0
  14. agentx_kit-0.2.0/src/agentx/frameworks/langchain_agent.py +43 -0
  15. agentx_kit-0.2.0/src/agentx/guardrails.py +89 -0
  16. agentx_kit-0.2.0/src/agentx/memory/__init__.py +4 -0
  17. agentx_kit-0.2.0/src/agentx/memory/store.py +78 -0
  18. agentx_kit-0.2.0/src/agentx/observability.py +103 -0
  19. agentx_kit-0.2.0/src/agentx/prompts/__init__.py +8 -0
  20. agentx_kit-0.2.0/src/agentx/prompts/templates.py +40 -0
  21. agentx_kit-0.2.0/src/agentx/providers/__init__.py +15 -0
  22. agentx_kit-0.2.0/src/agentx/providers/base.py +50 -0
  23. agentx_kit-0.2.0/src/agentx/providers/factory.py +71 -0
  24. agentx_kit-0.2.0/src/agentx/providers/registry.py +165 -0
  25. agentx_kit-0.2.0/src/agentx/rag/__init__.py +8 -0
  26. agentx_kit-0.2.0/src/agentx/rag/pipeline.py +121 -0
  27. agentx_kit-0.2.0/src/agentx/reliability.py +112 -0
  28. agentx_kit-0.2.0/src/agentx/scaffold/__init__.py +14 -0
  29. agentx_kit-0.2.0/src/agentx/scaffold/generator.py +190 -0
  30. agentx_kit-0.2.0/src/agentx/scaffold/prompts_store.py +99 -0
  31. agentx_kit-0.2.0/src/agentx/scaffold/spec.py +85 -0
  32. agentx_kit-0.2.0/src/agentx/scaffold/templates/Dockerfile.j2 +17 -0
  33. agentx_kit-0.2.0/src/agentx/scaffold/templates/README.md.j2 +46 -0
  34. agentx_kit-0.2.0/src/agentx/scaffold/templates/ci.yml.j2 +41 -0
  35. agentx_kit-0.2.0/src/agentx/scaffold/templates/docker-compose.yml.j2 +9 -0
  36. agentx_kit-0.2.0/src/agentx/scaffold/templates/dockerignore.j2 +11 -0
  37. agentx_kit-0.2.0/src/agentx/scaffold/templates/env.example.j2 +12 -0
  38. agentx_kit-0.2.0/src/agentx/scaffold/templates/evals/dataset.json.j2 +10 -0
  39. agentx_kit-0.2.0/src/agentx/scaffold/templates/evals/run_evals.py.j2 +70 -0
  40. agentx_kit-0.2.0/src/agentx/scaffold/templates/gitignore.j2 +8 -0
  41. agentx_kit-0.2.0/src/agentx/scaffold/templates/mcp_servers.json.j2 +7 -0
  42. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/__init__.py.j2 +3 -0
  43. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/agents.py.j2 +77 -0
  44. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/config.py.j2 +25 -0
  45. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/guardrails.py.j2 +21 -0
  46. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/main.py.j2 +79 -0
  47. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/memory.py.j2 +17 -0
  48. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/observability.py.j2 +17 -0
  49. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/prompts.py.j2 +45 -0
  50. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/rag.py.j2 +37 -0
  51. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/server.py.j2 +85 -0
  52. agentx_kit-0.2.0/src/agentx/scaffold/templates/pkg/tools.py.j2 +16 -0
  53. agentx_kit-0.2.0/src/agentx/scaffold/templates/pyproject.toml.j2 +28 -0
  54. agentx_kit-0.2.0/src/agentx/scaffold/templates/skills_seed.json.j2 +6 -0
  55. agentx_kit-0.2.0/src/agentx/scaffold/wizard.py +125 -0
  56. agentx_kit-0.2.0/src/agentx/skills/__init__.py +4 -0
  57. agentx_kit-0.2.0/src/agentx/skills/registry.py +63 -0
  58. agentx_kit-0.2.0/src/agentx/structured.py +37 -0
  59. agentx_kit-0.2.0/src/agentx/tools/__init__.py +5 -0
  60. agentx_kit-0.2.0/src/agentx/tools/builtin.py +45 -0
  61. agentx_kit-0.2.0/src/agentx/tools/mcp.py +64 -0
  62. agentx_kit-0.2.0/tests/test_enterprise.py +115 -0
  63. agentx_kit-0.2.0/tests/test_prompts.py +61 -0
  64. agentx_kit-0.2.0/tests/test_providers.py +49 -0
  65. agentx_kit-0.2.0/tests/test_scaffold.py +92 -0
@@ -0,0 +1,43 @@
1
+ name: Publish to PyPI
2
+
3
+ # Publishes the package to PyPI via Trusted Publishing (OIDC) — no API token.
4
+ # Triggers on a version tag push (e.g. `v0.1.0`) or manual dispatch.
5
+ on:
6
+ push:
7
+ tags: ["v*"]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ build:
12
+ name: Build distributions
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v5
18
+ - name: Build sdist + wheel
19
+ run: uv build
20
+ - name: Check metadata
21
+ run: uvx twine check dist/*
22
+ - uses: actions/upload-artifact@v4
23
+ with:
24
+ name: dist
25
+ path: dist/
26
+
27
+ publish:
28
+ name: Publish to PyPI
29
+ needs: build
30
+ runs-on: ubuntu-latest
31
+ # Must match the environment configured on the PyPI trusted publisher.
32
+ environment:
33
+ name: pypi
34
+ url: https://pypi.org/p/agentx-kit
35
+ permissions:
36
+ id-token: write # required for OIDC trusted publishing
37
+ steps:
38
+ - uses: actions/download-artifact@v4
39
+ with:
40
+ name: dist
41
+ path: dist/
42
+ - name: Publish
43
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,18 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .eggs/
5
+ build/
6
+ dist/
7
+ .venv/
8
+ venv/
9
+ .env
10
+ .pytest_cache/
11
+ .coverage
12
+ htmlcov/
13
+ .DS_Store
14
+ .ruff_cache/
15
+ *.sqlite3
16
+ data/
17
+ chroma/
18
+ .chroma/
@@ -0,0 +1,98 @@
1
+ # AgentX — High-Level Design
2
+
3
+ AgentX is two things in one package:
4
+
5
+ 1. **A provider-agnostic agentic runtime library** (`agentx`) — a thin, batteries-included layer over **LangChain/LangGraph** and **CrewAI** that lets you talk to *any* LLM provider through one factory, and compose RAG, memory, MCP tools and skills.
6
+ 2. **An interactive project scaffolder** (`agentx new`) — a runtime wizard that asks you, one option at a time, which framework, provider, agents, RAG, memory, MCP and skills you want, then generates a **ready-to-run project in its own `uv` virtual environment (`.venv`)**.
7
+
8
+ The generated project depends on `agentx` and is a working template you can run immediately.
9
+
10
+ ```
11
+ ┌─────────────────────────────────────────────────────────────────────┐
12
+ │ agentx (CLI) │
13
+ │ agentx new │ agentx providers │ agentx version │
14
+ └───────────────┬───────────────────────────────────────────────┬──────┘
15
+ │ │
16
+ ┌───────▼─────────┐ ┌────────▼────────┐
17
+ │ scaffold/ │ interactive wizard ──────► │ generator │
18
+ │ wizard.py │ collects a ProjectSpec │ renders Jinja │
19
+ │ spec.py │ │ + `uv venv` │
20
+ └─────────────────┘ └────────┬────────┘
21
+ │ writes
22
+
23
+ ┌───────────────────────────┐
24
+ │ generated project (.venv) │
25
+ │ main.py, agents.py, ... │
26
+ │ imports agentx │
27
+ └───────────────────────────┘
28
+
29
+ ── runtime library (imported by generated projects) ──
30
+ providers/ frameworks/ rag/ memory/ tools/ skills/ prompts/
31
+ ```
32
+
33
+ ## 1. Provider layer (`agentx/providers`)
34
+
35
+ The crown jewel. A **registry** maps a provider id → a `ProviderSpec` describing:
36
+ its display name, the pip extra to install, the env vars it needs, a sensible
37
+ default model, and how to build a model object for **both** frameworks.
38
+
39
+ | Provider id | LangChain class | CrewAI model prefix | Key env vars |
40
+ |--------------|------------------------------------------|--------------------------|--------------|
41
+ | `openai` | `langchain_openai.ChatOpenAI` | `openai/…` | `OPENAI_API_KEY` |
42
+ | `azure` | `langchain_openai.AzureChatOpenAI` | `azure/…` | `AZURE_OPENAI_API_KEY`, `AZURE_OPENAI_ENDPOINT` |
43
+ | `openrouter` | `ChatOpenAI` (base_url=openrouter) | `openrouter/…` | `OPENROUTER_API_KEY` |
44
+ | `anthropic` | `langchain_anthropic.ChatAnthropic` | `anthropic/…` | `ANTHROPIC_API_KEY` |
45
+ | `gemini` | `langchain_google_genai.ChatGoogleGenerativeAI` | `gemini/…` | `GOOGLE_API_KEY` |
46
+ | `vertexai` | `langchain_google_vertexai.ChatVertexAI` | `vertex_ai/…` | `GOOGLE_APPLICATION_CREDENTIALS`, `GOOGLE_CLOUD_PROJECT` |
47
+ | `bedrock` | `langchain_aws.ChatBedrockConverse` | `bedrock/…` | `AWS_*` / profile |
48
+ | `groq` | `langchain_groq.ChatGroq` | `groq/…` | `GROQ_API_KEY` |
49
+ | `ollama` | `langchain_ollama.ChatOllama` | `ollama/…` (+ base_url) | — (local) |
50
+
51
+ Two factory functions:
52
+ - `get_chat_model(provider, model=None, **kw) -> BaseChatModel` (LangChain/LangGraph).
53
+ - `get_crewai_llm(provider, model=None, **kw) -> crewai.LLM` (CrewAI; routes via LiteLLM).
54
+
55
+ Imports are **lazy** — installing `agentx-kit[openai]` only is enough to use OpenAI; nothing else is imported until requested. A clear error tells you the exact extra to install.
56
+
57
+ ## 2. Frameworks (`agentx/frameworks`)
58
+
59
+ - **LangGraph adapter** — `build_react_agent(...)` / a small `StateGraph` runner that wires a chat model + tools + memory into a runnable agent. Multi-agent = a graph of nodes.
60
+ - **CrewAI adapter** — `build_agent(...)`, `build_crew(...)` helpers that accept the same provider/tool/memory inputs and return CrewAI `Agent`/`Crew` objects.
61
+
62
+ Both consume the same building blocks so a project can switch frameworks with minimal change.
63
+
64
+ ## 3. Capabilities (optional, lazy)
65
+
66
+ - **RAG** (`rag/`) — document loaders → `RecursiveCharacterTextSplitter` → vector store (Chroma, or an offline keyword fallback) → retriever. Exposed as a tool.
67
+ - **Memory** (`memory/`) — short-term (windowed buffer) + long-term (persistent JSONL/SQLite) conversation memory.
68
+ - **Tools / MCP** (`tools/`) — `load_mcp_tools(config)` via `langchain-mcp-adapters`; plus built-in tools (web search).
69
+ - **Skills** (`skills/`) — a filesystem-backed skill registry whose instructions are injected into prompts (and optionally exposed as a lookup tool).
70
+ - **Prompts** (`prompts/`) — reusable, override-able prompt templates.
71
+
72
+ Every capability degrades gracefully: if its extra isn't installed, the feature is disabled with a helpful message rather than crashing.
73
+
74
+ ## 4. Scaffolder (`agentx/scaffold`)
75
+
76
+ - `ProjectSpec` (pydantic) is the single source of truth for a generation run.
77
+ - `wizard.py` collects it interactively (`questionary`), **one option at a time**:
78
+ project name → framework → provider → model → number & roles of agents →
79
+ RAG? → memory? → MCP? → skills? → prompt style → run `uv sync`?
80
+ - `generator.py` renders **Jinja2 templates** into the target directory, writes a
81
+ provider/feature-aware `pyproject.toml` and `.env.example`, then runs
82
+ `uv venv` to create `.venv` (and optionally `uv sync`).
83
+ - A programmatic `generate_project(spec, target_dir)` API makes the whole thing
84
+ testable and usable from other scripts (no TTY required).
85
+
86
+ ### Prompts are data, not code
87
+ Every generated project is **prompt-file driven**: agent prompts live in a
88
+ `prompts.json` that the generated `prompts.py` / `agents.py` load at runtime, and
89
+ `build_agents()` iterates over that file. So adding an agent/prompt — at creation
90
+ (`agentx new --prompt`) or afterward (`agentx prompt add|set|remove`, or editing the
91
+ file) — changes the running project **without touching code**. `prompts_store.py`
92
+ provides the safe read/modify/write helpers the CLI uses.
93
+
94
+ ## Design principles
95
+ - **Provider-agnostic core, lazy provider imports** — install only what you use.
96
+ - **One spec, two surfaces** — the same `ProjectSpec` drives interactive and programmatic generation.
97
+ - **Generated code is readable** — templates produce idiomatic, commented code, not a black box.
98
+ - **Graceful degradation** — optional capabilities never hard-crash the import.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,289 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentx-kit
3
+ Version: 0.2.0
4
+ Summary: An open-source, provider-agnostic agentic framework + interactive project scaffolder for LangChain and CrewAI. Pick your LLM provider, agents, RAG, memory, MCP tools and skills — generate a ready-to-run uv project.
5
+ Project-URL: Homepage, https://github.com/muhammadyahiya/agentx-kit
6
+ Project-URL: Repository, https://github.com/muhammadyahiya/agentx-kit
7
+ Project-URL: Issues, https://github.com/muhammadyahiya/agentx-kit/issues
8
+ Author: AgentX
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agents,azure,bedrock,crewai,gemini,langchain,llm,mcp,openrouter,rag,scaffold,vertex
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Software Development :: Code Generators
23
+ Requires-Python: <3.14,>=3.10
24
+ Requires-Dist: jinja2>=3.1.0
25
+ Requires-Dist: langchain-core>=0.3.0
26
+ Requires-Dist: pydantic-settings>=2.2.0
27
+ Requires-Dist: pydantic>=2.7.0
28
+ Requires-Dist: python-dotenv>=1.0.0
29
+ Requires-Dist: questionary>=2.0.0
30
+ Requires-Dist: rich>=13.7.0
31
+ Requires-Dist: typer>=0.12.0
32
+ Provides-Extra: all
33
+ Requires-Dist: chromadb>=0.5.0; extra == 'all'
34
+ Requires-Dist: fastapi>=0.110.0; extra == 'all'
35
+ Requires-Dist: langchain-anthropic>=0.2.0; extra == 'all'
36
+ Requires-Dist: langchain-aws>=0.2.0; extra == 'all'
37
+ Requires-Dist: langchain-community>=0.3.0; extra == 'all'
38
+ Requires-Dist: langchain-google-genai>=2.0.0; extra == 'all'
39
+ Requires-Dist: langchain-google-vertexai>=2.0.0; extra == 'all'
40
+ Requires-Dist: langchain-groq>=0.2.0; extra == 'all'
41
+ Requires-Dist: langchain-mcp-adapters>=0.1.0; extra == 'all'
42
+ Requires-Dist: langchain-ollama>=0.2.0; extra == 'all'
43
+ Requires-Dist: langchain-openai>=0.2.0; extra == 'all'
44
+ Requires-Dist: langchain-text-splitters>=0.3.0; extra == 'all'
45
+ Requires-Dist: langchain>=0.3.0; extra == 'all'
46
+ Requires-Dist: langgraph>=0.2.0; extra == 'all'
47
+ Requires-Dist: mcp>=1.2.0; extra == 'all'
48
+ Requires-Dist: openinference-instrumentation-langchain>=0.1.0; extra == 'all'
49
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20.0; extra == 'all'
50
+ Requires-Dist: opentelemetry-sdk>=1.20.0; extra == 'all'
51
+ Requires-Dist: sse-starlette>=2.0.0; extra == 'all'
52
+ Requires-Dist: uvicorn[standard]>=0.29.0; extra == 'all'
53
+ Provides-Extra: anthropic
54
+ Requires-Dist: langchain-anthropic>=0.2.0; extra == 'anthropic'
55
+ Provides-Extra: azure
56
+ Requires-Dist: langchain-openai>=0.2.0; extra == 'azure'
57
+ Provides-Extra: bedrock
58
+ Requires-Dist: langchain-aws>=0.2.0; extra == 'bedrock'
59
+ Provides-Extra: crewai
60
+ Requires-Dist: crewai>=0.70.0; extra == 'crewai'
61
+ Provides-Extra: dev
62
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
63
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
64
+ Provides-Extra: google
65
+ Requires-Dist: langchain-google-genai>=2.0.0; extra == 'google'
66
+ Provides-Extra: groq
67
+ Requires-Dist: langchain-groq>=0.2.0; extra == 'groq'
68
+ Provides-Extra: langgraph
69
+ Requires-Dist: langchain>=0.3.0; extra == 'langgraph'
70
+ Requires-Dist: langgraph>=0.2.0; extra == 'langgraph'
71
+ Provides-Extra: mcp
72
+ Requires-Dist: langchain-mcp-adapters>=0.1.0; extra == 'mcp'
73
+ Requires-Dist: mcp>=1.2.0; extra == 'mcp'
74
+ Provides-Extra: observability
75
+ Requires-Dist: openinference-instrumentation-langchain>=0.1.0; extra == 'observability'
76
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20.0; extra == 'observability'
77
+ Requires-Dist: opentelemetry-sdk>=1.20.0; extra == 'observability'
78
+ Provides-Extra: ollama
79
+ Requires-Dist: langchain-ollama>=0.2.0; extra == 'ollama'
80
+ Provides-Extra: openai
81
+ Requires-Dist: langchain-openai>=0.2.0; extra == 'openai'
82
+ Provides-Extra: openrouter
83
+ Requires-Dist: langchain-openai>=0.2.0; extra == 'openrouter'
84
+ Provides-Extra: rag
85
+ Requires-Dist: chromadb>=0.5.0; extra == 'rag'
86
+ Requires-Dist: langchain-community>=0.3.0; extra == 'rag'
87
+ Requires-Dist: langchain-text-splitters>=0.3.0; extra == 'rag'
88
+ Provides-Extra: server
89
+ Requires-Dist: fastapi>=0.110.0; extra == 'server'
90
+ Requires-Dist: sse-starlette>=2.0.0; extra == 'server'
91
+ Requires-Dist: uvicorn[standard]>=0.29.0; extra == 'server'
92
+ Provides-Extra: vertex
93
+ Requires-Dist: langchain-google-vertexai>=2.0.0; extra == 'vertex'
94
+ Description-Content-Type: text/markdown
95
+
96
+ # 🧬 AgentX-Kit
97
+
98
+ [![PyPI](https://img.shields.io/pypi/v/agentx-kit.svg)](https://pypi.org/project/agentx-kit/)
99
+ [![Python](https://img.shields.io/pypi/pyversions/agentx-kit.svg)](https://pypi.org/project/agentx-kit/)
100
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
101
+
102
+ **A provider-agnostic agentic framework + interactive project scaffolder for LangChain & CrewAI.**
103
+
104
+ Pick your LLM provider (OpenAI, Azure, OpenRouter, Anthropic, Gemini, Vertex AI,
105
+ Bedrock, Groq, Ollama), choose your framework, agents, RAG, memory, MCP tools and
106
+ skills — and AgentX-Kit generates a **ready-to-run project in its own `uv`
107
+ virtual environment**.
108
+
109
+ ```bash
110
+ pip install "agentx-kit[all]"
111
+ agentx new # interactive wizard → scaffolds a uv project
112
+ ```
113
+
114
+ > The PyPI distribution is **`agentx-kit`**; the import name and CLI are **`agentx`**
115
+ > (`pip install agentx-kit` → `import agentx` / `agentx --help`).
116
+
117
+ ## 📦 Installation
118
+
119
+ ### From PyPI (recommended)
120
+ ```bash
121
+ pip install agentx-kit # core: CLI + scaffolder + base abstractions
122
+ pip install "agentx-kit[all]" # everything
123
+ ```
124
+ Each LLM provider is an **optional extra** so you only pull the SDKs you use:
125
+ ```bash
126
+ pip install "agentx-kit[openai,langgraph]" # OpenAI + LangGraph
127
+ pip install "agentx-kit[bedrock,crewai,rag,mcp]" # Bedrock + CrewAI + RAG + MCP
128
+ ```
129
+
130
+ ### Using `uv`
131
+ ```bash
132
+ uv pip install "agentx-kit[all]"
133
+ ```
134
+
135
+ ### From GitHub (latest, unreleased)
136
+ ```bash
137
+ pip install "agentx-kit[all] @ git+https://github.com/muhammadyahiya/agentx-kit.git"
138
+ ```
139
+
140
+ ### From a local clone (development)
141
+ ```bash
142
+ git clone https://github.com/muhammadyahiya/agentx-kit.git
143
+ cd agentx-kit
144
+ uv venv && uv pip install -e ".[all,dev]" # or: pip install -e ".[all,dev]"
145
+ pytest -q
146
+ ```
147
+
148
+ > Requires **Python 3.10–3.13** and (for the scaffolder's `.venv` creation)
149
+ > [`uv`](https://docs.astral.sh/uv/).
150
+
151
+ ### Verify
152
+ ```bash
153
+ agentx version
154
+ agentx providers # lists every provider + the env vars it needs
155
+ ```
156
+
157
+ ## Why
158
+ - **One factory, every provider.** `get_chat_model("bedrock", ...)` or
159
+ `get_chat_model("openrouter", ...)` — same call, lazy imports, install only
160
+ the extras you use.
161
+ - **Two frameworks.** LangChain/LangGraph *and* CrewAI from the same building blocks.
162
+ - **Batteries included.** RAG, short/long-term memory, MCP tools, and a skills
163
+ registry — each optional and gracefully degrading.
164
+ - **Scaffolder, not a black box.** The generated project is readable, idiomatic
165
+ code you own, pre-wired to your selections, in a fresh `.venv`.
166
+
167
+ ## Use as a library
168
+ ```python
169
+ from agentx import get_chat_model, list_providers
170
+
171
+ llm = get_chat_model("openai", "gpt-4o-mini")
172
+ print(llm.invoke("Say hi in 3 words").content)
173
+
174
+ for spec in list_providers():
175
+ print(spec.id, "→", spec.label)
176
+ ```
177
+
178
+ CrewAI:
179
+ ```python
180
+ from agentx import get_crewai_llm
181
+ llm = get_crewai_llm("openrouter", "anthropic/claude-3.5-sonnet")
182
+ ```
183
+
184
+ ## Scaffold a project
185
+ ```bash
186
+ agentx new # fully interactive
187
+ agentx new --name my-bot --yes # accept sensible defaults
188
+ agentx providers # list providers + required env vars
189
+ ```
190
+
191
+ The wizard asks, one option at a time:
192
+
193
+ 1. Project name & target directory
194
+ 2. Framework — **LangGraph** or **CrewAI**
195
+ 3. LLM **provider** and **model**
196
+ 4. Number of **agents** (and their roles)
197
+ 5. **RAG** module? (vector store)
198
+ 6. **Memory**? (short-term / long-term / both)
199
+ 7. **MCP tools**?
200
+ 8. **Skills** integration?
201
+ 9. **Prompt** style (defaults or scaffolded custom prompts)
202
+ 10. Create `.venv` and `uv sync` now?
203
+
204
+ It then renders the project, writes a feature-aware `pyproject.toml` + `.env.example`,
205
+ and runs `uv venv` to create `.venv`.
206
+
207
+ ## Prompts: add at creation, or any time after
208
+ Prompts are **not baked into code** — every generated project keeps them in a
209
+ `prompts.json` that `agents.py` loads dynamically. Add an entry and the project
210
+ runs it on next start, **no code changes**.
211
+
212
+ ```bash
213
+ # at creation
214
+ agentx new --yes -n chatops --prompt "You are a senior DevOps engineer. Be terse."
215
+
216
+ # after creation (run inside the project)
217
+ agentx prompt list
218
+ agentx prompt set assistant --text "You are an SRE. Prioritise reliability."
219
+ agentx prompt add reviewer --role "Code Reviewer" --goal "Review diffs" \
220
+ --text "You review code for bugs and security."
221
+ agentx prompt remove reviewer
222
+ ```
223
+
224
+ `prompts.json`:
225
+ ```json
226
+ {
227
+ "with_rag": false,
228
+ "agents": {
229
+ "assistant": {"role": "...", "goal": "...", "system_prompt": "You are ..."}
230
+ }
231
+ }
232
+ ```
233
+ A blank `system_prompt` is auto-derived from the agent's role + goal. You can also
234
+ just open `prompts.json` in an editor — the CLI is a convenience, not a gate.
235
+
236
+ ## 🏢 Enterprise pack
237
+ Generate a production-shaped project with one flag — informed by a survey of
238
+ CrewAI/LangGraph/create-llama/AgentStack/agno/pydantic-ai (see [RESEARCH.md](RESEARCH.md)):
239
+
240
+ ```bash
241
+ agentx new --yes -n my-bot --enterprise # everything below
242
+ # or pick individually:
243
+ agentx new --yes -n my-bot --observability --guardrails --serve --docker --ci --evals
244
+ ```
245
+
246
+ What `--enterprise` adds to the generated project:
247
+ - **Observability** — OpenTelemetry GenAI tracing + optional Langfuse (`observability.py`), opt-out via `AGENTX_TELEMETRY=false`.
248
+ - **Guardrails** — input/output validation + PII redaction (`guardrails.py`).
249
+ - **FastAPI server** — `server.py` with `/health`, `/chat`, and SSE `/chat/stream`.
250
+ - **Docker** — `Dockerfile` + `docker-compose.yml` (+ `.dockerignore`).
251
+ - **CI** — `.github/workflows/ci.yml` (lint + compile + tests, optional eval gate).
252
+ - **Evals** — `evals/` LLM-as-judge harness runnable locally and in CI.
253
+ - **Typed config** — `config.py` via `pydantic-settings` (12-factor).
254
+ - **Manifest** — `agentx.json` declaring framework, provider, features (à la `langgraph.json`).
255
+
256
+ These are also usable as a **library** in any project:
257
+ ```python
258
+ from agentx import (
259
+ setup_tracing, get_callbacks, # observability
260
+ build_resilient_chat, # retries + provider fallbacks
261
+ UsageLimits, UsageTracker, # token/cost budgets
262
+ apply_guards, structured_model, # guardrails + typed outputs
263
+ )
264
+ setup_tracing("my-service")
265
+ llm = build_resilient_chat("openai", "gpt-4o-mini", fallbacks=[("anthropic", "claude-3-5-sonnet-latest")])
266
+ ```
267
+
268
+ ## Installation extras
269
+ | Extra | Installs | For |
270
+ |---|---|---|
271
+ | `openai` / `azure` / `openrouter` | `langchain-openai` | OpenAI-compatible |
272
+ | `anthropic` | `langchain-anthropic` | Claude |
273
+ | `google` | `langchain-google-genai` | Gemini (AI Studio) |
274
+ | `vertex` | `langchain-google-vertexai` | Vertex AI |
275
+ | `bedrock` | `langchain-aws` | Amazon Bedrock |
276
+ | `groq` | `langchain-groq` | Groq |
277
+ | `ollama` | `langchain-ollama` | local |
278
+ | `langgraph` | `langgraph`, `langchain` | LangGraph agents |
279
+ | `crewai` | `crewai` | CrewAI crews |
280
+ | `rag` | `langchain-community`, `chromadb` | RAG |
281
+ | `mcp` | `langchain-mcp-adapters` | MCP tools |
282
+ | `observability` | `opentelemetry-*`, `openinference-*` | tracing |
283
+ | `server` | `fastapi`, `uvicorn` | serving |
284
+ | `all` | everything above | kitchen sink |
285
+
286
+ See [DESIGN.md](DESIGN.md) for the architecture and [RESEARCH.md](RESEARCH.md) for the competitive analysis behind these features.
287
+
288
+ ## License
289
+ MIT
@@ -0,0 +1,194 @@
1
+ # 🧬 AgentX-Kit
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/agentx-kit.svg)](https://pypi.org/project/agentx-kit/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/agentx-kit.svg)](https://pypi.org/project/agentx-kit/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
6
+
7
+ **A provider-agnostic agentic framework + interactive project scaffolder for LangChain & CrewAI.**
8
+
9
+ Pick your LLM provider (OpenAI, Azure, OpenRouter, Anthropic, Gemini, Vertex AI,
10
+ Bedrock, Groq, Ollama), choose your framework, agents, RAG, memory, MCP tools and
11
+ skills — and AgentX-Kit generates a **ready-to-run project in its own `uv`
12
+ virtual environment**.
13
+
14
+ ```bash
15
+ pip install "agentx-kit[all]"
16
+ agentx new # interactive wizard → scaffolds a uv project
17
+ ```
18
+
19
+ > The PyPI distribution is **`agentx-kit`**; the import name and CLI are **`agentx`**
20
+ > (`pip install agentx-kit` → `import agentx` / `agentx --help`).
21
+
22
+ ## 📦 Installation
23
+
24
+ ### From PyPI (recommended)
25
+ ```bash
26
+ pip install agentx-kit # core: CLI + scaffolder + base abstractions
27
+ pip install "agentx-kit[all]" # everything
28
+ ```
29
+ Each LLM provider is an **optional extra** so you only pull the SDKs you use:
30
+ ```bash
31
+ pip install "agentx-kit[openai,langgraph]" # OpenAI + LangGraph
32
+ pip install "agentx-kit[bedrock,crewai,rag,mcp]" # Bedrock + CrewAI + RAG + MCP
33
+ ```
34
+
35
+ ### Using `uv`
36
+ ```bash
37
+ uv pip install "agentx-kit[all]"
38
+ ```
39
+
40
+ ### From GitHub (latest, unreleased)
41
+ ```bash
42
+ pip install "agentx-kit[all] @ git+https://github.com/muhammadyahiya/agentx-kit.git"
43
+ ```
44
+
45
+ ### From a local clone (development)
46
+ ```bash
47
+ git clone https://github.com/muhammadyahiya/agentx-kit.git
48
+ cd agentx-kit
49
+ uv venv && uv pip install -e ".[all,dev]" # or: pip install -e ".[all,dev]"
50
+ pytest -q
51
+ ```
52
+
53
+ > Requires **Python 3.10–3.13** and (for the scaffolder's `.venv` creation)
54
+ > [`uv`](https://docs.astral.sh/uv/).
55
+
56
+ ### Verify
57
+ ```bash
58
+ agentx version
59
+ agentx providers # lists every provider + the env vars it needs
60
+ ```
61
+
62
+ ## Why
63
+ - **One factory, every provider.** `get_chat_model("bedrock", ...)` or
64
+ `get_chat_model("openrouter", ...)` — same call, lazy imports, install only
65
+ the extras you use.
66
+ - **Two frameworks.** LangChain/LangGraph *and* CrewAI from the same building blocks.
67
+ - **Batteries included.** RAG, short/long-term memory, MCP tools, and a skills
68
+ registry — each optional and gracefully degrading.
69
+ - **Scaffolder, not a black box.** The generated project is readable, idiomatic
70
+ code you own, pre-wired to your selections, in a fresh `.venv`.
71
+
72
+ ## Use as a library
73
+ ```python
74
+ from agentx import get_chat_model, list_providers
75
+
76
+ llm = get_chat_model("openai", "gpt-4o-mini")
77
+ print(llm.invoke("Say hi in 3 words").content)
78
+
79
+ for spec in list_providers():
80
+ print(spec.id, "→", spec.label)
81
+ ```
82
+
83
+ CrewAI:
84
+ ```python
85
+ from agentx import get_crewai_llm
86
+ llm = get_crewai_llm("openrouter", "anthropic/claude-3.5-sonnet")
87
+ ```
88
+
89
+ ## Scaffold a project
90
+ ```bash
91
+ agentx new # fully interactive
92
+ agentx new --name my-bot --yes # accept sensible defaults
93
+ agentx providers # list providers + required env vars
94
+ ```
95
+
96
+ The wizard asks, one option at a time:
97
+
98
+ 1. Project name & target directory
99
+ 2. Framework — **LangGraph** or **CrewAI**
100
+ 3. LLM **provider** and **model**
101
+ 4. Number of **agents** (and their roles)
102
+ 5. **RAG** module? (vector store)
103
+ 6. **Memory**? (short-term / long-term / both)
104
+ 7. **MCP tools**?
105
+ 8. **Skills** integration?
106
+ 9. **Prompt** style (defaults or scaffolded custom prompts)
107
+ 10. Create `.venv` and `uv sync` now?
108
+
109
+ It then renders the project, writes a feature-aware `pyproject.toml` + `.env.example`,
110
+ and runs `uv venv` to create `.venv`.
111
+
112
+ ## Prompts: add at creation, or any time after
113
+ Prompts are **not baked into code** — every generated project keeps them in a
114
+ `prompts.json` that `agents.py` loads dynamically. Add an entry and the project
115
+ runs it on next start, **no code changes**.
116
+
117
+ ```bash
118
+ # at creation
119
+ agentx new --yes -n chatops --prompt "You are a senior DevOps engineer. Be terse."
120
+
121
+ # after creation (run inside the project)
122
+ agentx prompt list
123
+ agentx prompt set assistant --text "You are an SRE. Prioritise reliability."
124
+ agentx prompt add reviewer --role "Code Reviewer" --goal "Review diffs" \
125
+ --text "You review code for bugs and security."
126
+ agentx prompt remove reviewer
127
+ ```
128
+
129
+ `prompts.json`:
130
+ ```json
131
+ {
132
+ "with_rag": false,
133
+ "agents": {
134
+ "assistant": {"role": "...", "goal": "...", "system_prompt": "You are ..."}
135
+ }
136
+ }
137
+ ```
138
+ A blank `system_prompt` is auto-derived from the agent's role + goal. You can also
139
+ just open `prompts.json` in an editor — the CLI is a convenience, not a gate.
140
+
141
+ ## 🏢 Enterprise pack
142
+ Generate a production-shaped project with one flag — informed by a survey of
143
+ CrewAI/LangGraph/create-llama/AgentStack/agno/pydantic-ai (see [RESEARCH.md](RESEARCH.md)):
144
+
145
+ ```bash
146
+ agentx new --yes -n my-bot --enterprise # everything below
147
+ # or pick individually:
148
+ agentx new --yes -n my-bot --observability --guardrails --serve --docker --ci --evals
149
+ ```
150
+
151
+ What `--enterprise` adds to the generated project:
152
+ - **Observability** — OpenTelemetry GenAI tracing + optional Langfuse (`observability.py`), opt-out via `AGENTX_TELEMETRY=false`.
153
+ - **Guardrails** — input/output validation + PII redaction (`guardrails.py`).
154
+ - **FastAPI server** — `server.py` with `/health`, `/chat`, and SSE `/chat/stream`.
155
+ - **Docker** — `Dockerfile` + `docker-compose.yml` (+ `.dockerignore`).
156
+ - **CI** — `.github/workflows/ci.yml` (lint + compile + tests, optional eval gate).
157
+ - **Evals** — `evals/` LLM-as-judge harness runnable locally and in CI.
158
+ - **Typed config** — `config.py` via `pydantic-settings` (12-factor).
159
+ - **Manifest** — `agentx.json` declaring framework, provider, features (à la `langgraph.json`).
160
+
161
+ These are also usable as a **library** in any project:
162
+ ```python
163
+ from agentx import (
164
+ setup_tracing, get_callbacks, # observability
165
+ build_resilient_chat, # retries + provider fallbacks
166
+ UsageLimits, UsageTracker, # token/cost budgets
167
+ apply_guards, structured_model, # guardrails + typed outputs
168
+ )
169
+ setup_tracing("my-service")
170
+ llm = build_resilient_chat("openai", "gpt-4o-mini", fallbacks=[("anthropic", "claude-3-5-sonnet-latest")])
171
+ ```
172
+
173
+ ## Installation extras
174
+ | Extra | Installs | For |
175
+ |---|---|---|
176
+ | `openai` / `azure` / `openrouter` | `langchain-openai` | OpenAI-compatible |
177
+ | `anthropic` | `langchain-anthropic` | Claude |
178
+ | `google` | `langchain-google-genai` | Gemini (AI Studio) |
179
+ | `vertex` | `langchain-google-vertexai` | Vertex AI |
180
+ | `bedrock` | `langchain-aws` | Amazon Bedrock |
181
+ | `groq` | `langchain-groq` | Groq |
182
+ | `ollama` | `langchain-ollama` | local |
183
+ | `langgraph` | `langgraph`, `langchain` | LangGraph agents |
184
+ | `crewai` | `crewai` | CrewAI crews |
185
+ | `rag` | `langchain-community`, `chromadb` | RAG |
186
+ | `mcp` | `langchain-mcp-adapters` | MCP tools |
187
+ | `observability` | `opentelemetry-*`, `openinference-*` | tracing |
188
+ | `server` | `fastapi`, `uvicorn` | serving |
189
+ | `all` | everything above | kitchen sink |
190
+
191
+ See [DESIGN.md](DESIGN.md) for the architecture and [RESEARCH.md](RESEARCH.md) for the competitive analysis behind these features.
192
+
193
+ ## License
194
+ MIT