Lightweight, Modular Agent Framework for AI planning, tools, and memory
Project description
๐ค Agentik โ Modular Agentic AI Framework for Python
A lightweight, modern, and pluggable Python framework to build AI agents with reasoning, memory, tool-use, and LLM backend support โ designed to be minimal, extensible, and developer-friendly.
๐ What is Agentik?
Agentik is a Python library that helps you build intelligent agents that can reason, plan, act, and reflect using any large language model (LLM) backend (e.g., OpenAI, Claude, Mistral via OpenRouter, or your local model). It abstracts the complexity and gives you:
- ๐ LLM plugin support (OpenAI, Claude, etc.)
- ๐ง Memory integration (Dict, JSON, Vector optional)
- ๐ Tool support (web search, calculator, file I/O)
- โ๏ธ YAML or Python-based config
- ๐ฅ CLI for easy launching and debugging
- ๐ API-key agnostic โ the user supplies their own keys
๐ Features
- Define agents in Python or YAML
- Core agent loop:
plan โ act โ reflect โ iterate - Pluggable tools and memory systems
- Easily extend tools with Python
- Support for streaming, retry, and debugging
- CLI interface built with Typer
- Designed to be lightweight, transparent, and powerful
๐ Folder Structure
agentik/
โ
โโโ agent.py # ๐ง Core agent class and reasoning loop
โโโ llms.py # ๐ LLM backend interfaces (OpenAI, Claude, etc.)
โโโ tools/ # ๐ Built-in and user-defined tools
โ โโโ __init__.py
โ โโโ calculator.py
โ โโโ websearch.py
โ โโโ filereader.py
โ โโโ ...
โโโ memory.py # ๐ง Memory backends (Dict, JSON, FAISS, etc.)
โโโ config.py # ๐งพ YAML/JSON config parser using pydantic
โโโ cli.py # ๐ป CLI interface using Typer
โโโ utils.py # โ๏ธ Logger, token counter, helper functions
โ
examples/ # ๐ฏ Sample agents and use-cases
tests/ # ๐งช Unit and integration tests
configs/ # โ๏ธ YAML-based agent configuration files
๐ง Agent Workflow
The typical execution flow of an Agent in agentik:
[User Prompt]
โ
[Agent.run(prompt)]
โ
[Plan Step] โ Uses LLM to decide next action/tool
โ
[Act Step] โ Runs selected tool or memory query
โ
[Reflect Step] โ Evaluates outcome and updates memory
โ
[Repeat or Finish]
๐ฆ Installation
Python 3.10+ is required
pip install agentik-framework
๐ Usage
โจ Create an Agent (Python Way)
from agentik import Agent
from agentik.tools import WebSearchTool, CalculatorTool
from agentik.llms import OpenAIModel
from agentik.memory import JSONMemoryStore
agent = Agent(
name="AIAssistant",
goal="Find and summarize the latest AI trends.",
tools=[WebSearchTool(), CalculatorTool()],
llm=OpenAIModel(api_key="your-api-key-here", model="gpt-4"),
memory=JSONMemoryStore("memory.json")
)
agent.run("What's the latest in AI agent frameworks?")
โ๏ธ Create an Agent via YAML (config.yaml)
name: "ResearchBot"
goal: "Summarize recent advancements in generative AI"
llm:
type: openai
model: gpt-4
api_key: "YOUR_KEY_HERE"
tools:
- web_search
- file_reader
memory:
type: json
path: "memory.json"
๐ Main File to Run
There are two main entrypoints to run the framework:
1. Python File
You can create and run a Python file such as run_agent.py:
from agentik.config import load_agent_config
from agentik.agent import Agent
agent = load_agent_config("configs/my_agent.yaml")
agent.run("What are LLM agents?")
2. CLI Command (Recommended)
agentik run configs/my_agent.yaml --verbose
Make sure you run this inside the directory containing your YAML and memory files.
๐ง Supported LLMs
agentik supports the following backends (via your API keys):
- OpenAI (via OpenRouter)
- Mistral (via OpenRouter)
- Claude (via OpenRouter)
- DeepSeek (via OpenRouter)
- Local models via REST API
All models are initialized via the llms.py interfaces and passed as parameters. No key is embedded in the code.
๐ Built-in Tools
| Tool Name | Description |
|---|---|
CalculatorTool |
Evaluate math expressions |
WebSearchTool |
Search web results using DuckDuckGo/SerpAPI |
FileReaderTool |
Read content from .txt or .md files |
JsonTool |
Work with structured JSON documents |
Tools are extendable: just subclass
Tooland implement arun(input)method.
๐ Where to Put Code?
| File | What to write here |
|---|---|
agent.py |
Core agent planning loop (already built-in) |
llms.py |
Add your own LLM wrapper classes (if needed) |
memory.py |
Custom memory strategies (default: Dict, JSON) |
tools/ |
Add new tools (e.g., mytool.py) and register dynamically |
config.py |
Modify or validate YAML loading logic (via pydantic) |
cli.py |
Main command-line logic (already pre-written via typer) |
examples/ |
Place your sample agents or demo scripts |
configs/ |
Store reusable YAML configuration for agents |
๐งช Testing
pytest tests/
You can mock LLM API responses and test agent planning, memory storage, and tool execution.
๐ฅ CLI Commands
agentik run configs/my_agent.yaml
agentik list-tools
agentik create-agent
agentik explain memory
Flags:
--verboseโ detailed logs--dry-runโ simulate without actual LLM/API calls
๐ Documentation
- Markdown-based, hosted on GitHub Pages
- Located in
docs/(optional) - Includes: Getting Started, API Reference, Tool Dev Guide
๐งโ๐ป Contributing
We welcome contributions!
- Fork this repo
- Add your tool or feature
- Write tests in
tests/ - Submit PR with clear explanation
๐ฆ Packaging (for PyPI)
python -m build
twine upload dist/*
๐ License
MIT License ยฉ 2025 [Vinay Joshi, Avinash Raghuvanshi]
๐ง Philosophy
agentik isnโt trying to do everything for you โ it gives you clean scaffolding and powerful abstractions to build your own intelligent agent workflows, your way.
Build smart. Stay lightweight. Go modular.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentik_framework-0.1.2.tar.gz.
File metadata
- Download URL: agentik_framework-0.1.2.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79f73247b3a6885475a759f39cac765daaae96a97f027cf37749c0a7b0971a11
|
|
| MD5 |
72ff3de2edd75ba03ffafd00e4f304c5
|
|
| BLAKE2b-256 |
c517f10e6c0fee2750f75f0df417f5525667cd8fa7186b23113dac6686820ff2
|
File details
Details for the file agentik_framework-0.1.2-py3-none-any.whl.
File metadata
- Download URL: agentik_framework-0.1.2-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78c581b9331d1e378baded61ec59ab386729b1b8d2239252dd9cf7b0c6d9b12d
|
|
| MD5 |
07e1aab29b1a11f31e6f84eb3b19b98c
|
|
| BLAKE2b-256 |
f8ea44aa9f8c48dc0d91ce650488a45441ebdf5f2717d10b870a5fa9a6c95788
|