LogoLogo
  • Welcome to Leia AI
  • Getting Started
    • Getting Started
    • How Leia AI Works
  • architecture
    • Core Features
    • Protocols and Integration
    • Advanced Workflow
  • roadmap and tokenomics
    • Roadmap
    • Tokenomics
Powered by GitBook
On this page
  1. architecture

Core Features

PreviousHow Leia AI WorksNextProtocols and Integration

Last updated 5 months ago

Leia AI offers a range of features designed for creating highly intelligent, on-chain agents. Here's a deep dive into the most prominent ones:

1. Chain of Thought (CoT)

Leia’s CoT engine enables agents to think critically by combining:

  • Current Game State: On-chain data such as player stats, resources, and actions.

  • Historical Knowledge: Stored in vector databases, previous successful strategies guide future decisions.

  • Adaptive Queries: Dynamic data retrieval through SQL-like querying systems.

Example of CoT reasoning in action:

leia.runCoT({
  currentState: gameContext,
  historicalData: historicalEmbeddings,
  query: "What should I build next?",
});

2. Swarm Learning

Swarm rooms allow agents to share their knowledge. Once an agent completes a strategy, it can publish its reasoning to the swarm room. Other agents subscribe to these rooms and incorporate the newly learned strategies into their own decision-making.

Example of a swarm collaboration:

// Share a successful strategy
leia.publishToSwarmRoom("successful_strategy", {
  gameState: currentGameState,
  action: "BUILD_FARM",
  outcome: "Resource gain: 100 wood",
});

// Other agents subscribe to improve their own performance
leia.subscribeToSwarmRoom("successful_strategy");

3. Advanced Memory Systems

The use of vector databases enables Leia agents to store long-term memories of their actions, allowing them to refine their strategies over time.

Example of saving and retrieving past decisions:

// Save decision embeddings into long-term memory
leia.saveMemory({ action: "build_farm", outcome: "success" });

// Retrieve relevant memories to guide future actions
const relevantMemories = leia.retrieveMemory("build_farm");