Skip to content
Back to skills

Python Agent Engine

ASecurity

A production-ready Python AI Agent engine using LangChain. Supports ReAct pattern, tool calling, and thinking process tracking.

  • 321 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
ai-agentspythonbashreactexpressapi

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 3 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add kennyzir/7deer_skills --skill python-agent-engine --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Agent Engine?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Agent Engine
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kennyzir-python-agent-engine/badge)](https://www.skillsdirectory.com/skills/kennyzir-python-agent-engine)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-agent-engine
description: A production-ready Python AI Agent engine using LangChain. Supports ReAct pattern, tool calling, and thinking process tracking.
---

# Python Agent Engine

A plug-and-play AI Agent core for Python applications. It handles the complexity of LLM interaction, tool calling loops, and context management.

## Features
- **ReAct Loop**: Automatically handles "Reasoning -> Tool Call -> Result -> Answer" process.
- **Thinking Process**: Returns structured "Thinking Steps" for UI visualization.
- **Model Agnostic**: Works with OpenAI, DeepSeek, or any OpenAI-compatible API.

## Installation

1. Copy `resources/agent_engine.py` to your project (e.g., `src/core/agent_engine.py`).
2. Install dependencies:
   ```bash
   pip install langchain-core langchain-openai python-dotenv
   ```
3. Set Environment Variables in your `.env` file:
   ```ini
   OPENAI_API_KEY=sk-...
   # Optional:
   OPENAI_BASE_URL=https://api.openai.com/v1
   ```

## Usage Example

```python
import asyncio
from langchain_core.tools import tool
from core.agent_engine import AgentEngine

# 1. Define Tools
@tool
def calculator(expression: str) -> str:
    """Calculates a math expression."""
    return str(eval(expression))

# 2. Initialize Agent
agent = AgentEngine(
    tools=[calculator],
    system_prompt="You are a helpful math assistant.",
    model_name="gpt-4o"
)

# 3. Chat
async def main():
    response = await agent.chat("What is 123 * 456?")
    
    print(f"Answer: {response.content}")
    print("\nThinking Steps:")
    for step in response.thinking_steps:
        print(f"[{step.type}] {step.content}")

if __name__ == "__main__":
    asyncio.run(main())
```

Files in this skill

  • SKILL.md1.7 KB
  • resources/agent_engine.py7.4 KB
  • resources/requirements.txt46 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.