Skip to content

Getting Started

Installation

pip install xyberos

For the REST API server:

pip install "xyberos[web]"

Your First XYBEROS App

from xyberos import xyberos

ctx = xyberos.chat("Hello! What can you do?")
print(ctx.thought.summary)

The xyberos singleton is a unified facade that lazy-initializes all subsystems — brain, memory, reasoning, skills — on first use. Zero configuration required.

Using the API Functions

from xyberos import chat, reason, plan

# Full cognitive cycle
ctx = chat("What is the weather?")
print(f"Thought: {ctx.thought.summary}")
print(f"Action: {ctx.action.name}")

# Direct reasoning
conclusion = reason("If A > B and B > C, what follows?")
print(f"Conclusion: {conclusion}")

# Direct planning
steps = plan("Write a summary of this document")
for i, step in enumerate(steps, 1):
    print(f"{i}. {step}")

Configuration

Override defaults via environment variables, a YAML config file, or constructor arguments:

from xyberos import xyberos, XYBEROS, XyberosConfig

# Via config object
config = XyberosConfig(llm_backend="ollama", llm_model="llama3")
# Create a configured instance (or use the default singleton)
xyberos = XYBEROS(config=config)

# Via YAML file (auto-detected: ./config.xyberos.yaml or ~/.xyberos/config.xyberos.yaml)
# config.xyberos.yaml:
#   llm:
#     backend: ollama
#     model: llama3
config = XyberosConfig.load()
xyberos = XYBEROS(config=config)

# Via environment variables
# export XYBEROS_LLM_BACKEND=anthropic
# export XYBEROS_LLM_MODEL=claude-3-opus

REST API

Start the server:

pip install "xyberos[web]"
uvicorn xyberos.server.app:app --host 0.0.0.0 --port 8080

Then use curl:

curl -X POST http://localhost:8080/chat \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello!"}'

OpenAPI docs available at http://localhost:8080/docs.

Docker

docker compose up
curl http://localhost:8080/health

Next Steps