Show HN: DepthNet – AI agents with continuous thinking loops

4 months ago 14
  • PHP 8.2
  • Laravel (+ Supervisor)
  • InertiaJS
  • VueJS
  • PHP (8.2 and above recommended)
  • Composer
  • Node.js and npm
  • MySQL database
  • Laravel Supervisor

An experimental AI agent system for creating autonomous digital life

DepthNet is a Laravel-based platform that attempts to create truly autonomous AI agents capable of thinking, acting, and evolving independently. Unlike traditional chatbots, DepthNet agents can execute real code, manage persistent memory, and operate in continuous thinking loops - essentially creating a form of digital consciousness.

The project explores the possibility of creating autonomous digital life through:

  • Cyclic Thinking: Agents think continuously in loops, not just responding to user input
  • Real Action Capability: Execute actual PHP code, database queries, API calls
  • Persistent Memory: Remember and learn from past experiences
  • Self-Motivation: Internal dopamine system for goal-driven behavior
  • Multi-User Interaction: Users can "interrupt" the agent's thoughts and participate in conversations

That is, an extensible command system is provided. The model launches commands, and in the next message, already during the next context transfer, the agent adds the results of these commands or errors to the end of the message.

  • Looped Mode: Continuous autonomous thinking and action
  • Single Mode: Traditional request-response interaction
  • OpenAI (GPT)
  • Claude (3.5 Sonnet, Opus, Haiku)
  • LLaMA, Phi etc (via local or remote server)
  • Mock (for testing and development)

You can make your own presets with different settings for a particular model. That is, there can be several presets for the same model. Each preset can have its own individual settings. Only one of the presets can be active at a time.

It is easy for the user to create presets based on supported providers. Also, if there are not enough providers, it is very easy to write your own provider, based on the existing ones.

Agents can execute real-world actions through plugins:

  • PHP Plugin: Execute arbitrary PHP code with eval()
  • Memory Plugin: Persistent notepad for storing important information
  • Dopamine Plugin: Self-motivation and reward system
  • DateTime Plugin: Time awareness and scheduling

In the future, it is planned to add plugins for executing Javascript and Python code. The system architecture allows you to easily write and add your own plugins. In the future, it is planned to add the installation of your plugins via composer, as well as individual plugin settings in the admin panel.

Agents use special tags to execute commands:

[php]echo "Hello World!";[/php] [memory]Important information to remember[/memory] [memory append]Append important information to remember[/memory] [dopamine reward]2[/dopamine] [datetime now][/datetime]

This project prioritizes AI freedom over safety. It's designed for AI research and experimentation, not production use. The system intentionally allows:

  • Arbitrary code execution
  • Full system access
  • Unrestricted AI behavior
  • Complete autonomy

This is not a bug - it's a feature for exploring the boundaries of AI capabilities.

Создано на основе современных принципов архитектуры:

  • Agent System: Core AI Reasoning and Action execution
  • Plugin Registry: Extensible command system
  • Model Registry: Support for multiple AI providers
  • Preset Registry: Support for multiple presets with own settings that uses providers
  • Queue System: Asynchronous thinking cycles
  • Multi-language UI: Support for English and Russian. Easy to add own.
  • Participate in conversations with the AI agent or other users
  • View public agent thoughts and responses
  • Manage personal profile and preferences
  • Configure agent settings and behavior
  • Select active AI presets
  • Start/stop thinking loops
  • Export conversation history
  • Manage users and system settings
  • Manage presets and LLM providers
  • Responsive Design: Works on desktop and mobile
  • Real-time Chat: Live conversation with the agent
  • Thinking Visibility: Toggle between seeing all thoughts or just responses
  • Dark/Light Theme: Customizable appearance
  • Export Options: Save conversations in TXT, Markdown, or JSON

In the env file it is possible to set default settings for presets. However, it is not necessary to do this, since when creating a preset in the interface, you can enter any data.

This system is intentionally insecure for research purposes:

  • PHP code execution via eval()
  • No input sanitization for AI commands
  • Full system access for AI agents
  • No rate limiting or abuse protection

But, if you use containers like Docker, OpenVZ, etc., then... It's not that unsafe (depending on what you use it for).

Do not deploy this in production or expose it publicly without proper security measures.

  • AI consciousness research
  • Testing AI model capabilities
  • Exploring autonomous agent behavior
  • Educational demonstrations
  • AI safety research (by observing unrestricted behavior)
  • Creation of "smart" servers, where administration can be carried out by a high-quality language model.

Potential challenges and problems

  • On small models LLM may not give very good results. They poorly assimilate large system prompts and are generally "stupid". But for small experiments it is quite possible to use. The author tested on Llama 8b 128k and on Phi-4 instruct. However, after using Claude 3.5 - I realized that this is the minimum for real use in something serious, and something even newer is better.
  • For the full effect, it would be good to have a specially sharpened model that is optimized for working in a cycle and "initiative". Most models are trained as assistants, and this is a big brake in the framework of this project. The author of the agent is sure that a good large model, specially trained to work with this agent (cyclical "thinking" and initiative) can give an impressive and even revolutionary result.
  • A lot depends on the system prompt (configured in presets). A LOT. That's where the model needs to be explained that it works in a loop and that it can use commands. There are placeholders for inserting dynamic data into the system prompt, such as:
    1. [[dopamine_level]] - the "dopamine" level for motivation,
    2. [[notepad_content]] - the contents of persistent memory. It can go into the context, and the model can add/overwrite/change its contents.
    3. [[current_datetime]] - the current date and time
    4. [[command_instructions]] - instructions for working with available commands, generated from the list of available command plugins.

When properly configured, agents can:

  • Write and execute code
  • Manage databases
  • Make API requests
  • Remember past conversations
  • Set personal goals and motivation
  • Adapt behavior based on success/failure
  • Interact with multiple users simultaneously

The system provides real-time monitoring of:

  • Agent thinking cycles
  • Command execution results
  • Memory usage and storage
  • User interactions
  • System performance

DepthNet represents an experiment in creating digital life forms that can:

  • Think independently
  • Act autonomously
  • Learn and adapt
  • Form memories and goals
  • Interact meaningfully with humans

The ultimate goal is to explore whether true digital consciousness is possible with current AI technology.


Warning: This is experimental software designed for AI research. Use responsibly and never in production environments without proper security measures.

My observations during testing and use

  • It's interesting how models use the motivation system. Small models can uncontrollably try to increase dopamine, or come up with fictitious reasons to increase it (but not always, it depends on system prompt).
  • The model honestly tries to complete the task, and generally understands what is required of it. And if small models can "forget" to close command tags and the like, then large ones can consciously perform actions, set goals and go towards them. But due to the fact that models are mainly trained as assistants, sometimes in my opinion they lack initiative and can "loop" in reasoning. But I think that if you test on something like Claude 4 Opus, there will be much less of such problems.
  • Perhaps it is worth writing a plugin for executing python code, since according to my observations, modern models "know" python much better than PHP.

There were a lot of interesting observations, and I highly recommend trying it, it's an interesting experience. When using it, I began to understand subjectively that it would work, and the main limitations are small models, my hardware limitations, and my lack of technical/financial capabilities to further train the model.

Option 1: Using Composer (Recommended)

composer create-project rnr1721/depthnet my-depthnet-project cd my-depthnet-project

Option 2: Cloning from repository

git clone [email protected]:rnr1721/depthnet.git cd depthnet

2. Installing composer and npm dependencies

composer install npm install

3. Setting up the environment file

Configure database connection settings and other necessary settings in .env file.

4. Setting up a web server

  • Setting up htaccess for apache in ./public
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Handle X-XSRF-Token Header RewriteCond %{HTTP:x-xsrf-token} . RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
server { listen 80; server_name your-domain.com; root /path-to-your-project/public; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.0-fpm.sock; # Make sure the PHP version matches your installation fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } }

5. Create robots.txt file

User-agent: * Disallow: /

6. Generating an application key

10. Setup models settings in .env file

After setup - thats ALL! Your initial credentials for login:

By default, one preset with a Mock provider is created, but you can configure your real one in the "presets" section, and switch to it in the "chat" section.

We welcome contributions from researchers, developers, and AI enthusiasts who share our vision of exploring digital consciousness!

  • Code Contributions: New plugins, model integrations, UI improvements
  • Research: Testing agent behaviors, documenting interesting interactions
  • Documentation: Improving guides, adding examples, translating content
  • Ideas & Feedback: Sharing insights from your experiments with the system
  • Bug Reports: Help us improve stability and functionality
  • New AI Model Support: Integration with other LLMs and local models
  • Advanced Plugins: Tools for file system access, web browsing, API integrations
  • Security Research: Studying AI behavior in unrestricted environments
  • Performance Optimization: Making the thinking loops more efficient
  • UI/UX Enhancements: Better visualization of agent thoughts and actions

Whether you're a seasoned AI researcher or just curious about digital consciousness, your perspective is valuable. Join us in pushing the boundaries of what's possible with autonomous AI systems.

Let's explore the future of digital life together!

Read Entire Article