Project is still in alpha stage

Gligabao logo over a mosaic of colorful stacked blocks

Minimal Knowledge engine for AI

Gligabao is a small MCP/HTTP/CLI server that turns free-form text into a temporal knowledge graph, then answers your questions from it, citing the facts it used. Use it over HTTP, or give its memory to Claude and other MCP clients.

python client
$ pip install gligabao

from gligabao import Client

# the API key is read from the GLIGABAO_API_KEY env var and identifies you
gb = Client("http://127.0.0.1:7878")

# remember: text in, entities and edges out
gb.remember("Alice works at Acme and lives in Paris.")

# query: an answer, with the facts it used
res = gb.query("Where does Alice work?")
print(res["answer"])   # Alice works at Acme.
Diagram of remember(): text, images and timeseries flow into a model that extracts and deduplicates entities and edges, anchored to the original text

remember()

Send text. An LLM extracts entities (people, organizations, places…) and edges (relations such as works_at), deduplicates them, and anchors everything to the original text.

  • Text, documents and images. Long texts are split into overlapping chunks, each extracted and summarized on its own; an image goes through OCR.
  • Source code. With content_type: "code", the language is detected from the code (by Jev when configured) and the graph (classes, functions, parameters, imports, calls) is read from the syntax tree with no LLM: Python, TypeScript, JavaScript, CSS and Go.
  • Temporal facts. Each fact records when it was true and when it was learned; contradicted facts are closed, not deleted.
  • Timeseries. Attach series (prices, metrics) and anchor them to the entities and facts the text yields.
  • Optional web search. web_search looks up the latest news about key entities and remembers it too.
  • Optional geo. With geo on, the entities that are places (cities, countries, landmarks) get coordinates, stored next to the graph.
  • Graph classes. On by default (classify_graph: false turns it off): an LLM gives the graph of each stored text one to three classes (supply_chain, ...), kept with the model run that chose them; with graph_classes it picks the closest of your classes. GET /v1/gb/datasets/{name}/classes lists the top classes of a dataset.
  • Choose model and reasoning per pipeline stage, to trade cost for quality.
Diagram of query(): a natural language question finds relevant entities and expands a subgraph, then the answer is reconstructed from context only, returning evidence

query()

Ask a question in natural language. Gligabao finds the relevant entities and facts, by keywords and by the similarity of their embeddings, expands the surrounding subgraph, adds the passages of long texts that are close to the question, and answers using only that context, returning the evidence it relied on.

  • Evidence you can verify. The entities, edges and passages used are returned, and each edge links back to the original text.
  • Current vs. past. Only live facts are retrieved: a superseded fact is never shown to the model. A fact that ended without being replaced keeps its end date, so questions about the past still work.
  • Grounded only in your graph. If the graph lacks the answer, it says so; cited IDs are validated, so no invented evidence.
  • Scoped to a dataset. Each user's datasets are isolated; pick one with dataset.
  • Sessions and reasoning level. Tie a query to a session_id, and set reasoning from none (default) to high.

Get started

Build it, run it, and talk to it over HTTP or MCP.

terminal
$ export ANTHROPIC_API_KEY=...
$ ./bin/gligabao serve              # listens on :7878

$ curl -X POST localhost:7878/v1/gb/remember \
    -H 'gb-user-id: u1' -d '{"text":"Alice works at Acme and lives in Paris."}'

$ curl -X POST localhost:7878/v1/gb/query \
    -H 'gb-user-id: u1' -d '{"query":"Where does Alice work?"}'

Main features

Everything an AI application needs to remember, and nothing it doesn't.

Self-hosted

Runs on your own infrastructure, so your data stays with you. One static Go binary or one container, with no CGO and no C compiler.

  • Relational DB: SQLite (a single file, the default) or PostgreSQL, chosen with db_backend. The schema is created on startup.
  • Graph store: entities, edges and artifacts are tables in the same database, so there is nothing extra to run. The graph layer is separate from the relational one, ready for dedicated graph databases.
  • Vectors: chromem-go, an embedded pure-Go store kept in a directory next to the database (the default), Pinecone, hosted, or an Amazon S3 Vectors bucket. Isolated per dataset, with one index each for entities, edges, chunks and chunk summaries, all searched by query.
  • Docker: the image runs the server as a non-root user (how the images are built). Mount a volume on /data for the database, vectors and images, and pass API keys as environment variables.
  • Docker Compose: one command starts the server, whose image contains the Python ML sidecar, with a named volume for the data.
  • Static binary: a pure-Go binary using the modernc.org/sqlite driver. Copy it anywhere and run gligabao serve. See Build for how to build it on Linux, macOS and Windows.

Isolated datasets

Memory is organized per user and dataset. Datasets are fully isolated, and a query only sees its own graph.

Long documents

Long texts are split into overlapping chunks, each extracted, stored and embedded individually.

Images

Send an image to remember() and a vision model reads it: its title and text blocks in reading order (OCR), plus a theme for the whole image.

  • Themes: plot, chart, graph, diagram, table, document, screenshot, slide, map, photo and more.
  • Formats: JPEG, PNG, GIF and WebP, up to 5 MiB.
  • Deduplicated: an image already stored in the dataset is answered by its SHA-256, with no new model call.
  • Files on disk: the database keeps metadata and what the model read, never the bytes.
  • In the graph: the description the model writes is remembered by the text pipeline, so entities and edges come out of an image and query sees them. A graph extractor hook can build that graph itself.

Timeseries

Store timeseries anchored to the entities and facts they describe.

Ontologies

Describe a domain in YAML or JSON (classes, relations, properties) and ground the graph remember extracts against it: tag what matches, flag or drop the rest, and add the ontology neighborhood of what matched (its classes, ancestors and relations) to the graph.

Geo

Optionally find the places among the entities and store their coordinates. See all features →

Git export

Export a dataset as a git repository, one commit per remember call: git log shows how the knowledge grew. See all details →

Web search

Optionally enrich memory with the latest web results about key entities.

Admin UI

A built-in web panel to inspect your memory and its graphs, follow every model call and its cost, run training and compare evals. See all features →

Evals

Two eval systems: programmatic checks of the memory pipeline against the real LLM, and an LLM judge for fine-tuned models. See all features →

Fine-tuning

Embed what remember() learned into a model's weights: Gemma 4 LoRA jobs on cloud GPUs, started from the server. See all features →

CLI for agents

Use gligabao from the command line, with no HTTP calls: remember, query (with --evidence-only to only retrieve), dataset, research, api for any other endpoint, status and stop.

  • Local daemon: the first command starts gligabao serve in the background, on 127.0.0.1 and without authentication, and later commands reuse it. --server URL targets another server.
  • Same as the API: flags or the exact REST body (--json); the response is JSON on stdout, errors are JSON on stderr, and the exit code says what failed.
  • Stable data: without a gligabao.toml in the current directory, config, database and log are in ~/.gligabao.

Research agents

Start a deep-research agent on a topic: it searches the web, reads pages and works with your knowledge base in the background, ends with a report, and you follow it state by state. Over REST (POST /v1/gb/research), MCP and gligabao research.

  • A plain tool-calling loop: no agent framework. The model uses web_search and fetch_url over several steps (and query and remember on your knowledge base), checks claims against more than one source, and the last step cannot call tools, so a run always ends with a report.
  • Tracked in the database: every run (gb_agent_research_runs) and every state the agent goes through (gb_agent_research_states: thinking, searching a query, reading a URL, ...) is stored, with steps, tokens and cost updated as it works.
  • Sub-agents: the investigative loop runs independent questions of its frontier in workers (max_parallel); the code of the loop starts them and reduces their findings, the model has no tool for it. Each worker is a run with a parent_id.
  • Investigative loop: with loop = "investigative" an agent works on a frontier of questions with notes, challenges its own claims and writes the report in a separate synthesis phase, with circuit-breakers on turns, tokens and cost.
  • Agent definitions: an agent is a TOML or JSON file (prompt, model, skills, search and knowledge settings, cost caps, and an optional CRON schedule), chosen with agent; a research can have a cost cap.
  • Isolated: each agent has a goroutine, a struct and an HTTP client of its own; a user can have 3 working at once. It needs an Anthropic API key and each run costs money.
  • In the server or in Modal: a run has a runner, local (the default) or modal, which runs the standalone gligabao_agent binary in a Modal container, and loads what the agent learned back into your knowledge base when it ends.

Embeddable in Go

Run it as a standalone server or import it as a Go library, and either start its server on its own port or mount its handlers on your program's own HTTP mux. Choose the model for each pipeline stage.

MCP tools

Gligabao is also an MCP server: Claude Desktop, Claude Code and other MCP clients can use it as their memory.

terminal
# serve remember and query as MCP tools at /v1/gb/mcp (off by default)
$ ./build/gligabao serve --mcp

# add it to Claude Code
$ claude mcp add --transport http gligabao http://localhost:7878/v1/gb/mcp

remember tool

Stores a text in memory, like remember() over HTTP: an LLM extracts the entities and edges and adds them to the graph.

  • Arguments: user_id and text are required; dataset, kind, session_id and reference_time are optional.
  • Text only for now: images, per-stage models, web search and timeseries are not available through MCP yet.

query tool

Answers a question from the graph, like query() over HTTP, with the entities, edges and passages behind the answer.

  • Arguments: user_id and query are required; dataset, session_id and reasoning (none to high) are optional.
  • Errors the model can read: an error of the endpoint comes back as a tool error with its message, so the model can fix the call.

How it works

The tools run the same handlers as the REST endpoints, so validation, events and results are identical.

  • Streamable HTTP: stateless, with plain JSON answers, at /v1/gb/mcp.
  • Research tools: research_start, research_list and research_get start and follow a research agent.
  • Off by default: turn it on with mcp = true or serve --mcp.
  • No authentication yet: callers choose the user_id, so enable it only on a trusted network.

Built with

The key technologies behind Gligabao. Hover one to see what it does.

FAQ

 

What is Gligabao?

A minimal, self-hosted memory system for AI. You send it free-form text and it builds a knowledge graph; later you ask questions in natural language and it answers from what it stored, citing the facts it used.

Where is my data stored?

On your own infrastructure, in SQLite (a single file, the default) or PostgreSQL. Embeddings are stored in an embedded vector store, in Pinecone or in Amazon S3 Vectors.

Does Gligabao keep track of facts that change over time?

Yes. Every fact is a temporal fact, recording when it was true in the world and when Gligabao learned it. Contradicted facts are closed rather than deleted, so history is preserved.

Can I embed Gligabao in my own Go program?

Yes. Gligabao is also a Go library with no CGO requirement, and the standalone server uses the same public API. It can start its own server, or register its handlers on the mux of your own HTTP server so that no second port is needed.

What is fine-tuning of models about? Do I have to use it?

Fine-tuning means further training a base model on your own examples so it gets better at your task. Gligabao can fine-tune Gemma 4 (4B, 12B or 31B, using LoRA adapters) on a cloud GPU through its Python ML sidecar and Modal, and you can run, evaluate and compare the resulting models from the admin UI. You do not have to use it: remember and query work without it, and the server runs fine with no sidecar. It is an optional extra.

How is graph data stored?

In the main database, SQLite (a single file, the default) or PostgreSQL, so no separate graph database is needed. Entities (the nodes) are rows in gb_entities, and facts (the edges) are rows in gb_edges with their event time and system time. The original text is kept as artifacts in gb_artifacts, and every fact links back to the artifact it came from. Embeddings are stored separately in the vector store. You can export a whole graph, or the graph of a single artifact, as JSON through the API.

How much configuration is needed if I decide to self-host this?

Very little. Gligabao builds as a single pure-Go binary (no CGO) with working defaults: SQLite, an embedded vector store and port 7878. You need two API keys: an Anthropic key for remember and query, and an OpenAI key for embeddings (required: remember embeds what it stores and query embeds the question). PostgreSQL, Pinecone, the admin UI and the training sidecar are all opt-in, set in one gligabao.toml file or with environment variables. docker compose is also available.

Which other memory systems influenced the design?

Mainly Graphiti and Cognee. The temporal model follows Graphiti: bi-temporal facts that are closed rather than deleted, and time-anchored episodes. The external remember and query API is adopted from Cognee, and Cognee also shaped the ideas of datasets and ontology-grounded extraction.