Quick CrewAI agentic writer and editor system that drafts stories based on a topic.
- Showcases how to use Orra with Crewai
- Showcases how to use Orra with Python
- Docker and Docker Compose
- Poetry
- OpenAI API key for Orra's Plan Engine
PLAN_CACHE_OPENAI_API_KEY
- OpenAI API key or Groq API key for Orra's Plan Engine reasoning models config
- OpenAI API key for the
writer_crew
andeditor
Agents
-
First, setup Orra and the CLI by following the installation instructions:
-
Setup your Orra project:
# Create project, add a webhook and API key
orra projects add my-python-project
orra webhooks add http://host.docker.internal:8888/webhook
orra api-keys gen ghost-key
- Configure the Ghost Writer agents:
cd examples/crewai-ghost-writers
cp _env .env
Edit the file and update the Environment variables accordingly. Use the generated ghost-key
Orra API Key as the value
for ORRA_API_KEY
.
- Ensure the control plane is running, then start the webhook server (in a separate terminal):
# Start the webhook server using the verify subcommand
orra verify webhooks start http://localhost:8888/webhook
Switch back to the main shell tab to run your agents.
- Start and register the Ghostwriters' agents:
# With Poetry
poetry install
poetry run python src/main.py
- Trigger the blog posting generation:
# Send a test message
orra verify run 'Draft a blog post' \
--data topics_file_path:'/path/to/crewai-ghostwriters/writer-topic/fisherman-story.txt' \
--data output_path:'/path/to/crewai-ghostwriters/drafts/draft.txt' \
-t '5m' \
-w http://host.docker.internal:8888/webhook
- Check the result:
orra ps
orra inspect -d <orchestration-id>
This example uses an increased orchestration timeout of 5 minutes (default is 30s).
In this context the timeout was configured using the CLI's verify
command using the --timeout
flag (-t
for short).
Sometimes the writer
Crew get stuck writing and re-writing infinitely. This is a
known ReACT prompt issue, where the prompt repetitively invokes the same function over and over.
Here, Orra is very patient because timeout has been increased to 5m
. But it does kill the orchestration after a while.
However, feel free to kill the Agent running process and start it again WITHOUT stopping the control plane.
Generally, you can keep the control plane running, while you work and update the CrewAI Agent code. Then simply,
ctrl+c
to stop the running agents- Then, run the agents again using
poetry run python src/main.py
.
That's it! Orra provides:
- Service discovery
- Health monitoring
- Reliable task execution
- Error recovery