Skip to main content

Crate mnemo_pgwire

Crate mnemo_pgwire 

Source
Expand description

PostgreSQL wire protocol server for Mnemo.

Exposes Mnemo’s memory database through the PostgreSQL wire protocol, allowing SQL-native clients (psql, pgAdmin, any PostgreSQL driver) to query memories using familiar SQL syntax.

§Supported SQL subset

  • SELECT * FROM memories WHERE agent_id = '...' LIMIT n
  • INSERT INTO memories (content, importance, ...) VALUES (...)
  • DELETE FROM memories WHERE id = '...'

§Architecture

The server accepts TCP connections and speaks the PostgreSQL wire protocol (startup, query, parse/bind/execute extended protocol). Queries are parsed and mapped to Mnemo engine operations:

  • SELECTengine.recall()
  • INSERTengine.remember()
  • DELETEengine.forget()

Modules§

parser
Minimal SQL parser for pgwire queries.
server
PostgreSQL wire protocol connection handler.

Structs§

PgWireConfig
Configuration for the pgwire server.

Functions§

start_server
Start the pgwire server.