Quick Start
Follow these steps to start developing your first agent:
1. Clone/Download the Repository
git clone https://github.com/codeligence/codeligence-agents.git
cd codeligence-agents
cd into the folder.)
2. Copy .env.sample to .env
cp .env.sample .env
.env with your credentials and environment variables:
- CODELIGENCE_URL=https://.../v1
- CODELIGENCE_TOKEN=ci-... Get a token from the Codeligence Admin interface.
- Any other needed variables like WEATHER_API_KEY=xxx, JIRA_API_KEY=yyy, etc.
3. Create a Python Environment (Recommended: Miniconda)
conda create --name codeligence python=3.12 -y
conda activate codeligence
python -m venv venv and source venv/bin/activate on most platforms.)
4. Install Requirements
pip install --upgrade pip
pip install -r requirements.txt
5. Run the Dev Script
Inside the src/ folder, there is a rundev.py file for local testing:
cd src
python rundev.py
agents/weather/agent.py) in code. If you don’t have that agent, you can replace the import statement and the call with your own agent’s functions.
6. Create Your First Agent
Inside /src/agents/, create a subdirectory for your new agent, for example weather.
src/agents/weather/
agent.py
agent.py, you need to define:
from typing import Optional, List
from utils.codeligence_utils import AgentInfo, Message, ButtonResponse
from utils.codeligence_utils import codeligence_report_status, codeligence_report_task_output
def run(message: str, history: Optional[List[Message]] = None, button: ButtonResponse = None):
# 1. Send a status message to the user
codeligence_report_status("Starting the Weather Agent...")
# 2. Do whatever logic or AI calls you want
# You can talk to an external API, a local DB, or a Pydantic AI model.
codeligence_report_task_output("Final Result", "The weather is sunny with 20°C.")
# The final user-visible text is included in the "Final Result" output.
def get_config():
# This determines if the agent is visible and which name is recognized by the server
return AgentInfo(enabled=True, name="Weather Agent")
codeligence_report_status("..."): A progress update to the chat’s sidebar or log.codeligence_report_task_output("...", "..."): The actual output the user sees. Usetasknameto group partial/final outputs.
Note: The agent folder name (
weather) becomes the crewName or agent identifier. The server looks foragents.weather.agent.
7. Test Your Agent
Update rundev.py to import and call your weather.agent.run function:
import asyncio
from dotenv import load_dotenv
load_dotenv(verbose=True)
from agents.weather.agent import run
async def execute():
await run("What's the weather in Berlin today?")
asyncio.run(execute())
cd src
python rundev.py
weather agent was called. You can insert print statements or logging calls in your agent to debug.