@dxos/assistant 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/lib/neutral/chunk-2TBLG3XY.mjs +1793 -0
- package/dist/lib/neutral/chunk-2TBLG3XY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/extraction/index.mjs +219 -0
- package/dist/lib/neutral/extraction/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +537 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/testing/index.mjs +111 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/types/src/conversation/context.d.ts +155 -0
- package/dist/types/src/conversation/context.d.ts.map +1 -0
- package/dist/types/src/conversation/context.test.d.ts +2 -0
- package/dist/types/src/conversation/context.test.d.ts.map +1 -0
- package/dist/types/src/conversation/index.d.ts +2 -1
- package/dist/types/src/conversation/index.d.ts.map +1 -1
- package/dist/types/src/conversation/session.d.ts +78 -0
- package/dist/types/src/conversation/session.d.ts.map +1 -0
- package/dist/types/src/conversation/session.test.d.ts.map +1 -0
- package/dist/types/src/diff.d.ts +17 -0
- package/dist/types/src/diff.d.ts.map +1 -0
- package/dist/types/src/diff.test.d.ts +2 -0
- package/dist/types/src/diff.test.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +67 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/execution-graph.d.ts +85 -0
- package/dist/types/src/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-ner-function/index.d.ts +0 -1
- package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts +1 -1
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction.d.ts +1066 -215
- package/dist/types/src/extraction/extraction.d.ts.map +1 -1
- package/dist/types/src/extraction/index.d.ts +0 -1
- package/dist/types/src/extraction/index.d.ts.map +1 -1
- package/dist/types/src/extraction/quotes.d.ts +3 -3
- package/dist/types/src/extraction/quotes.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +2 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/services.d.ts +17 -0
- package/dist/types/src/functions/services.d.ts.map +1 -0
- package/dist/types/src/functions.test.d.ts +2 -0
- package/dist/types/src/functions.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +7 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/service/AgentService.d.ts +75 -0
- package/dist/types/src/service/AgentService.d.ts.map +1 -0
- package/dist/types/src/service/AgentService.test.d.ts +2 -0
- package/dist/types/src/service/AgentService.test.d.ts.map +1 -0
- package/dist/types/src/service/agent-process.d.ts +21 -0
- package/dist/types/src/service/agent-process.d.ts.map +1 -0
- package/dist/types/src/service/index.d.ts +3 -0
- package/dist/types/src/service/index.d.ts.map +1 -0
- package/dist/types/src/session/artifact-diff.d.ts +27 -0
- package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
- package/dist/types/src/session/error-handling.d.ts +4 -0
- package/dist/types/src/session/error-handling.d.ts.map +1 -0
- package/dist/types/src/session/format.d.ts +16 -0
- package/dist/types/src/session/format.d.ts.map +1 -0
- package/dist/types/src/session/format.test.d.ts +2 -0
- package/dist/types/src/session/format.test.d.ts.map +1 -0
- package/dist/types/src/session/index.d.ts +5 -1
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/observer.d.ts +23 -0
- package/dist/types/src/session/observer.d.ts.map +1 -0
- package/dist/types/src/session/request.d.ts +106 -0
- package/dist/types/src/session/request.d.ts.map +1 -0
- package/dist/types/src/session/request.test.d.ts +2 -0
- package/dist/types/src/session/request.test.d.ts.map +1 -0
- package/dist/types/src/session/session-ollama.test.d.ts +2 -0
- package/dist/types/src/session/session-ollama.test.d.ts.map +1 -0
- package/dist/types/src/session/toolkit.d.ts +16 -0
- package/dist/types/src/session/toolkit.d.ts.map +1 -0
- package/dist/types/src/session/version-pin.d.ts +5 -5
- package/dist/types/src/session/version-pin.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +2 -0
- package/dist/types/src/templates/index.d.ts.map +1 -0
- package/dist/types/src/templates/system.d.ts +17 -0
- package/dist/types/src/templates/system.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -2
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/layer.d.ts +40 -0
- package/dist/types/src/testing/layer.d.ts.map +1 -0
- package/dist/types/src/tracing.d.ts +223 -0
- package/dist/types/src/tracing.d.ts.map +1 -0
- package/dist/types/src/types/artifact.d.ts +28 -0
- package/dist/types/src/types/artifact.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -29
- package/src/conversation/context.test.ts +52 -0
- package/src/conversation/context.ts +403 -0
- package/src/conversation/index.ts +2 -1
- package/src/conversation/session.test.ts +58 -0
- package/src/conversation/session.ts +300 -0
- package/src/diff.test.ts +74 -0
- package/src/diff.ts +93 -0
- package/src/errors.ts +15 -0
- package/src/execution-graph.test.ts +740 -0
- package/src/execution-graph.ts +509 -0
- package/src/extraction/extraction-ner-function/index.ts +0 -1
- package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
- package/src/extraction/extraction-ner-function/named-entity-recognition.ts +3 -1
- package/src/extraction/extraction.ts +44 -15
- package/src/extraction/index.ts +0 -1
- package/src/extraction/quotes.test.ts +3 -3
- package/src/extraction/quotes.ts +6 -7
- package/src/functions/index.ts +5 -0
- package/src/functions/services.ts +214 -0
- package/src/functions.conversations.json +1 -0
- package/src/functions.test.ts +88 -0
- package/src/index.ts +7 -5
- package/src/service/AgentService.conversations.json +1 -0
- package/src/service/AgentService.test.ts +169 -0
- package/src/service/AgentService.ts +184 -0
- package/src/service/agent-process.ts +364 -0
- package/src/service/index.ts +6 -0
- package/src/session/artifact-diff.ts +41 -0
- package/src/session/error-handling.ts +41 -0
- package/src/session/format.test.ts +132 -0
- package/src/session/format.ts +149 -0
- package/src/session/index.ts +5 -1
- package/src/session/observer.ts +62 -0
- package/src/session/request.conversations.json +1 -0
- package/src/session/request.test.ts +195 -0
- package/src/session/request.ts +344 -0
- package/src/session/session-ollama.test.ts +81 -0
- package/src/session/toolkit.ts +47 -0
- package/src/session/version-pin.ts +12 -12
- package/src/templates/index.ts +5 -0
- package/src/templates/instructions/format.tpl +57 -0
- package/src/templates/instructions/system.tpl +85 -0
- package/src/templates/system.ts +42 -0
- package/src/testing/index.ts +2 -8
- package/src/testing/layer.ts +236 -0
- package/src/tracing.ts +43 -0
- package/src/types/artifact.ts +89 -0
- package/src/types/index.ts +5 -0
- package/src/typings.d.ts +5 -0
- package/dist/lib/browser/index.mjs +0 -2019
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/index.mjs +0 -2021
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/bin/chat.d.ts +0 -2
- package/dist/types/bin/chat.d.ts.map +0 -1
- package/dist/types/src/blueprint/blueprint.d.ts +0 -41
- package/dist/types/src/blueprint/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprint/index.d.ts +0 -3
- package/dist/types/src/blueprint/index.d.ts.map +0 -1
- package/dist/types/src/blueprint/registry.d.ts +0 -7
- package/dist/types/src/blueprint/registry.d.ts.map +0 -1
- package/dist/types/src/context/binder.d.ts +0 -34
- package/dist/types/src/context/binder.d.ts.map +0 -1
- package/dist/types/src/context/binding.d.ts +0 -38
- package/dist/types/src/context/binding.d.ts.map +0 -1
- package/dist/types/src/context/index.d.ts +0 -3
- package/dist/types/src/context/index.d.ts.map +0 -1
- package/dist/types/src/conversation/conversation.d.ts +0 -44
- package/dist/types/src/conversation/conversation.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -208
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
- package/dist/types/src/research/exa.d.ts +0 -7
- package/dist/types/src/research/exa.d.ts.map +0 -1
- package/dist/types/src/research/graph.d.ts +0 -41
- package/dist/types/src/research/graph.d.ts.map +0 -1
- package/dist/types/src/research/graph.test.d.ts +0 -2
- package/dist/types/src/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/research/index.d.ts +0 -4
- package/dist/types/src/research/index.d.ts.map +0 -1
- package/dist/types/src/research/research.d.ts +0 -10
- package/dist/types/src/research/research.d.ts.map +0 -1
- package/dist/types/src/research/research.test.d.ts +0 -2
- package/dist/types/src/research/research.test.d.ts.map +0 -1
- package/dist/types/src/session/session.d.ts +0 -283
- package/dist/types/src/session/session.d.ts.map +0 -1
- package/dist/types/src/session/session.test.d.ts.map +0 -1
- package/dist/types/src/session/version-pin.test.d.ts +0 -2
- package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
- package/dist/types/src/summarization/summarization.test.d.ts +0 -2
- package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -3
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/blueprint/blueprint.ts +0 -75
- package/src/blueprint/index.ts +0 -6
- package/src/blueprint/registry.ts +0 -15
- package/src/context/binder.ts +0 -101
- package/src/context/binding.ts +0 -31
- package/src/context/index.ts +0 -6
- package/src/conversation/conversation.ts +0 -103
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -95
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -66
- package/src/extraction/extraction-llm-function/index.ts +0 -5
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -115
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -54
- package/src/research/exa.ts +0 -100
- package/src/research/graph.test.ts +0 -15
- package/src/research/graph.ts +0 -337
- package/src/research/index.ts +0 -7
- package/src/research/instructions-research.tpl +0 -97
- package/src/research/research.test.ts +0 -190
- package/src/research/research.ts +0 -90
- package/src/session/session.test.ts +0 -275
- package/src/session/session.ts +0 -582
- package/src/session/version-pin.test.ts +0 -26
- package/src/summarization/summarization.test.ts +0 -221
- package/src/testing/exa-search-1748337321991.ts +0 -131
- package/src/testing/exa-search-1748337331526.ts +0 -144
- package/src/testing/exa-search-1748337344119.ts +0 -133
- package/src/typedefs.d.ts +0 -8
- package/src/types.ts +0 -8
- /package/dist/types/src/{session → conversation}/session.test.d.ts +0 -0
- /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprint/blueprint.ts", "../../../src/blueprint/registry.ts", "../../../src/context/binder.ts", "../../../src/context/binding.ts", "../../../src/conversation/conversation.ts", "../../../src/session/session.ts", "../../../src/session/version-pin.ts", "../../../src/extraction/extraction.ts", "../../../src/extraction/extraction-llm-function/extraction-llm-function.ts", "raw-loader:./instructions.tpl?raw", "../../../src/extraction/quotes.ts", "../../../src/extraction/extraction-ner-function/extraction-ner-function.ts", "../../../src/extraction/extraction-ner-function/named-entity-recognition.ts", "../../../src/research/exa.ts", "../../../src/testing/exa-search-1748337321991.ts", "../../../src/testing/exa-search-1748337331526.ts", "../../../src/testing/exa-search-1748337344119.ts", "../../../src/testing/index.ts", "../../../src/research/research.ts", "../../../src/research/graph.ts", "raw-loader:./instructions-research.tpl?raw", "../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { ToolId } from '@dxos/ai';\nimport { Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\n\n/**\n * Blueprint schema defines the structure for AI assistant blueprints.\n * Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.\n */\nexport const Blueprint = Schema.Struct({\n /**\n * Global registry ID.\n * NOTE: Once a blueprint has been cloned from the registry, its stored definition may converge,\n * but the `key` property refers to the original registry entry.\n */\n // TODO(burdon): Create Format type.\n key: Schema.String.annotations({\n description: 'Unique registration key for the blueprint',\n }),\n\n /**\n * Human-readable name of the blueprint.\n */\n name: Schema.String.annotations({\n description: 'Human-readable name of the blueprint',\n }),\n\n /**\n * Description of the blueprint's purpose and functionality.\n */\n description: Schema.optional(Schema.String).annotations({\n description: \"Description of the blueprint's purpose and functionality\",\n }),\n\n /**\n * Instructions that guide the AI assistant's behavior and responses.\n * These are system prompts or guidelines that the AI should follow.\n */\n instructions: Schema.String.annotations({\n description: \"Instructions that guide the AI assistant's behavior and responses\",\n }),\n\n /**\n * Array of tools that the AI assistant can use when this blueprint is active.\n */\n tools: Schema.Array(ToolId).annotations({\n description: 'Array of tools that the AI assistant can use when this blueprint is active',\n }),\n\n /**\n * Array of artifacts that the AI assistant can create or modify.\n */\n artifacts: Schema.Array(Schema.String).annotations({\n description: 'Ids of artifact definitions that should be pulled into the blueprint',\n }),\n}).pipe(\n Type.Obj({\n // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.\n typename: 'dxos.org/type/Blueprint',\n version: '0.1.0',\n }),\n\n // TODO(burdon): Move to main API.\n LabelAnnotation.set(['name']),\n);\n\n/**\n * TypeScript type for Blueprint.\n */\nexport interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Blueprint } from './blueprint';\n\nexport class BlueprintRegistry {\n constructor(private readonly _blueprints: Blueprint[]) {\n this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));\n }\n\n query(): Blueprint[] {\n return this._blueprints;\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { computed, type ReadonlySignal } from '@preact/signals-core';\nimport { Array, pipe } from 'effect';\n\nimport { Obj, type Type, type Ref, type Relation } from '@dxos/echo';\nimport { type Queue } from '@dxos/echo-db';\nimport { ComplexSet } from '@dxos/util';\n\nimport { ContextBinding } from './binding';\nimport { type Blueprint } from '../blueprint';\n\n/**\n * Manages bindings of blueprints and objects to a conversation.\n */\nexport class ContextBinder {\n constructor(private readonly _queue: Queue) {}\n\n /**\n * Reactive query of all bindings.\n */\n // TODO(burdon): Cache value?\n readonly bindings: ReadonlySignal<Bindings> = computed(() => this._reduce(this._queue.objects));\n\n // TODO(burdon): load refs?\n readonly blueprints: ReadonlySignal<Ref.Ref<Blueprint>[]> = computed(() => [...this.bindings.value.blueprints]);\n readonly objects: ReadonlySignal<Ref.Ref<Type.Expando>[]> = computed(() => [...this.bindings.value.objects]);\n\n /**\n * Asynchronous query of all bindings.\n */\n async query(): Promise<Bindings> {\n const queueItems = await this._queue.queryObjects();\n return this._reduce(queueItems);\n }\n\n // TODO(burdon): Pass in Blueprint obj (from registry?) and create reference.\n async bind(props: BindingProps): Promise<void> {\n if (!props.blueprints?.length && !props.objects?.length) {\n return;\n }\n\n await this._queue.append([\n Obj.make(ContextBinding, {\n blueprints: {\n added: props.blueprints ?? [],\n removed: [],\n },\n objects: {\n added: props.objects ?? [],\n removed: [],\n },\n }),\n ]);\n }\n\n async unbind(props: BindingProps): Promise<void> {\n if (!props.blueprints?.length && !props.objects?.length) {\n return;\n }\n\n await this._queue.append([\n Obj.make(ContextBinding, {\n blueprints: {\n added: [],\n removed: props.blueprints ?? [],\n },\n objects: {\n added: [],\n removed: props.objects ?? [],\n },\n }),\n ]);\n }\n\n private _reduce(items: (Obj.Any | Relation.Any)[]): Bindings {\n return pipe(\n items,\n Array.filter(Obj.instanceOf(ContextBinding)),\n Array.reduce(new Bindings(), (context, item) => {\n item.blueprints.removed.forEach((item) => context.blueprints.delete(item));\n item.blueprints.added.forEach((item) => context.blueprints.add(item));\n item.objects.removed.forEach((item) => context.objects.delete(item));\n item.objects.added.forEach((item) => context.objects.add(item));\n return context;\n }),\n );\n }\n}\n\nexport type BindingProps = Partial<{\n blueprints: Ref.Ref<Blueprint>[];\n objects: Ref.Ref<Type.Expando>[];\n}>;\n\nexport class Bindings {\n blueprints = new ComplexSet<Ref.Ref<Blueprint>>((ref) => ref.dxn.toString());\n objects = new ComplexSet<Ref.Ref<Type.Expando>>((ref) => ref.dxn.toString());\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\n\nimport { Blueprint } from '../blueprint';\n/**\n * Thread message that binds or unbinds contextual objects to a conversation.\n */\nexport const ContextBinding = Schema.Struct({\n blueprints: Schema.Struct({\n added: Schema.Array(Type.Ref(Blueprint)),\n removed: Schema.Array(Type.Ref(Blueprint)),\n }),\n\n // TODO(burdon): Type.Expando => Type.Obj (or Obj.Any?)\n objects: Schema.Struct({\n added: Schema.Array(Type.Ref(Type.Expando)),\n removed: Schema.Array(Type.Ref(Type.Expando)),\n }),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/ContextBinding',\n version: '0.1.0',\n }),\n);\n\nexport interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding> {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Message, type ExecutableTool } from '@dxos/ai';\nimport { type ArtifactDefinition } from '@dxos/artifact';\nimport { Event } from '@dxos/async';\nimport { Obj, Ref } from '@dxos/echo';\nimport { type Queue } from '@dxos/echo-db';\nimport { AiService, ToolResolverService, type ServiceContainer } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { isNonNullable } from '@dxos/util';\n\nimport { ContextBinder, type ContextBinding } from '../context';\nimport { AISession, type SessionRunOptions } from '../session';\n\nexport interface ConversationRunOptions {\n systemPrompt?: string;\n prompt: string;\n\n tools?: ExecutableTool[];\n artifacts?: ArtifactDefinition[];\n extensions?: ToolContextExtensions;\n generationOptions?: SessionRunOptions['generationOptions'];\n\n /** @depreacated Should be managed by the conversation. */\n requiredArtifactIds?: string[];\n\n // TODO(dmaretskyi): Move into conversation.\n artifactDiffResolver?: SessionRunOptions['artifactDiffResolver'];\n}\n\nexport type ConversationOptions = {\n serviceContainer: ServiceContainer;\n queue: Queue<Message | ContextBinding>;\n};\n\n/**\n * Persistent conversation state.\n * Context + history + artifacts.\n * Backed by a Queue.\n */\nexport class Conversation {\n private readonly _serviceContainer: ServiceContainer;\n private readonly _queue: Queue<Message | ContextBinding>;\n\n /**\n * Fired when the execution loop begins.\n * This is called before the first message is sent.\n */\n public readonly onBegin = new Event<AISession>();\n\n /**\n * Blueprints bound to the conversation.\n */\n public readonly context: ContextBinder;\n\n constructor(options: ConversationOptions) {\n this._serviceContainer = options.serviceContainer;\n this._queue = options.queue;\n this.context = new ContextBinder(this._queue);\n }\n\n async run(options: ConversationRunOptions): Promise<Message[]> {\n const session = new AISession({ operationModel: 'configured' });\n this.onBegin.emit(session);\n\n const history = await this.getHistory();\n const context = await this.context.query();\n const blueprints = (await Ref.Array.loadAll([...context.blueprints])).filter(isNonNullable);\n if (blueprints.length > 1) {\n log.warn('multiple blueprints are not yet supported');\n }\n\n const messages = await session.run({\n history,\n prompt: options.prompt,\n systemPrompt: (options.systemPrompt ?? '') + (blueprints.at(0)?.instructions ?? ''),\n\n // TODO(dmaretskyi): Artifacts come from the blueprint?\n artifacts: options.artifacts ?? [],\n tools: blueprints.at(0)?.tools ?? [],\n executableTools: options.tools,\n requiredArtifactIds: options.requiredArtifactIds,\n client: this._serviceContainer.getService(AiService).client,\n toolResolver: this._serviceContainer.getService(ToolResolverService).toolResolver,\n extensions: {\n serviceContainer: this._serviceContainer,\n ...options.extensions,\n },\n generationOptions: options.generationOptions,\n });\n\n await this._queue.append(messages);\n\n return messages;\n }\n\n async getHistory(): Promise<Message[]> {\n const queueItems = await this._queue.queryObjects();\n return queueItems.filter(Obj.instanceOf(Message));\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Array, Option, pipe, Schema } from 'effect';\n\nimport {\n AgentStatusReport,\n isToolUse,\n runTools,\n type AgentStatus,\n structuredOutputParser,\n type AiServiceClient,\n type GenerationStream,\n type GenerateRequest,\n Message,\n type MessageContentBlock,\n MixedStreamParser,\n ToolResult,\n createTool,\n type ExecutableTool,\n type ToolId,\n type ToolResolver,\n} from '@dxos/ai';\nimport { type ArtifactDefinition } from '@dxos/artifact';\nimport { Event, synchronized } from '@dxos/async';\nimport { Obj } from '@dxos/echo';\nimport { ObjectVersion } from '@dxos/echo-db';\nimport { create, type ObjectId } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nimport { VersionPin } from './version-pin';\n\n/**\n * Contains message history, tools, current context.\n * Current context means the state of the app, time of day, and other contextual information.\n * It makes requests to the model, its a state machine.\n * It keeps track of the current goal.\n * It manages the context window.\n * Tracks the success criteria of reaching the goal, exposing metrics (stretch)\n * Could be run locally in the app or remotely.\n * Could be personal or shared.\n */\n\n/**\n * Resolves artifact ids to their versions.\n * Used to give the model a sense of the changes to the artifacts made by users during the conversation.\n * The artifacts versions are pinned in the history, and whenever the artifact changes in-between assistant's steps,\n * a diff is inserted into the conversation.\n */\nexport type ArtifactDiffResolver = (artifacts: { id: ObjectId; lastVersion: ObjectVersion }[]) => Promise<\n Map<\n ObjectId,\n {\n version: ObjectVersion;\n diff?: string;\n }\n >\n>;\n\nexport type SessionRunOptions = {\n artifacts: ArtifactDefinition[];\n\n /**\n * Non-artifact specific tools.\n */\n tools: ToolId[];\n\n history: Message[];\n\n prompt: string;\n\n generationOptions?: Pick<GenerateRequest, 'model'>;\n\n extensions?: ToolContextExtensions;\n\n systemPrompt?: string;\n\n /**\n * Pre-require artifacts.\n */\n requiredArtifactIds?: string[];\n\n client: AiServiceClient;\n toolResolver: ToolResolver;\n\n /**\n * Executable tools that do not go through the tool resolver.\n */\n executableTools?: ExecutableTool[];\n\n /**\n * @see ArtifactDiffResolver\n */\n artifactDiffResolver?: ArtifactDiffResolver;\n};\n\ntype OperationModel = 'planning' | 'importing' | 'configured';\n\nexport type AiSessionOptions = {\n /**\n * Determines the agent's handling of the artifacts definitions:\n *\n * - `planning`: The model will create a plan with required artifacts for each step.\n * - `importing`: The model can query registry and only pull in the artifacts that are required to complete the task.\n * - `configured`: The available artifacts are pre-selected and the model cannot select additional artifacts.\n */\n operationModel: OperationModel;\n};\n\nexport class AISession {\n /** SSE stream parser. */\n private readonly _parser = new MixedStreamParser();\n\n /** Pending messages (incl. the current user request). */\n private _pending: Message[] = [];\n\n /** Current streaming response. */\n private _stream: GenerationStream | undefined;\n\n /** Prior history from queue. */\n private _history: Message[] = [];\n\n /**\n * New message.\n */\n public readonly message = this._parser.message;\n\n /**\n * Complete block added to Message.\n */\n public readonly block = this._parser.block;\n\n /**\n * Update partial block (while streaming).\n */\n public readonly update = this._parser.update;\n\n /**\n * Unparsed events from the underlying generation stream.\n */\n public readonly streamEvent = this._parser.streamEvent;\n\n /**\n * User prompt or tool result.\n */\n public readonly userMessage = new Event<Message>();\n\n /**\n * Agent self-reporting its status.\n * Triggered by the model.\n */\n public readonly statusReport = new Event<AgentStatus>();\n\n /**\n * Emits when the session is done.\n */\n public readonly done = new Event<void>();\n\n /**\n * Emits when the tool reports its status.\n * Triggered by the tool execution function.\n */\n public readonly toolStatusReport = new Event<{ message: Message; status: AgentStatus }>();\n\n constructor(private readonly _options: AiSessionOptions) {\n // Message complete.\n this._parser.message.on((message) => {\n this._pending.push(message);\n });\n this._parser.block.on((block) => {\n if (block.type === 'text' && block.disposition === 'status') {\n this.statusReport.emit(create(AgentStatusReport, { message: block.text }));\n }\n });\n }\n\n /**\n * Runs the AI model loop interacting with tools and artifacts.\n * @param options - The session options.\n * @returns The messages generated by the session, including the user's prompt.\n */\n @synchronized\n async run(options: SessionRunOptions): Promise<Message[]> {\n const systemTools: ExecutableTool[] = [];\n switch (this._options.operationModel) {\n case 'planning':\n systemTools.push(this._createQueryArtifactsTool(options.artifacts), this._createPlanningTool(options));\n break;\n case 'importing':\n systemTools.push(\n this._createQueryArtifactsTool(options.artifacts),\n this._createRequireTool(options.artifacts, (artifactDefinitionIds) => {\n for (const artifactDefinitionId of artifactDefinitionIds) {\n requiredArtifactIds.add(artifactDefinitionId);\n }\n }),\n );\n break;\n case 'configured':\n // no system tools\n break;\n default:\n throw new TypeError(`Invalid operation model: ${this._options.operationModel}`);\n }\n\n this._history = [...options.history];\n this._pending = [await this._formatUserPrompt(options.artifactDiffResolver, options.prompt, options.history)];\n this.userMessage.emit(this._pending.at(-1)!);\n this._stream = undefined;\n\n let error: Error | undefined;\n\n const requiredArtifactIds = new Set<string>(options.requiredArtifactIds ?? []);\n try {\n let more = false;\n do {\n const tools: ExecutableTool[] = pipe(\n [\n ...systemTools,\n ...(await Promise.all(options.tools.map((toolId) => options.toolResolver.resolve(toolId)))),\n ...(options.executableTools ?? []),\n ...options.artifacts\n .filter((artifact) => requiredArtifactIds.has(artifact.id))\n .flatMap((artifact) => artifact.tools),\n ],\n Array.dedupeWith((a, b) => a.id === b.id),\n );\n\n log('request', {\n pending: this._pending.length,\n history: this._history.length,\n tools: tools.map((tool) => tool.name),\n });\n\n // Open request stream.\n this._stream = await options.client.execStream({\n ...(options.generationOptions ?? {}),\n // TODO(burdon): Rename messages or separate history/message.\n history: [...this._history, ...this._pending],\n tools,\n systemPrompt:\n options.systemPrompt ??\n createBaseInstructions({\n availableArtifacts: [...requiredArtifactIds],\n operationModel: this._options.operationModel,\n }),\n });\n\n // Wait until complete.\n await this._parser.parse(this._stream);\n await this._stream.complete();\n\n // Add messages.\n log('response', { pending: this._pending });\n\n // Resolve tool use locally.\n more = false;\n const message = this._pending.at(-1);\n invariant(message);\n if (isToolUse(message)) {\n log('tool request...');\n const response = await runTools({\n message: this._pending.at(-1)!,\n tools,\n extensions: options.extensions ?? {},\n reportStatus: (status) => this._onToolStatusReport(message, status),\n });\n\n log('tool response', { response });\n switch (response.type) {\n case 'continue': {\n this._pending = [...this._pending, response.message];\n this.userMessage.emit(response.message);\n more = true;\n break;\n }\n }\n }\n } while (more);\n } catch (err) {\n log.catch(err);\n if (err instanceof Error && err.message.includes('Overloaded')) {\n error = new AIServiecOverloadedError('AI service overloaded', { cause: err } as any); // TODO(dmaretskyi): Schema errors cant have cause\n } else {\n error = new Error('AI service error', { cause: err });\n }\n } finally {\n this._stream = undefined;\n this.done.emit();\n }\n\n if (error) {\n throw error;\n }\n\n return this._pending;\n }\n\n async runStructured<S extends Schema.Schema.AnyNoContext>(\n schema: S,\n options: SessionRunOptions,\n ): Promise<Schema.Schema.Type<S>> {\n const parser = structuredOutputParser(schema);\n const result = await this.run({\n ...options,\n executableTools: [...(options.executableTools ?? []), parser.tool],\n });\n return parser.getResult(result);\n }\n\n private async _formatUserPrompt(\n artifactDiffResolver: ArtifactDiffResolver | undefined,\n prompt: string,\n history: Message[],\n ) {\n const prelude: MessageContentBlock[] = [];\n\n if (artifactDiffResolver) {\n const versions = gatherObjectVersions(history);\n\n const artifactDiff = await artifactDiffResolver(\n [...versions.entries()].map(([id, version]) => ({ id, lastVersion: version })),\n );\n\n log.info('vision', {\n artifactDiff,\n versions,\n });\n\n for (const [id, { version }] of [...artifactDiff.entries()]) {\n if (ObjectVersion.equals(version, versions.get(id)!)) {\n artifactDiff.delete(id);\n continue;\n }\n\n prelude.push(VersionPin.createBlock(VersionPin.make({ objectId: id, version })));\n }\n if (artifactDiff.size > 0) {\n prelude.push(createArtifactUpdateBlock(artifactDiff));\n }\n }\n\n return Obj.make(Message, {\n role: 'user',\n content: [...prelude, { type: 'text', text: prompt }],\n });\n }\n\n private _createQueryArtifactsTool(artifacts: ArtifactDefinition[]): ExecutableTool {\n return createTool('system', {\n name: 'query_artifact_definitions',\n description: 'Query the available artifact definitions',\n schema: Schema.Struct({}),\n execute: async () => {\n return ToolResult.Success({\n artifactDefinitions: artifacts.map((artifact) => ({\n id: artifact.id,\n name: artifact.name,\n description: artifact.description,\n })),\n });\n },\n });\n }\n\n private _createRequireTool(\n artifacts: ArtifactDefinition[],\n onRequire: (artifactDefinitionIds: readonly string[]) => void,\n ): ExecutableTool {\n return createTool('system', {\n name: 'require_artifact_definitions',\n description:\n 'Require the use of specific artifact definitions. This will allow the model to interact with artifact definitions and use their tools.',\n schema: Schema.Struct({\n artifactDefinitionIds: Schema.Array(Schema.String).annotations({\n description: 'The ids of the artifact definitions to require',\n examples: [['artifact:dxos.org/example/Test']],\n }),\n }),\n execute: async ({ artifactDefinitionIds }) => {\n const missingArtifactDefinitionIds = artifactDefinitionIds.filter(\n (artifactId) => !artifacts.some((artifact) => artifact.id === artifactId),\n );\n if (missingArtifactDefinitionIds.length > 0) {\n return ToolResult.Error(\n `One or more artifact definition ids are invalid: ${missingArtifactDefinitionIds.join(', ')}`,\n );\n }\n\n onRequire(artifactDefinitionIds);\n\n return ToolResult.Success({});\n },\n });\n }\n\n private _createPlanningTool(options: SessionRunOptions): ExecutableTool {\n return createTool('system', {\n name: 'create_plan',\n description:\n 'Create a plan. Make sure that each step is independent and can be executed solely on the data returned by the previous step. The steps only share the data that is specified in the plan.',\n schema: Schema.Struct({\n goal: Schema.String.annotations({ description: 'The goal that the plan will achieve.' }),\n steps: Schema.Array(\n Schema.Struct({\n action: Schema.String.annotations({\n description: 'Complete, detailed action to perform.',\n }),\n input: Schema.String.annotations({\n description: 'The required input data for this step. First step must not require any data.',\n }),\n output: Schema.String.annotations({\n description: 'The output data from this step. This is passed to the next step as input.',\n }),\n requiredArtifactIds: Schema.Array(Schema.String).annotations({\n description: 'The ids of the artifacts required to perform this step.',\n examples: [['artifact:dxos.org/example/Test']],\n }),\n }),\n ).annotations({ description: 'Steps' }),\n }),\n execute: async ({ goal, steps }) => {\n const missingArtifactIds = steps\n .flatMap((step) => step.requiredArtifactIds)\n .filter((artifactId) => !options.artifacts.some((artifact) => artifact.id === artifactId));\n if (missingArtifactIds.length > 0) {\n return ToolResult.Error(`One or more artifact ids are invalid: ${missingArtifactIds.join(', ')}`);\n }\n\n const stepResults: any[] = [];\n for (const step of steps) {\n log('executing step', { action: step.action });\n const session = new AISession({ operationModel: 'importing' });\n session.message.on((ev) => this.message.emit(ev));\n session.block.on((ev) => this.block.emit(ev));\n session.update.on((ev) => this.update.emit(ev));\n session.streamEvent.on((ev) => this.streamEvent.emit(ev));\n session.userMessage.on((ev) => this.userMessage.emit(ev));\n\n const messages = await session.run({\n artifacts: options.artifacts,\n tools: options.tools,\n history: options.history,\n extensions: options.extensions,\n requiredArtifactIds: step.requiredArtifactIds.slice(),\n prompt: `\n You are an agent that executes the subtask in a plan.\n \n While you know the plan's goal only focus on your subtask\n Use the data from the previous step to complete your task.\n Return all of the data from \"output\" in your last message.\n \n Current step (that you need to complete):\n ${JSON.stringify(\n {\n goal,\n input: step.input,\n output: step.output,\n yourTask: step.action,\n },\n null,\n 2,\n )}\n \n Previous step results:\n ${JSON.stringify(stepResults.at(-1))}.\n `,\n\n generationOptions: options.generationOptions,\n client: options.client,\n toolResolver: options.toolResolver,\n artifactDiffResolver: options.artifactDiffResolver,\n });\n const result = messages.at(-1);\n stepResults.push(result);\n }\n\n return ToolResult.Success({ stepResults });\n },\n });\n }\n\n private _onToolStatusReport(message: Message, status: AgentStatus): void {\n this.toolStatusReport.emit({ message, status });\n }\n\n abort(): void {\n this._stream?.abort();\n }\n}\n\n// TODO(burdon): Use handlebars template with effect-schema input.\nconst createBaseInstructions = ({\n availableArtifacts,\n operationModel,\n}: {\n availableArtifacts: string[];\n operationModel: OperationModel;\n}) => `\n You are a friendly, advanced AI assistant capable of creating and managing artifacts from available data and tools. \n Your task is to process user commands and questions and decide how best to respond.\n In some cases, you will need to create or reference data objects called artifacts.\n\n Follow these guidelines carefully:\n\n Decision-making:\n\n - Analyze the structure and type of the content in the user's message.\n \n \n ${\n operationModel === 'planning'\n ? `\n - Can you complete the task using the available artifacts?\n - If you can't complete the task using the available artifacts, query the list of available artifacts using the appropriate tool.\n - Identify which artifacts are relevant to the user's request.\n - Break down the user's request into a step-by-step plan that you will use to execute the user's request, the plan items should include artifacts which will be used to perform the actions.\n `\n : ''\n }\n ${\n operationModel === 'importing'\n ? `\n - Can you complete the task using the available artifacts?\n - If you can't complete the task using the available artifacts, query the list of available artifacts using the appropriate tool.\n - Identify which artifacts are relevant to the user's request.\n - Are the required artifacts already available?\n - If not, select which artifact(s) will be the most relevant and require them using the require_artifacts tool.\n - The require'd artifact tools will be available for use after require.\n `\n : ''\n }\n ${\n operationModel === 'configured'\n ? `\n - Select the most relevant artifact(s) to complete the task.\n - Call the appropriate tool to use the artifact(s).\n `\n : ''\n }\n\n ${availableArtifacts.length > 0 ? `Artifacts already in context: ${availableArtifacts.join('\\n')}` : ''}\n`;\n\nexport class AIServiecOverloadedError extends Schema.TaggedError<AIServiecOverloadedError>()(\n 'AIServiecOverloadedError',\n {},\n) {}\n\nconst gatherObjectVersions = (messages: Message[]): Map<ObjectId, ObjectVersion> => {\n const artifactIds = new Map<ObjectId, ObjectVersion>();\n for (const message of messages) {\n for (const block of message.content) {\n if (block.type === 'json' && block.disposition === VersionPin.DISPOSITION) {\n const pin = VersionPin.pipe(Schema.decodeOption)(JSON.parse(block.json)).pipe(Option.getOrUndefined);\n if (!pin) {\n continue;\n }\n artifactIds.set(pin.objectId, pin.version);\n }\n }\n }\n\n return artifactIds;\n};\n\nconst createArtifactUpdateBlock = (\n artifactDiff: Map<ObjectId, { version: ObjectVersion; diff?: string }>,\n): MessageContentBlock => {\n return {\n type: 'text',\n disposition: 'artifact-update',\n text: `\n The following artifacts have been updated since the last message:\n ${[...artifactDiff.entries()]\n .map(([id, { diff }]) => `<changed-artifact id=\"${id}\">${diff ? `\\n${diff}` : ''}</changed-artifact>`)\n .join('\\n')}\n `,\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { type MessageContentBlock } from '@dxos/ai';\nimport { type ObjectVersion } from '@dxos/echo-db';\nimport { getVersion } from '@dxos/echo-db';\nimport { ObjectId, type BaseEchoObject } from '@dxos/echo-schema';\n\n// TODO(dmaretskyi): Extract.\nconst ObjectVersionSchema = Schema.Unknown as Schema.Schema<ObjectVersion>;\n\nconst VersionPinSchema = Schema.Struct({\n // TODO(dmaretskyi): Use Ref when those support encoding.\n objectId: ObjectId,\n // TODO(dmaretskyi): Could be opaque\n version: ObjectVersionSchema,\n});\n\n/**\n * Used to pin a specific version of an object during the course of a conversation.\n * This allows us to detect when the object changes during the course of the conversation.\n */\nexport interface VersionPin extends Schema.Schema.Type<typeof VersionPinSchema> {}\n\nexport const VersionPin: typeof VersionPinSchema & {\n DISPOSITION: 'version-pin';\n fromObject: (object: BaseEchoObject) => VersionPin;\n createBlock: (pin: VersionPin) => MessageContentBlock;\n} = class extends VersionPinSchema {\n static readonly DISPOSITION = 'version-pin';\n static fromObject(object: BaseEchoObject): VersionPin {\n return VersionPin.make({\n objectId: object.id,\n version: getVersion(object),\n });\n }\n\n static createBlock(pin: VersionPin): MessageContentBlock {\n return {\n type: 'json',\n disposition: VersionPin.DISPOSITION,\n json: JSON.stringify(pin),\n };\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { asyncTimeout } from '@dxos/async';\nimport { Expando } from '@dxos/echo-schema';\nimport { type FunctionDefinition, type FunctionExecutor } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { DataType } from '@dxos/schema';\n\nexport const ExtractionInput = Schema.Struct({\n message: DataType.Message,\n objects: Schema.optional(Schema.Array(Expando)),\n options: Schema.optional(\n Schema.Struct({\n timeout: Schema.optional(Schema.Number),\n fallbackToRaw: Schema.optional(Schema.Boolean),\n }),\n ),\n});\nexport interface ExtractionInput extends Schema.Schema.Type<typeof ExtractionInput> {}\n\nexport const ExtractionOutput = Schema.Struct({\n message: DataType.Message,\n timeElapsed: Schema.Number,\n});\nexport interface ExtractionOutput extends Schema.Schema.Type<typeof ExtractionOutput> {}\n\nexport type ProcessTranscriptMessageParams = {\n input: ExtractionInput;\n function: FunctionDefinition<ExtractionInput, ExtractionOutput>;\n executor: FunctionExecutor;\n\n options?: {\n /**\n * Timeout for the entity extraction.\n */\n timeout?: number;\n\n /**\n * Fallback to raw text if the entity extraction fails.\n * Otherwise the function will throw an error.\n * @default false\n */\n fallbackToRaw?: boolean;\n };\n};\n\nexport type ExtractionFunction = FunctionDefinition<ExtractionInput, ExtractionOutput>;\n\n/**\n * Extract entities from the transcript message and add them to the message.\n */\n// TODO(dmaretskyi): Move context to a vector search index.\nexport const processTranscriptMessage = async (params: ProcessTranscriptMessageParams): Promise<ExtractionOutput> => {\n try {\n if (params.options?.timeout && params.options.timeout > 0) {\n return await asyncTimeout(params.executor.invoke(params.function, params.input), params.options.timeout);\n } else {\n return await params.executor.invoke(params.function, params.input);\n }\n } catch (error) {\n if (params.options?.fallbackToRaw) {\n log.warn('failed to process message, falling back to raw text', { error });\n return {\n message: params.input.message,\n timeElapsed: 0,\n };\n } else {\n throw error;\n }\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Message, ToolRegistry } from '@dxos/ai';\nimport { Obj } from '@dxos/echo';\nimport { create } from '@dxos/echo-schema';\nimport { AiService, defineFunction, type FunctionDefinition } from '@dxos/functions';\nimport { DataType } from '@dxos/schema';\n\nimport PROMPT from './instructions.tpl?raw';\nimport { AISession } from '../../session';\nimport { ExtractionInput, ExtractionOutput } from '../extraction';\nimport { insertReferences, ReferencedQuotes } from '../quotes';\n\nexport const extractionAnthropicFn: FunctionDefinition<ExtractionInput, ExtractionOutput> = defineFunction({\n description: 'Extract entities from the transcript message and add them to the message.',\n inputSchema: ExtractionInput,\n outputSchema: ExtractionOutput,\n handler: async ({ data: { message, objects }, context }) => {\n const startTime = performance.now();\n const ai = context.getService(AiService);\n const session = new AISession({ operationModel: 'configured' });\n const result = await session.runStructured(ReferencedQuotes, {\n generationOptions: {\n model: '@anthropic/claude-3-5-haiku-20241022',\n },\n client: ai.client,\n systemPrompt: PROMPT,\n history: [\n Obj.make(Message, {\n role: 'user',\n content: [\n {\n type: 'text',\n text: `<context>${JSON.stringify(objects)}</context>`,\n },\n {\n type: 'text',\n text: `<transcript>${JSON.stringify(message.blocks)}</transcript>`,\n },\n ],\n }),\n ],\n artifacts: [],\n prompt: '',\n tools: [],\n toolResolver: new ToolRegistry([]),\n });\n\n return {\n message: create(DataType.Message, {\n ...message,\n blocks: message.blocks.map((block, i) =>\n block.type !== 'transcription'\n ? block\n : {\n ...block,\n text: insertReferences(block.text, result),\n },\n ),\n }),\n timeElapsed: performance.now() - startTime,\n };\n },\n});\n", "You are an AI assistant specialized in processing and enhancing transcripts with contextual information.\nYour task is to analyze a given transcript and extract references to the context objects.\n\nThe context and transcript are provided in the user message in `context` and `transcript` XML tags.\n\nHere are your instructions:\n\n1. Read the transcript and context information provided above.\n\n2. Process each segment of the transcript separately.\n\n3. For each segment:\n a. Analyze the content and identify relevant information from the context.\n b. Extract a number of references to the context objects that are mentioned in the segment.\n c. Output the references in the format `{ \"quote\": \"earnings report\", \"id\": \"01JT0JP9AX0XKGZX4MV4B69VT6\" }`.\n d. If there are no references, just output an empty array.\n\n4. Maintain the exact order and structure of the original transcript segments.\n\nOutput Format:\nYou have been provided with a tool that specifies output format\n\nRemember:\n- Only quote the text that is in the transcript.\n- Analyze each segment carefully before processing it.\n- Only reference objects that appear in the context and exactly by their id, If the object is not in the context, do not insert a reference. \n\nNow, process the transcript and context provided below according to these instructions.", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Query, Filter } from '@dxos/echo';\nimport { type EchoDatabase } from '@dxos/echo-db';\nimport { ObjectId } from '@dxos/echo-schema';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\n\nexport const ReferencedQuotes = Schema.Struct({\n references: Schema.Array(\n Schema.Struct({\n id: Schema.String,\n quote: Schema.String, // TODO(burdon): Quote?\n }),\n )\n .pipe(Schema.mutable)\n .annotations({\n // TODO(burdon): Does this description make sense?\n description: `\n The references to the context objects that are mentioned in the transcript. \n Quote should match the original transcript text exactly, while id is the id of the context object.\n `,\n }),\n});\nexport type ReferencedQuotes = Schema.Schema.Type<typeof ReferencedQuotes>;\n\nexport const findQuotes = async (quotes: string[], db: EchoDatabase): Promise<ReferencedQuotes> => {\n const references = await Promise.all(\n quotes.map(async (quote) => {\n const { objects } = await db.query(Query.select(Filter.text(quote, { type: 'vector' }))).run();\n log.info('found quotes in vector index', { objects, quote });\n return objects.length > 0 ? [{ id: objects[0].id.toString(), quote }] : [];\n }),\n );\n return { references: references.flat() };\n};\n\n/**\n * Finds and replaces all quotes with DXNs references.\n */\n// TODO(dmaretskyi): Lookup and verifiy ids from provided context.\nexport const insertReferences = (text: string, quotes: ReferencedQuotes) => {\n for (const quote of quotes.references) {\n if (!ObjectId.isValid(quote.id)) {\n continue;\n }\n\n // Use a case-insensitive regular expression to replace the quote.\n const regex = new RegExp(quote.quote.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'gi');\n text = text.replace(regex, `[${quote.quote}][${DXN.fromLocalObjectId(quote.id).toString()}]`);\n }\n\n return text;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { asyncTimeout } from '@dxos/async';\nimport { create } from '@dxos/echo-schema';\nimport { DatabaseService, defineFunction } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { DataType } from '@dxos/schema';\n\nimport { extractFullEntities } from './named-entity-recognition';\nimport { ExtractionInput, ExtractionOutput } from '../extraction';\nimport { findQuotes, insertReferences } from '../quotes';\n\n// TODO(mykola): Make it use vector index to query objects and not pass objects as input.\nexport const extractionNerFn = defineFunction({\n description: 'Extracts named entities from a text',\n inputSchema: ExtractionInput,\n outputSchema: ExtractionOutput,\n handler: async ({ data: { message, options }, context }) => {\n log.info('input', { message, options });\n const startTime = performance.now();\n const { db } = context.getService(DatabaseService);\n\n const entitiesPromise = Promise.all(\n message.blocks.map(async (block) => {\n invariant(block.type === 'transcription' || block.type === 'text', 'Block must have text');\n return extractFullEntities(block.text);\n }),\n ).then((entities) => entities.flat());\n const entities = options?.timeout ? await asyncTimeout(entitiesPromise, options.timeout) : await entitiesPromise;\n log.info('entities', { entities });\n const quoteReferences = await findQuotes(\n entities.map((entity) => entity.word),\n db,\n );\n const blocksWithReferences = message.blocks.map((block, i) => {\n invariant(block.type === 'transcription' || block.type === 'text', 'Block must have text');\n return { ...block, text: insertReferences(block.text, quoteReferences) };\n });\n const messageWithReferences = create(DataType.Message, {\n ...message,\n blocks: blocksWithReferences,\n });\n\n log.info('output', { messageWithReferences });\n\n return {\n message: messageWithReferences,\n timeElapsed: performance.now() - startTime,\n };\n },\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n type TokenClassificationOutput,\n type TokenClassificationSingle,\n pipeline,\n type TokenClassificationPipelineType,\n} from '@xenova/transformers';\n\nimport { log } from '@dxos/log';\n\nlet _ner: Promise<TokenClassificationPipelineType>;\n/**\n * Named Entity Recognition pipeline.\n * Initializes the pipeline on first call.\n * @returns The singleton promise that resolves to a token classification pipeline.\n */\nexport const getNer = () => {\n if (!_ner) {\n _ner = pipeline('ner', 'Xenova/bert-base-NER').then((ner) => {\n log.info('NER model is ready');\n return ner;\n });\n }\n return _ner;\n};\n\n/**\n * Extracts entities from text using the named entity recognition pipeline and does simple grouping of tokens.\n */\nexport const extractFullEntities = async (text: string): Promise<TokenClassificationSingle[]> => {\n const ner = await getNer();\n const entities = (await ner(text)) as TokenClassificationOutput;\n const tokenGroups = createTokenGroups(entities);\n const combinedEntities = tokenGroups.map(combineNerTokens);\n return combinedEntities;\n};\n\nexport const createTokenGroups = (tokens: TokenClassificationSingle[]): TokenClassificationSingle[][] => {\n const tokenGroups: TokenClassificationSingle[][] = [];\n\n const canBeCombined = (prevToken: TokenClassificationSingle, currentToken: TokenClassificationSingle) => {\n const [currentState, currentEntity] = currentToken.entity.split('-'); // B, I, O\n const [prevState, prevEntity] = prevToken.entity.split('-'); // B, I, O\n if (prevEntity !== currentEntity) {\n return false;\n }\n if (prevState === 'O') {\n return false;\n }\n if (currentState === 'I') {\n return true;\n }\n if ((prevState === 'B' || prevState === 'I') && currentState === 'B') {\n return currentToken.word.startsWith('#');\n }\n return false;\n };\n\n for (const token of tokens) {\n if (tokenGroups.length === 0) {\n tokenGroups.push([token]);\n continue;\n }\n const lastTokenGroup = tokenGroups.at(-1)!;\n if (canBeCombined(lastTokenGroup.at(-1)!, token)) {\n lastTokenGroup.push(token);\n continue;\n }\n tokenGroups.push([token]);\n }\n\n return tokenGroups;\n};\n\nexport const combineNerTokens = (group: TokenClassificationSingle[]): TokenClassificationSingle => {\n const combinedToken: TokenClassificationSingle = {\n entity: group.at(0)!.entity.split('-')[1],\n score: group.reduce((acc, token) => acc + token.score, 0) / group.length,\n index: group.at(0)!.index,\n word: group.at(0)!.word,\n start: group.at(0)!.start,\n end: group.at(-1)!.end,\n };\n\n for (const token of group.slice(1)) {\n if (token.word.startsWith('#')) {\n combinedToken.word += token.word.replace(/^#+/, '');\n } else {\n combinedToken.word += ' ' + token.word;\n }\n }\n\n return combinedToken;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport Exa from 'exa-js';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { log } from '@dxos/log';\n\nimport { SEARCH_RESULTS } from '../testing';\n\ntype CreateExaToolOptions = {\n apiKey: string;\n};\n\nexport const createExaTool = ({ apiKey }: CreateExaToolOptions) => {\n const exa = new Exa(apiKey);\n\n return createTool('search', {\n name: 'web_search',\n description: 'Search the web for information',\n schema: Schema.Struct({\n query: Schema.String.annotations({ description: 'The query to search for' }),\n }),\n execute: async ({ query }) => {\n const context = await exa.searchAndContents(query, {\n type: 'auto',\n text: {\n maxCharacters: 3_000,\n },\n livecrawl: 'always',\n });\n\n log.info('exa search', { query, costDollars: context.costDollars });\n\n return ToolResult.Success(context);\n },\n });\n};\n\nexport const createMockExaTool = () => {\n return createTool('search', {\n name: 'web_search',\n description: 'Search the web for information',\n schema: Schema.Struct({\n query: Schema.String.annotations({ description: 'The query to search for' }),\n }),\n execute: async ({ query }) => {\n // Find result with closest matching autoprompt using weighted Levenshtein distance\n const result = SEARCH_RESULTS.reduce(\n (closest, current) => {\n if (!current.autopromptString) {\n return closest;\n }\n if (!closest) {\n return current;\n }\n\n // Calculate Levenshtein distance\n const dist1 = levenshteinDistance(query, current.autopromptString);\n const dist2 = levenshteinDistance(query, closest.autopromptString || '');\n\n // Weight by length of the longer string to normalize\n const weight1 = dist1 / Math.max(query.length, current.autopromptString.length);\n const weight2 = dist2 / Math.max(query.length, closest.autopromptString?.length || 0);\n\n return weight1 < weight2 ? current : closest;\n },\n null as (typeof SEARCH_RESULTS)[0] | null,\n );\n\n return ToolResult.Success(result);\n },\n });\n};\n\nconst levenshteinDistance = (str1: string, str2: string): number => {\n const m = str1.length;\n const n = str2.length;\n const dp: number[][] = Array(m + 1)\n .fill(null)\n .map(() => Array(n + 1).fill(0));\n\n for (let i = 0; i <= m; i++) {\n dp[i][0] = i;\n }\n for (let j = 0; j <= n; j++) {\n dp[0][j] = j;\n }\n\n for (let i = 1; i <= m; i++) {\n for (let j = 1; j <= n; j++) {\n dp[i][j] =\n str1[i - 1] === str2[j - 1] ? dp[i - 1][j - 1] : Math.min(dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1]) + 1;\n }\n }\n\n return dp[m][n];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport default {\n requestId: '324936368a74f4db978982172bc18a6c',\n autopromptString: 'AI personal knowledge management tools projects 2024',\n autoDate: '2024-01-01T00:00:00.000Z',\n resolvedSearchType: 'neural',\n results: [\n {\n id: 'https://www.open-notebook.ai/',\n title: 'What is Open Notebook? | Open Notebook',\n url: 'https://www.open-notebook.ai/',\n publishedDate: '2024-01-01T00:00:00.000Z',\n author: '',\n score: 0.3995794951915741,\n text: \"Take Control of Your Learning. Privately. A powerful open-source, AI-powered note-taking/research platform that respects your privacy 🎙️ Podcast Generator Transform your notes into engaging podcasts with customizable voices, speakers, and episodes 🤖 AI-Powered Notes Leverage AI to summarize, generate insights, and manage your notes 🔒 Privacy Control Full control over what information AI can access 🔄 Content Integration Support for links, PDFs, TXT, PPT, YouTube, and more What is Open Notebook? Open Notebook is the cognitive partner you always wanted and could never explain why. It combines the power of AI with unwavering privacy controls. It's designed for researchers, students, and professionals who want to enhance their learning and abilities while maintaining complete control over workflows, models, and how their data gets used and exposed. Is this right for me? 📚 Learning Enthusiast You're constantly seeking knowledge and want to go beyond surface-level understanding. Learning for you is about building deep, lasting comprehension. 🤝 You want a learning partner You believe your learning process can improve by partnering with a tailor made AI. You want to be provoked to think more clearly. 🤯 Your learning backlog is way too big You have hundreds of links you would love to read, but there is no time for it all. You want to make sure those are catalogued for when you need them. ✍️ Independent Thinker You value both taking notes and forming your own ideas. You understand different viewpoints but believe in developing your own perspective. 🔒 You are privacy aware You don't want all your context, thoughts and plans to be all over Big Tech, if not necessary. 💁 You like things your way You want to decide how your content is handled, which AI models you want to interact with and help specifically it should help/challenge you. What is the plan for the future? There is much more that can be done to augment human knowledge. Open Notebook's first release is just a first step in that direction. The end goal is to build a Cognitive Partner for every person. A customized assistant that can help you develop your skills, knowledge, and opinions in a way that makes sense to you. Learn more about our long-term vision and roadmap in our Vision page.\",\n },\n {\n id: 'https://www.reorproject.org/',\n title: 'Reor',\n url: 'https://www.reorproject.org/',\n publishedDate: '2024-01-01T00:00:00.000Z',\n author: 'Reor',\n score: 0.39665618538856506,\n text: \"Private & local AI personal knowledge management app for high entropy thinkers. Q&A Chat with an LLM that has full context of your notes. Automatically connected ideas Never manually link your notes again. Semantic Search Search without having to remember exact phrasing. WYSIWYG Markdown Markdown is the language of thought. Local First LLMs, Embedding Models, Vector database. Everything runs and stores locally. Writing Assistant Write with the world's first local writing assistant. Trusted by individuals who may have heard of these companies\",\n image: 'https://reorhomepage-2-cwy0zagzg-reor-team.vercel.app/opengraph-image.jpg?a25ca70e900445ed',\n favicon: 'https://www.reorproject.org/favicon-16x16.png',\n },\n {\n id: 'https://mymemo.ai/blog/best-ai-personal-knowledge-management-tools-in-2024/detail',\n title: 'Best AI Personal Knowledge Management (PKM) tools in 2024 - My Framer Site',\n url: 'https://mymemo.ai/blog/best-ai-personal-knowledge-management-tools-in-2024/detail',\n publishedDate: '2025-05-21T17:17:02.000Z',\n author: '',\n score: 0.3811739385128021,\n text: \"In today's fast-paced world, managing and organizing knowledge has become increasingly challenging. With the rise of digital information and the need for efficient knowledge sharing, traditional methods of knowledge management are no longer sufficient. AI-powered tools have emerged as a game-changer in this domain, offering a more efficient and effective way to manage and organize knowledge. Efficiency Amplified: AI streamlines the organization and analysis of vast data sets, saving time and reducing manual effort. Insights Unearthed: Uncover hidden patterns, trends, and valuable insights within your data, providing a deeper understanding of your information. Personalized Experience: Tailor your knowledge management approach with AI, creating a personalized digital assistant that adapts to your unique needs. Stay Ahead in the Digital Era: Embrace the transformative power of AI to navigate the information overload and stay ahead in our rapidly evolving digital landscape. Here are 10 AI-powered tools for personal knowledge management with their product links: 1. MyMemo AI: - Introduction: MyMemo transforms personal data into wisdom using AI, offering features like targeted search, smart advice, and creative writing prompts. - Product Link: [MyMemo Website](https://www.mymemo.ai) - Features: - Collects digital knowledge from various sources into a single platform. - Processes collected information with AI to extract key insights. - Allows users to query MyMemoAI for specific info or insights from their knowledge base. - Offers targeted search, smart advice, and creative writing prompts for enhanced knowledge management. 2. Notion AI: - Introduction: Notion AI offers a customizable workspace for efficient knowledge sharing and management. - Product Link: [Notion AI Website](https://www.notion.so) - Features: - Customizable workspace for knowledge sharing. - Integration with various tools like Slack, Google Drive, and Microsoft Teams. - Robust search capabilities powered by AI and AI-based analytics. 3. ClickUp: - Introduction: ClickUp provides dedicated spaces for knowledge base organization and seamless integration with various tools. - Product Link: [ClickUp Website](https://clickup.com) - Features: - Dedicated spaces for Knowledge Base organization. - Integration with third-party software like Microsoft Teams, Jira, Slack, Zoho, and more. - AI-based analytics to track productivity and identify patterns. 4. MyMind: - Introduction: MyMind offers a private space to save notes, images, quotes, and highlights enhanced by AI to aid in memory recall without the need for manual categorization. - Product Link: [MyMind Website](https://www.mymind.com) - Features: - Private space for saving notes, images, quotes, and highlights. - Enhanced by AI for efficient memory recall without manual organization. - Tailored for designers, writers, researchers, developers, and visual minds of all kinds. Adding Mem.ai to the top 10 list of AI-powered tools for personal kn\",\n image: 'https://framerusercontent.com/images/xtRTZ9zRVH3uL1fvH2vqA6G60W8.png',\n favicon: 'https://framerusercontent.com/images/XEQTxAwueP1wc7BpbB1zrouiuoA.png',\n },\n {\n id: 'https://mymemo.ai/',\n title: 'MyMemo-Empower Your Mind with AI',\n url: 'https://mymemo.ai/',\n publishedDate: '2025-05-21T17:17:02.000Z',\n author: '',\n score: 0.3810442090034485,\n text: 'End Digital Chaos with All In One Digital Space Effortlessly Access Information with AI Chat What have I uploaded about the marketing strategy? How to raise fund as a founder for startup? Write an article about the impact of AI in our society. Compliance with Global Standards MyMemo AI adheres to international data protection regulations, ensuring your data is handled with the utmost care. Secure Storage Your data is encrypted and stored on our high-security servers, ensuring that only you have access. We maintain strict privacy protocols, and even our team cannot view your information. Private Links for Your Memos MyMemo AI ensures that all links generated for your uploaded content are private and exclusively visible to you. 100 AI chat per month 100 content uploads per month 5 memo collections Powered by GPT-4o mini Up to 5 Related Memo in AI chat Single PDF file size under 5MB 10 AI writing for notes in total AI chat unlimited 1000 content uploads per month 100 Memo Collections Supports multiple AI models Up to 5 Related Memo in AI chat Single PDF file size under 30MB 100 AI writing for notes per month Custom AI summary prompt(coming soon) AI chat unlimited Unlimited content uploads Unlimited memo collections Supports multiple AI models Up to 8 Related Memo in AI chat Single PDF file size under 50MB Unlimited AI writing for notes Custom AI summary prompt(coming soon) Free access to @GPT-4o in Chat We’re excited to partner with Inkwise to bring MyMemo users an exclusive deal! Inkwise.ai is an AI-powered platform that helps users craft professional documents by extracting and integrating key information from uploaded files. It offers industry-specific templates, intelligent content extraction, and a referencing system that ensures factual accuracy. Exclusive for MyMemo Users: Get 2 months of Inkwise Pro for free with the code INKWISE2025 at checkout! MyMemo © MyMemo 2025. All rights reserved',\n image: 'https://framerusercontent.com/images/xtRTZ9zRVH3uL1fvH2vqA6G60W8.png',\n favicon: 'https://framerusercontent.com/images/XEQTxAwueP1wc7BpbB1zrouiuoA.png',\n },\n {\n id: 'https://www.personal.ai/memory',\n title: 'Make Your Own AI with Your Unique Memory',\n url: 'https://www.personal.ai/memory',\n publishedDate: '2024-01-01T00:00:00.000Z',\n author: '',\n score: 0.3991696536540985,\n text: \"In Personal AI, version control for memory and model is managed through a systematic approach that allows users to track, manage, and revert changes made to the AI's memory and model. Memory Stack: When you store a memory in Personal AI, it goes into the memory stack for training the AI. Data Uploads: Users can add, edit, or reinforce memories by uploading authored data directly into their personal language model. The personal language model has unlimited memory and is not bound by token or context limitations. The AI's performance is as good as the memory provided to it. If it makes false statements, the memory needs to be fixed and reinforced for future learning. There will be mechanisms to download the memory and model in the future. The output of the personal AI model is entirely controlled by the user's input and training. Yes, you can automate conversations using stacked memories in your Personal AI. By leveraging the memory stacking feature, you can train your AI to recall and utilize specific information during interactions Practices for Automating Conversations: Memory Anchors: When stacking new memories, consider adding memory anchors to organize the information effectively. This practice helps structure and categorize the data within your Personal AI account. Variety of Sources: Utilize all available tools such as the chat box, document editor, file uploader, and URL uploader to stack data from various sources. This diverse input enables your AI to learn from a wide range of inputs for a more personalized experience. Application of Practices: To automate conversations effectively, ensure that you consistently add relevant information into your memory stack using different tools provided by Personal AI. By doing so, you enable your AI to access and utilize this knowledge when engaging in digital interactions on your behalf. Yes, you can absolutely use hashtags to label and recall specific memories later on with your Personal AI. When adding memories to your AI, it's beneficial to include detailed and descriptive information about the topic or subject, along with context such as people, location, and absolute time for the AI to reference. Using hashtags allows you to categorize and organize these memories effectively. By using proper placement of hashtags without spaces and maintaining uniform capitalization, you can enhance the selection of memories for generating answers. Additionally, when stacking content using the chat box or file/document uploader in Personal AI, you can utilize #hashtags for single words or :colons followed by keywords for multiple words or complete titles. This practice helps in refining the selection of memories for generating answers while ensuring effective organization and retrieval of data. Personal AI is built with a strong emphasis on data privacy and security. It operates under the principle that the data you provide is yours alone. Measures such as encryption, secure data storage, and the optio\",\n image: 'https://cdn.prod.website-files.com/5ff65c460ce39f5ec5681c6a/663d12aab1b425e1ad40d3a6_Memory-min.jpg',\n favicon:\n 'https://cdn.prod.website-files.com/5ff65c460ce39f5ec5681c6a/5ffcbe4a31309a2dcf7d1f18_Human%20AI%20Icon%2032x32-bolder.png',\n },\n {\n id: 'https://iki.ai/',\n title: 'IKI AI – Intelligent Knowledge Interface',\n url: 'https://iki.ai/',\n publishedDate: '2025-04-10T16:28:59.000Z',\n author: '',\n score: 0.38676750659942627,\n text: 'Think faster. Organize deeper. All in one place. An AI-native workspace for research, strategy, and creative work An AI-native workspace for research, strategy, and creative work Backed by 500 Global Backed by 500 Global Backed by 500 Global Capture anything. Build your thinking library. Capture anything. Build your thinking library. Capture anything. Build your thinking library. AI assistant Turn long reads into clear insights. IKI summarizes, highlights, and connects the dots. AI assistant Turn long reads into clear insights. IKI summarizes, highlights, and connects the dots. AI assistant Turn long reads into clear insights. IKI summarizes, highlights, and connects the dots. AI editor AI writing with real context. Grounded in your content, not the internet. AI editor AI writing with real context. Grounded in your content, not the internet. AI editor AI writing with real context. Grounded in your content, not the internet. Team spaces Your team’s shared brain. One space for knowledge, context, and decisions. Team spaces Your team’s shared brain. One space for knowledge, context, and decisions. Team spaces Your team’s shared brain. One space for knowledge, context, and decisions. Everything you need for smarter knowledge work AI Editor Ask IKI AI Heading 1 B U I Browser extension Download extension to save webpages in one click along with notes Author Spotify Design Youtube · 3 min read Designing Data Science Tools at Spotify: Part 2 AI Summury Methods based on the relational path have shown strong, interpretable, and transferable reasoning ability. However, paths are naturally limited in capturing local evidence in graphs...Methods based on the relational path have shown strong, interpretable LLMs powered by top-tier models you trust Multi-source insights with agent context AI Digest Everything you need for smarter knowledge work AI Editor Ask IKI AI Heading 1 B U I Browser extension Download extension to save webpages in one click along with notes Author Spotify Design Youtube · 3 min read Designing Data Science Tools at Spotify: Part 2 AI Summury Methods based on the relational path have shown strong, interpretable, and transferable reasoning ability. However, paths are naturally limited in capturing local evidence in graphs...Methods based on the relational path have shown strong, interpretable LLMs powered by top-tier models you trust Multi-source insights with agent context AI Digest Everything you need for smarter knowledge work AI Editor Ask IKI AI Heading 1 B U I Browser extension Download extension to save webpages in one click along with notes Author Spotify Design Youtube · 3 min read Designing Data Science Tools at Spotify: Part 2 AI Summury Methods based on the relational path have shown strong, interpretable, and transferable reasoning ability. However, paths are naturally limited in capturing local evidence in graphs...Methods based on the relational path have shown strong, interpretable LLMs powered by',\n image: 'https://framerusercontent.com/assets/cI6Uo7x4q0W3uxzOt2preXjv6aE.jpg',\n favicon: 'https://framerusercontent.com/images/5NLFiJq5bLl5FXOTcVQX8vhkU.png',\n },\n {\n id: 'https://supermemory.ai/',\n title: 'supermemory™',\n url: 'https://supermemory.ai/',\n publishedDate: '2025-01-01T00:00:00.000Z',\n author: '',\n score: 0.393942266702652,\n text: \"The universal memory API for the AI era Stop building retrieval from scratch. Personalise LLMs for your users. Built for developers who ship. Start building DOCS Context is everything Without it, even the smartest AI is just an expensive chatbot $ init vector_database Way too expensive. Time to switch. Painfully slow. Let's try another. Won't scale. Back to square one. Maintenance nightmare. Need alternatives. $ choose embedding_model Which model fits your use case? Confusing performance tradeoffs Can't keep up with new releases $ handle format_parsing Markdown: Tables break everything HTML: Scripts and styles interfere PDF: Layout ruins extraction Word docs: Unpredictable formatting $ calculate scaling_costs Costs explode at production scale Performance degrades as data grows Engineering hours pile up fast $ setup connection_sync Sync failures between data sources API rate limits during large syncs Images: Need vision models now? Audio/Video: Transcription costs soar $ init multimodal_support Websites: JS & rate limits are messy PDFs: OCR fails, extraction inconsistent Authentication tokens expire constantly $ init vector_database Way too expensive. Time to switch. Painfully slow. Let's try another. Won't scale. Back to square one. Maintenance nightmare. Need alternatives. $ choose embedding_model Which model fits your use case? Confusing performance tradeoffs Can't keep up with new releases $ handle format_parsing Markdown: Tables break everything HTML: Scripts and styles interfere PDF: Layout ruins extraction Word docs: Unpredictable formatting $ calculate scaling_costs Costs explode at production scale Performance degrades as data grows Engineering hours pile up fast $ setup connection_sync Sync failures between data sources API rate limits during large syncs Images: Need vision models now? Audio/Video: Transcription costs soar $ init multimodal_support Websites: JS & rate limits are messy PDFs: OCR fails, extraction inconsistent Authentication tokens expire constantly FEATURES • FEATURES • FEATURES Unlock the Full Potential of Your Data const response = await fetch( 'https://api.supermemory.ai/v3/memories', {\\n method: 'POST',\\n headers: {\\n 'Authorization': 'Bearer sm_ywdhjSbiDLkLIjjVotSegR_rsq3ZZKNRJmVr12p4ItTcf' \\n },\\n body: JSON.stringify({\\n content: 'My name is Shreyans.',\\n // or https://example.com \\n // or https://example.com/page.pdf \\n metadata: {\\n user_id: '123' \\n }\\n }),\\n})\\n const data = await response.json() const response = await fetch( 'https://api.supermemory.ai/v3/memories', {\\n method: 'GET',\\n headers: {\\n 'Authorization': 'Bearer sm_ywdhjSbiDLkLIjjVotSegR_rsq3ZZKNRJmVr12p4ItTcf',\\n },\\n body: JSON.stringify({\\n q: \\\"What's my name?\\\" \\n })\\n})\\n const data = await response.json() const response = await fetch( 'https://api.supermemory.ai/v3/connections/onedrive', {\\n method: 'POST',\\n headers: {\\n 'Authorization': 'Bearer sm_ywdhjSbiDLkLIjjVotSegR_rsq3ZZKNRJmVr12p4ItTcf',\\n }\\n});\\n const data = await response.json(); solution • sol\",\n image: 'https://cdn.prod.website-files.com/6826235ef861ed9464b064c8/6826251d65991babe21a9a9a_Frame%2031.png',\n favicon: 'https://cdn.prod.website-files.com/6826235ef861ed9464b064c8/682639813def380d7694f590_favicon.png',\n },\n {\n id: 'https://mykin.ai/',\n title: 'Kin - Private, and Emotionally Intelligent, Personal AI',\n url: 'https://mykin.ai/',\n publishedDate: '2025-05-26T00:00:00.000Z',\n author: '',\n score: 0.38142070174217224,\n text: \"Clarity and confidence. Always on hand. Kin is a new kind of personal AI companion, more emotionally intelligent and private than ever. For whatever life throws at you. Available on iPhone and Android Anytime. Anywhere. Life at work is becoming increasingly challenging to navigate Think with Kin Personalized coaching can be inaccessible and expensive Talk with Kin How can Kin help? Inspiration “Whenever I need fresh ideas or just a soundboard, I know I can quickly turn to Kin.” Inspiration “Whenever I need fresh ideas or just a soundboard, I know I can quickly turn to Kin.” Planning “I use Kin to think things through, set goals, and organize my time.” Planning “I use Kin to think things through, set goals, and organize my time.” Learning “I can learn about almost any topic, with structured lessons created in seconds.” Learning “I can learn about almost any topic, with structured lessons created in seconds.” Support “Kin helps me with everything from small tasks to processing ideas and emotions.” Support “Kin helps me with everything from small tasks to processing ideas and emotions.” Guidance “I’m more aware of my strengths and I feel better prepared for tricky conversations.” Guidance “I’m more aware of my strengths and I feel better prepared for tricky conversations.” Kin remembers, so you don’t have to. The more you interact with Kin, the more Kin learns about you and your life. Because Kin understands both the big picture and its complexities, it can provide genuinely meaningful support in your day-to-day. Learn more Private & Secure Kin encrypts and stores your data securely on you device. No one else can see or access it. Powerful features. Scandinavian design. Smart journaling Share your thoughts and notes to reflect and build a better Kin. Coming soon Powered by open source models Coming soon Semantic and Episodic memory Coming soon Private, encrypted local-first storage Coming soon Intelligent reminders Stay on top of what matters with timely reminders. Coming soon Conversational voice chat Coming soon Third party integration Connect your Kin to the apps you love like Google calendar. Coming soon Proudly made in Copenhagen, Denmark Get started with simple tutorials and big ideas Frequently asked questions Product How does Kin's memory work? Kin’s memory pulls information from your messages into a database on your device so it can always reference it. Kin’s memory is automatic, so in practice, it works just by you talking with Kin. General More than anyone else. Every word you share and every reply is stored locally on your device - unless you change your settings to allow otherwise. You have full control over deleting it at any time. General Do I need a subscription to use Kin? No - Kin is currently free and without message limits for our beta users. However, we’re expecting to transition to a subscription model once we hit full release - we’ll make sure to talk a lot about that before it happens, though. Product Can I use Kin on a d\",\n image: 'https://cdn.prod.website-files.com/67b8fb50931278cabb866969/67d2a6c56ee313becd0f482d_img-opengraph.jpg',\n favicon: 'https://cdn.prod.website-files.com/67b8fb50931278cabb866969/67c0cfc2c45ca5db9ca5c9e4_favicon.png',\n },\n {\n id: 'https://try.rememberizer.ai/blog/introducing-rememberizer-connect-knowledge-to-your-ai',\n title: 'Introducing Rememberizer - Connect Knowledge To Your AI',\n url: 'https://try.rememberizer.ai/blog/introducing-rememberizer-connect-knowledge-to-your-ai',\n publishedDate: '2024-01-28T00:00:00.000Z',\n author: '',\n score: 0.38043755292892456,\n text: \"Introduction In the rapidly evolving world of artificial intelligence (AI), Rememberizer emerges as a revolutionary platform that profoundly changes how both developers and personal consumers interact with AI, especially Generative Pre-trained Transformers (GPT). This platform is not just another tool; it's a transformative solution, making AI interactions deeply personal, intuitive, and efficient. Let’s dive into how Rememberizer is redefining AI personalization and integration, offering unique experiences for a diverse range of users, free. Part 1: Rememberizer for Personal Consumers Why Rememberizer Matters for Personal Users Generative AI apps work better when they have access to background information. They need to know what you know. A great way to achieve that is to give them access to relevant content from the documents, data and discussions you create and use. This is what Rememberizer does. Rememberizer helps by seamlessly integrating personal data with AI applications. For OpenAI GPTs users, this means transforming your interactions with AI into something deeply personal and relevant. By indexing your data just once, Rememberizer avoids wasting time performing the same process over and over again. Empowering Personal AI Experiences Whether you’re engaging in creative projects, professional tasks, or simply exploring AI for personal curiosity, Rememberizer brings a unique value proposition. It transforms your data into a powerful AI collaborator, ensuring your interactions are tailored to your specific circumstances. Imagine an AI that feels intuitively designed for you, understanding your projects, circumstances and recent discussions. That’s the personalized AI experience Rememberizer delivers. Part 2: Rememberizer for Developers Revolutionizing AI Integration in App Development For developers, Rememberizer is a game-changer. It simplifies the integration of user data into AI applications, enhancing app functionality and user experience. Rememberizer connects directly to various data sources including Slack and Google Drive, embedding their contents semantic meaning into a vector database. This process not only elevates the AI capabilities of your app but also saves vast amounts GPU processing costs and engineering resources in backend development: it’s free! The Developer's Advantage with Rememberizer Streamlined Data Integration: Rememberizer takes care of the complex process of integrating data sources into a vector database, allowing developers to focus more on creative aspects of app development. Enhanced AI Capabilities: By leveraging Rememberizer, apps gain access to rich, personalized data, leading to more intuitive and context-aware AI interactions. Personalization and Continuous Adaptation: Apps powered by Rememberizer can offer unparalleled personalization, learning, and adapting based on the user's data, thereby improving over time. Part 3: Pricing and Accessibility for All Rememberizer is committed to democratizing \",\n image:\n 'https://cdn.prod.website-files.com/656fc35f7b92e991c863ce0a/65b7523200497f3ac6391238_Rememberizer%20banner.png',\n favicon: 'https://cdn.prod.website-files.com/656fc35f7b92e991c863cdc4/657acdfb9a0ba55d8f622765_Favicon.png',\n },\n {\n id: 'https://twinmind.com/',\n title: 'TwinMind',\n url: 'https://twinmind.com/',\n publishedDate: '2025-05-23T09:12:49.000Z',\n author: '',\n score: 0.38130462169647217,\n text: '\\n Never Forget Anything with Your Never Forget Anything with Your Never Forget Anything with Your Second Brain Memory Vault Life Copilot AI Notetaker Second Brain Second Brain Memory Vault Life Copilot AI Notetaker Second Brain Second Brain Memory Vault Life Copilot AI Notetaker Second Brain Get perfect notes, to-dos, and proactive answers during meetings, lectures, interviews, and conversations. Get perfect notes, to-dos, and proactive answers during meetings, lectures, interviews, and conversations. Watch Demo Watch Demo Watch Demo Featured in Featured in Trusted by users at Trusted by users at Capture any moment, even inside your pocket Capture any moment, even inside your pocket Transcribe everything. Forget nothing. Ask anything. Transcribe everything. Forget nothing. Ask anything. Transcribe everything. Forget nothing. Ask anything. Seamlessly switch from mobile to desktop Seamlessly switch from mobile to desktop With TwinMind for Chrome, transcribe video calls or chat with tabs, PDFs, Youtube videos, and automate your work. With the TwinMind Chrome sidebar, transcribe video calls or chat with websites, PDFs, Youtube videos, and all your memories. Works with all the products you love Works with all the products you love Ask anything with context from all your favorite websites and insert answers directly into them on Chrome. Ask anything with context from all your favorite websites and insert answers directly into them on Chrome. Transcribe video calls or capture context from all your favorite websites, and insert answers into them on Chrome browser. Get Proactive Answers Get Proactive Answers Get personalized suggestions, prepare for meetings or exams based on all your notes synced with your calendar. Get personalized suggestions, prepare for meetings or exams based on all your notes synced with your calendar. Unlock Perfect Memory Unlock Perfect Memory Your brain forgets 90% of memories in 7 days but TwinMind doesn’t. Ask TwinMind anything with Deep Memory Search. Your brain forgets 90% of memories in 7 days but TwinMind doesn’t. Ask TwinMind anything with Deep Memory Search. Summarize all my meetings Ask TwinMind Summarize all my meetings Ask TwinMind Summarize all my meetings Ask TwinMind Insert Insert Insert Automate Your Work Automate Your Work Generate follow-up emails, reports, assignments based on memories. Insert anywhere on your browser in one click. Generate follow-up emails, reports, assignments based on memories. Insert anywhere on your browser in one click. 100% privacy with offline mode 100% privacy with offline mode 100% privacy with offline mode Transcribes without recording TwinMind processes your audio on-the-fly in real-time and saves only the transcripts on-device, ensuring that your audio is never stored anywhere. Transcribes without recording TwinMind processes your audio on-the-fly in real-time and saves only the transcripts on-device, ensuring that your audio is never stored anywhere. Transcribes without recording ',\n image: 'https://framerusercontent.com/assets/9u5tx2lerz0ndBVcB14sg4tNoKs.png',\n favicon: 'https://framerusercontent.com/images/zDX0zsHZ6Z2PvwK2vmkOsISWBiY.svg',\n },\n ],\n costDollars: {\n total: 0.015,\n search: {\n neural: 0.005,\n },\n contents: {\n text: 0.01,\n },\n },\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport default {\n requestId: '0dc12e344fa649884456960ca1a54954',\n autopromptString: 'PKM software artificial intelligence integration open source projects',\n resolvedSearchType: 'neural',\n results: [\n {\n id: 'https://github.com/subspace-ai/subspace',\n title: 'GitHub - subspace-ai/subspace: PKM + REPL + AI',\n url: 'https://github.com/subspace-ai/subspace',\n publishedDate: '2023-03-23T16:02:40.000Z',\n author: 'subspace-ai',\n score: 0.7530648708343506,\n text: \"subspace.ai - PKM + REPL + AI \\n The long-term goal of subspace is to be/have three things: \\n \\n PKM (Personal Knowledge Management system) like Roam Research or Tana. \\n REPL-like (Read Evaluate Print Loop) capabilities. Should be able to execute individual code cells in the JVM backend and rendered in the frontend with Electric. Similar behaviour can be achieved with other languages via Jupyter kernels (or GraalVM Polyglot) and JavaScript. \\n AI (Artificial Intelligence) integrations. Should be integrated with LLMs - e.g. write GPT queries in subspace, and incorporate the response to your personal knowledge base as a new node. Intelligent search and LLM-based summaries and reasoning over the existing knowledge base (Retrieval Oriented Generation, RAG). \\n \\n The overall design should be open-ended, allowing for easy forking and providing custom node types / rendering functions. The goal is not to be just a storage of information, but a control panel for commonly used workflows. So that you can create convenient shortcuts and informative output views with Clojure + Electric. Since you persist which actions you took over time, you can search for past outputs and interleave these with your personal notes. Later query your knowledge base with RAG in natural language, or query it with GPT by exposing subspace knowledge base as an API to GPT. \\n For example, additional customizations and use cases could be: \\n \\n Intelligent work log for day to day coding. \\n Wrappers for any babashka / shell scripts you already have. \\n Wrapper functions to MLOps platform (or some other task manager) to trigger jobs, query stats and logs from past train runs. Build dashboards as subspace nodes from the result of such queries with Electric+HTML. \\n Wrappers for common Kubernetes / AWS / GCP commands. Build ad hoc UIs on top of your cluster that make sense to you. \\n Wrappers that pull the contents of arxiv documents as subspace nodes. \\n Spaced repetition learning of content (of nodes which you mark to be remembered). \\n \\n UI/UX \\n There will be two types of UI elements: pages and nodes. Pages contain nodes, and nodes can nest other nodes. Both pages and nodes are referencable (meaning you can link to them and the page/node will get a backreference). \\n Each node contains some media, and possibly subnodes. \\n Media can be: \\n \\n Text, numeric, Markdown \\n Image, video, audio \\n Flexible spreadsheet tesserrae \\n code block, which can be executed in a jupyter kernel (runs once) \\n code block containing an e/fn (runs continuously when on the page) \\n \\n Executing an e/fn is the most powerful and flexible thing to do. It can pull data in from other nodes on the page or in the graph, and displays its own little UI within its boundaries. Crucially, when upstream info changes, your e/fn's output gets recomputed. Running tesserrae is also very powerful; you can think of subspace as a non-grid tesserae that can also embed tesserae. \\n Subnodes can be organised either by indenting or tiling. \\n \\n Indente\",\n image:\n 'https://opengraph.githubassets.com/734547dbba15cefe41b9ad9cd97ba2ac489aeebd18945d54dbf7b1931b5ed980/subspace-ai/subspace',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/khoj-ai/khoj',\n title:\n 'GitHub - khoj-ai/khoj: Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (gpt, claude, gemini, llama, qwen, mistral). Get started - free.',\n url: 'https://github.com/khoj-ai/khoj',\n publishedDate: '2021-08-16T01:48:44.000Z',\n author: 'khoj-ai',\n score: 0.33666935563087463,\n text: \"\\n \\n \\n \\n \\n Your AI second brain \\n \\n \\n \\n 🎁 New \\n \\n Start any message with /research to try out the experimental research mode with Khoj. \\n Anyone can now create custom agents with tunable personality, tools and knowledge bases. \\n Read about Khoj's excellent performance on modern retrieval and reasoning benchmarks. \\n \\n \\n Overview \\n Khoj is a personal AI app to extend your capabilities. It smoothly scales up from an on-device personal AI to a cloud-scale enterprise AI. \\n \\n Chat with any local or online LLM (e.g llama3, qwen, gemma, mistral, gpt, claude, gemini, deepseek). \\n Get answers from the internet and your docs (including image, pdf, markdown, org-mode, word, notion files). \\n Access it from your Browser, Obsidian, Emacs, Desktop, Phone or Whatsapp. \\n Create agents with custom knowledge, persona, chat model and tools to take on any role. \\n Automate away repetitive research. Get personal newsletters and smart notifications delivered to your inbox. \\n Find relevant docs quickly and easily using our advanced semantic search. \\n Generate images, talk out loud, play your messages. \\n Khoj is open-source, self-hostable. Always. \\n Run it privately on your computer or try it on our cloud app. \\n \\n \\n See it in action \\n \\n Go to https://app.khoj.dev to see Khoj live. \\n Full feature list \\n You can see the full feature list here. \\n Self-Host \\n To get started with self-hosting Khoj, read the docs. \\n Enterprise \\n Khoj is available as a cloud service, on-premises, or as a hybrid solution. To learn more about Khoj Enterprise, visit our website. \\n Frequently Asked Questions (FAQ) \\n Q: Can I use Khoj without self-hosting? \\n Yes! You can use Khoj right away at https://app.khoj.dev — no setup required. \\n Q: What kinds of documents can Khoj read? \\n Khoj supports a wide variety: PDFs, Markdown, Notion, Word docs, org-mode files, and more. \\n Q: How can I make my own agent? \\n Check out this blog post for a step-by-step guide to custom agents.\\nFor more questions, head over to our Discord! \\n Contributors \\n Cheers to our awesome contributors! 🎉 \\n \\n \\n Made with contrib.rocks. \\n Interested in Contributing? \\n Khoj is open source. It is sustained by the community and we’d love for you to join it! Whether you’re a coder, designer, writer, or enthusiast, there’s a place for you. \\n Why Contribute? \\n \\n Make an Impact: Help build, test and improve a tool used by thousands to boost productivity. \\n Learn & Grow: Work on cutting-edge AI, LLMs, and semantic search technologies. \\n \\n You can help us build new features, improve the project documentation, report issues and fix bugs. If you're a developer, please see our Contributing Guidelines and check out good first issues to work on. \\n\",\n image: 'https://repository-images.githubusercontent.com/396569538/533a8bf7-385f-427b-a03f-76795fd938ed',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/paulbricman/conceptarium',\n title: 'GitHub - paulbricman/conceptarium: A fluid medium for storing, relating, and surfacing thoughts.',\n url: 'https://github.com/paulbricman/conceptarium',\n publishedDate: '2021-08-12T04:45:29.000Z',\n author: 'paulbricman',\n score: 0.3376504182815552,\n text: \"\\n 💡 Conceptarium \\n The conceptarium is an experimental personal knowledge base designed to weave AI capabilities into knowledge work. Its main features include: \\n \\n powerful multi-modal search across ideas \\n sharing microverses of knowledge with peers \\n ranking items by Anki-like activation, so as to promote serendipity \\n \\n Installation \\n Docker \\n After installing docker and docker-compose, run: \\n # install with:\\ncurl -fsS https://raw.githubusercontent.com/paulbricman/conceptarium/main/docker-compose.yml -o docker-compose.yml\\nmkdir knowledge\\ndocker-compose up -d\\n# stop with:\\ndocker-compose stop\\n# update with:\\ndocker-compose stop\\ndocker-compose rm -f\\ndocker-compose pull\\ndocker-compose up -d\\n \\n Note that you'll have to wait a bit initially for the models to be downloaded in the docker container. Use docker logs <backend container ID> or watch the process's memory for feedback on that. Or just try using it until it via the API or UI until it works (see usage). \\n Source \\n After pulling this repo run: \\n python3 -m pip install -r frontend/requirements.txt\\npython3 -m pip install -r backend/requirements.txt\\nstreamlit run frontend/main.py\\n# in a separate session:\\ncd backend\\npython3 -m uvicorn main:app --reload\\n# update by pulling from repo again\\n \\n Missing dependencies? Please have a look at frontend/Dockerfile and backend/Dockerfile. ARM architecture (e.g. Raspberry Pi)? Remove the torch entries from requirements.txt, and install a custom-built version. \\n Usage \\n The web app should then be available at localhost:8501, while the API at localhost:8000 (with docs at localhost:8000/docs). The backend component takes a few minutes to get the ML models at first. \\n To access your local instance, enter the conceptarium URL (i.e. localhost:8000 if you ran from source, backend.docker:8000 if you used docker), and your desired token. Remember your token, as you'll have to use it to authenticate in future sessions. \\n\",\n image:\n 'https://opengraph.githubassets.com/2b454d3e4b9d69c65d465d8ec6609b3b61f34b83f1f8eece471806be32e710bc/paulbricman/conceptarium',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/mfakih/Pomegranate-PKM',\n title:\n 'GitHub - mfakih/Pomegranate-PKM: Pomegranate PKM is a new open source web-based cross-platform work and knowledge management application for productive and prolific people. PKM features text-based commands for adding, updating and searching records, thus providing powerful tools to manage information. It also allows the user to build up the navigation menu using saved searches.',\n url: 'https://github.com/mfakih/Pomegranate-PKM',\n publishedDate: '2014-03-17T06:28:12.000Z',\n author: 'mfakih',\n score: 0.7761150002479553,\n text: 'Pomegranate-PKM \\n Pomegranate PKM is a new open source web-based cross-platform work and knowledge management application for productive and prolific people. \\n PKM features text-based commands for adding, updating and searching records, thus providing powerful tools to manage information. It also allows the user to build up the navigation menu using saved searches. \\n \\n Pomegranate PKM manages: \\n \\n Goals, tasks, and plans \\n Journal and indicators \\n Writings and notes \\n Resources (books, articles, news, presentations, audiobooks, documentaries, movies etc),and book excerpts, mainly book chapters. \\n Documents e.g. Word documents, Excels \\n People \\n \\n In technical terms, Pomegranate PKM is a combination of: \\n \\n Document management system \\n Content management system \\n Research index cards and reference management \\n Bug tracking systems, applied for the software development and self development \\n Lightweight project management \\n Powerful task management \\n Time tracking \\n Blog (e.g. WordPress) client \\n \\n My in-progress book at LeanPub outlines the motivations, design principles and the features of Pomegranate PKM. \\n',\n image:\n 'https://opengraph.githubassets.com/d4afbe16f55b89cbdd3344472df483147de49f6a8a136bd1da7af7e568c16908/mfakih/Pomegranate-PKM',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/mfakih294/Nibras-PKM',\n title:\n 'GitHub - mfakih294/Nibras-PKM: A web-based self-hosted open-source system for the long-term management of personal information. It targets the needs of advanced users with serious information management needs. It is accompanied with an Android application that syncs the bookmarked records over local Wifi network.',\n url: 'https://github.com/mfakih294/Nibras-PKM',\n publishedDate: '2019-09-14T02:05:28.000Z',\n author: 'mfakih294',\n score: 0.7633954882621765,\n text: \"Nibras PKM \\n Nibras PKM is a web-based self-hosted open source system for\\nthe long-term management of personal information.\\nIt is a combination of a web-based application\\nintended for desktop use and where all the records are entered,\\nand an Android mobile reader application. \\n \\n Local \\n The user has full control over his/her data, without the need for a (fast) internet connection, and without all the distractions and information overload that the internet can cause. \\n Open source \\n The user has control over the system itself too, especially when using it on the long term to manage the important personal information and files. \\n Comprehensize \\n It manages resources (articles, books, documents), notes, writings, tasks, goals, journal, planner, payments, indicators, and (study) courses and departments. \\n Powerful \\n It was designed with large amounts of information in mind. In current usage, it manages dozens of thousands of records. With its commands and saved searches, it makes easy to navigate through all the information. \\n Main Features \\n \\n Flexible text-based commands to add, update and search records, which provides powerful ways to manage information. \\n Saved searches to save searches for later use. \\n Ability to display records on calendars and Kanban boards. \\n Full-text search of all record fields. \\n Simple file system integration so to greatly reduce the need to organize files manually. \\n \\n Documentation \\n User's guide is available online at https://mfakih294.github.io/Nibras-PKM/. \\n Releases \\n Nibras PKM is hosted on GitHub https://github.com/mfakih294/Nibras-PKM. \\n Quick start guide \\n Running Nibras requires three simple steps: \\n \\n Download the bundle file corresponding to your platform, e.g. nibras-bundle-windows.zip from the releases page on Github. \\n Extract the zipped file to a location of your choice on your local disk. \\n Launch Nibras by double clicking on ./scripts/start file. \\n \\n Once Nibras has finished launching, a message like the one below will appear. \\n * Nibras has launched. You can access it from: * \\n * https://localhost:1441/ * \\n Go to https://localhost:1441/ using Firefox or Chrome. On the login page, enter nibras for username and nibras for the password. \\n Notes: \\n \\n As it has a self-signed certificate, you need to accept and bypass the security warning that shows up at the beginning. \\n On Linux, you need to make the files inside ./scripts and ./tomcat/bin folders executable (chmod +x *). \\n To stop Nibras, you can close this window, or press ctrl+c in it, or run ./scripts/stop script. \\n \\n Technical details \\n \\n Nibras is developed in Grails framework 3.3.10, a dynamic framework on top of the Java platform. \\n Grails applications run on any platform that can run Java 8 and later, so practically all platforms, including Windows, Linux, Mac. \\n For production use, Nibras uses MySQL 5+ for its database, and the file system to store the files of the records. To testing and demonstration, it can run with h2 database, with zero ex\",\n image:\n 'https://opengraph.githubassets.com/5e45c614cd8441100a4acd0e48d8b9c15984b51e816d4d4683436dd3be25c813/mfakih294/Nibras-PKM',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/reorproject/reor',\n title: 'GitHub - reorproject/reor: Private & local AI personal knowledge management app for high entropy people.',\n url: 'https://github.com/reorproject/reor',\n publishedDate: '2023-11-27T01:30:44.000Z',\n author: 'reorproject',\n text: 'Reor Project \\n \\nPrivate & local AI personal knowledge management app. \\n \\n \\n \\n \\n \\n \\n 📢 Announcement \\n We are now on Discord! Our team is shipping very quickly right now so sharing ❤️feedback❤️ with us will really help shape the product 🚀 \\n \\n About \\n Reor is an AI-powered desktop note-taking app: it automatically links related notes, answers questions on your notes and provides semantic search. Everything is stored locally and you can edit your notes with an Obsidian-like markdown editor. \\n The hypothesis of the project is that AI tools for thought should run models locally by default. Reor stands on the shoulders of the giants Ollama, Transformers.js & LanceDB to enable both LLMs and embedding models to run locally: \\n \\n Every note you write is chunked and embedded into an internal vector database. \\n Related notes are connected automatically via vector similarity. \\n LLM-powered Q&A does RAG on your corpus of notes. \\n Everything can be searched semantically. \\n \\n One way to think about Reor is as a RAG app with two generators: the LLM and the human. In Q&A mode, the LLM is fed retrieved context from the corpus to help answer a query. Similarly, in editor mode, the human can toggle the sidebar to reveal related notes \"retrieved\" from the corpus. This is quite a powerful way of \"augmenting\" your thoughts by cross-referencing ideas in a current note against related ideas from your corpus. \\n Getting Started \\n \\n Download from reorproject.org or releases. Mac, Linux & Windows are all supported. \\n Install like a normal App. \\n \\n Running local models \\n Reor interacts directly with Ollama which means you can download and run models locally right from inside Reor. Head to Settings->Add New Local LLM then enter the name of the model you want Reor to download. You can find available models here. \\n You can also connect to an OpenAI-compatible API like Oobabooga, Ollama or OpenAI itself! \\n Importing notes from other apps \\n Reor works within a single directory in the filesystem. You choose the directory on first boot.\\nTo import notes/files from another app, you\\'ll need to populate that directory manually with markdown files. Note that if you have frontmatter in your markdown files it may not parse correctly. Integrations with other apps are hopefully coming soon! \\n Building from source \\n Make sure you have nodejs installed. \\n Clone repo \\n git clone https://github.com/reorproject/reor.git\\n \\n Install dependencies \\n Run for dev \\n Build \\n Interested in contributing? \\n We are always on the lookout for contributors keen on building the future of knowledge management. Have a feature idea? Want to squash a bug? Want to improve some styling? We\\'d love to hear it. Check out our issues page and the contributing guide to get started. \\n License \\n AGPL-3.0 license. See LICENSE for details. \\n Reor means \"to think\" in Latin. \\n',\n image:\n 'https://opengraph.githubassets.com/101249afc41e6b8729eca3c619d4c08c5c67288ab4126de16c59c1ab97c5492c/reorproject/reor',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/memex-life/memex',\n title:\n 'GitHub - memex-life/memex: Your second brain for the web browsing. An AI powered Chrome extension that constructs personal knowledge base for you.',\n url: 'https://github.com/memex-life/memex',\n publishedDate: '2023-03-16T23:48:35.000Z',\n author: 'memex-life',\n score: 0.34730345010757446,\n text: 'Memex \\n Your second brain for web browsing. Picture possessing the ultimate ability of total recall. \\n \\n Overview \\n This project aims to create a browser extension that acts like a personal memex machine.\\nIt will keep track of everything you browse online to build your own knowledge base.\\nThen it will use AI to retrieve that knowledge whenever you need it. \\n What is a Memex? \\n \\n Consider a future device for individual use, which is a sort of mechanized private file and library. It needs a name, and, to coin one at random, “memex” will do. A memex is a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility. It is an enlarged intimate supplement to his memory. \\n--- “As We May Think” Vannevar Bush (1945) \\n \\n Features \\n \\n Seamlessly captures content and metadata from your web browsing. \\n Constructs your own personalized knowledge base on your local device \\n Retrive knowledge with power of AI. \\n \\n How it works \\n When you browse the web, this extension will inject a script to capture the text content on the pages you visit. It will send that content to the backend service-worker for processing\\nThe service-worker will break the content into pieces and store it in a database.\\nThe popup page acts as a chat interface to answer your questions using the information in the database. \\n Getting Started \\n Build & import Extension \\n Build extension files into dist/ folder \\n npm install\\nnpm run build # or npm run watch \\n Load extension \\n Start the Kownledge Base server \\n Currently the LangchainJs has not yet support browser runtime. The extension still needs a backend server as Knowledge Base implementaion. \\n set environments: \\n export TOKENIZERS_PARALLELISM=false\\nexport OPENAI_API_KEY=<your-api-key>\\ncd server\\nFLASK_APP=server flask run\\n \\n Start using \\n Once you have completed the above steps, you can start using the Memex browser extension to enhance your web browsing experience. \\n \\n As you browse the web, the extension will automatically capture and store the text content from the web pages you visit, along with their metadata, in your personalized knowledge base. \\n When you need to retrieve information or recall something from your browsing history, simply open the chat interface by clicking on the Memex extension icon. Type your question or query into the chat interface and press Enter or click the Send button. The Memex extension will use AI to search your knowledge base and provide you with the most relevant information based on your query. \\n \\n',\n image:\n 'https://opengraph.githubassets.com/aa7966b46e8bb10410af6cdb5af62c9095d99c4b9d17683b246641b8a1291746/memex-life/memex',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/samkeen/knowling',\n title:\n 'GitHub - samkeen/knowling: A desktop notes application leveraging AI designed for Personal Knowledge Management (PKM)',\n url: 'https://github.com/samkeen/knowling',\n publishedDate: '2024-03-08T03:28:38.000Z',\n author: 'samkeen',\n score: 0.8010122776031494,\n text: 'Knowling \\n A desktop notes application designed for Personal Knowledge Management (PKM) \\n \\n Knowling aims to provide users with an intuitive platform for gathering and organizing knowledge from various research\\nsources. By leveraging AI, Knowling assists users in categorizing their notes and highlighting connections between them,\\nthereby enhancing the overall management of their personal knowledge store. \\n Features \\n \\n Fast Performance: Knowling is developed using Rust and JavaScript, ensuring a responsive and efficient user\\nexperience. \\n WSIWIG Markdown Editor: A What-You-See-Is-What-You-Get (WSIWIG) Markdown editor for seamless and straightforward\\nnote-taking. \\n Simple, Uncluttered UI: The user interface is designed to be minimalistic and distraction-free, allowing users to\\nfocus on their content. \\n Export/Import Notes: Easily export and import notes to manage your knowledge base across different devices and\\nformats. \\n AI Integration: AI is integrated to empower users by automatically categorizing notes and identifying meaningful\\nconnections between them. \\n Open Source: Knowling is open source and licensed under the Apache 2.0 license, encouraging community\\ncontributions\\nand\\ntransparency. \\n \\n Current Development Status \\n Knowling is currently in the early stages of development, with a minimal feature set. We are actively working on\\nexpanding the application\\'s capabilities and enhancing its functionality. We welcome you to check out the open feature\\nrequests and encourage you to open new ones if you have any suggestions or ideas. \\n \\n Open Issues \\n Project view \\n \\n We hope you find Knowling valuable for managing your personal knowledge. If you have any feedback or encounter any\\nissues, please don\\'t hesitate to reach out or contribute to the project. \\n Why the name Knowling: Knowling is a play on the words \"Knowledge\" and \"Knolling\", a process of arranging objects to\\ncreate clean and organized\\nspaces. This reflects our goal of helping users keep their knowledge organized and easily accessible. \\n \\n \\n Developing Knowling \\n Knowling is built atop Tauri 1.x \\n Project setup \\n npm install\\nnpm run tauri dev\\n \\n Development \\n Build \\n https://tauri.app/v1/api/cli/ \\n Development follows the common practices of developing a Tauri application. \\n Debugging in RustRover \\n https://tauri.app/v1/guides/debugging/rustrover/ \\n',\n image:\n 'https://opengraph.githubassets.com/68a818dd653e6084907d244111f983fe2b2367dcfb8eed93ebece179892ae74c/samkeen/knowling',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/whl1207/Knowledge',\n title: 'GitHub - whl1207/Knowledge: Distributed Multi-View Intelligent Knowledge Management Platform',\n url: 'https://github.com/whl1207/Knowledge',\n publishedDate: '2023-08-26T03:26:41.000Z',\n author: 'whl1207',\n score: 0.35489749908447266,\n text: 'AI-KM Intelligent Knowledge Management Platform \\n Overview \\n AI-KM (Artificial Intelligence Knowledge Management) is a next-generation knowledge management platform that integrates cutting-edge AI technologies. Leveraging large language models and knowledge graph technologies, it helps individuals and organizations achieve efficient knowledge organization, in-depth analysis, and intelligent application. \\n \\n Core Value \\n \\n Intelligent Knowledge Processing: Automatically parses, queries, and associates knowledge content \\n Multi-dimensional Visualization: Provides 6 view modes to present knowledge relationships \\n Open Model Integration: Supports seamless switching between mainstream open-source large language models via Ollama \\n Enterprise-grade Security: All data processing is performed locally \\n \\n Key Features \\n 1. Core Technical Architecture \\n \\n \\n Multi-model Integration Engine \\n \\n Supports mainstream large language models deployed via the Ollama framework \\n Base models: Deepseek-R1, qwen3, LLaMA3.3, QWQ \\n Embedding models: nomic-embed-text, bge-m3, mxbai-embed-large \\n Multimodal models: Gemma3, Mistral-Small 3.1 \\n \\n \\n \\n Enhanced Retrieval System \\n \\n RAG (Retrieval-Augmented Generation) architecture \\n Supports knowledge base preprocessing (default segmentation by 2 line breaks) \\n Supports similarity calculations for various embedding models \\n Supports hidden information inference in knowledge bases (default: deducing potential user queries) and knowledge fragment keyword editing \\n Supports custom retrieval thresholds (can set knowledge base retrieval thresholds based on cosine similarity, quantity, characters, etc.) \\n Explainable analysis and debugging of retrieval results, displaying similarity information for each knowledge fragment \\n Supports cosine similarity calculation and MDS dimensionality reduction-based similarity calculation \\n \\n \\n \\n Visual Workflow Engine \\n \\n Drag-and-drop AI processing pipeline construction \\n Includes 3+ pre-built node templates \\n Supports workflow import/export \\n \\n \\n \\n Markdown Document Editing \\n \\n Deep Markdown parsing and editing \\n Document structure analysis (heading hierarchy recognition) \\n Code block processing \\n \\n \\n \\n Multi-view Knowledge Display Module \\n \\n \\n \\n Multi-platform Packaging & Deployment \\n \\n Electron-based packaging for Windows, Linux, macOS, and other platform clients \\n \\n \\n \\n Installation & Deployment \\n System Requirements \\n \\n OS: Windows 10+/macOS 12+/Linux (Ubuntu 20.04+) \\n Hardware:\\n \\n Minimum: 8GB RAM, 4-core CPU, 10GB storage \\n Recommended: 16GB+ RAM, dedicated GPU, 50GB+ storage \\n \\n \\n \\n Development Environment Setup \\n # Install dependencies \\nnpm install\\n # Run in development mode \\nnpm run dev\\n # Build Windows client \\nnpm run build\\n # Generate installation package \\n AI-KM 智能知识管理平台 \\n 概述 \\n AI-KM(Artificial Intelligence Knowledge Management)是一个集成了前沿AI技术的下一代知识管理平台,通过大语言模型和知识图谱技术,帮助个人和组织实现知识的高效组织、深度分析和智能应用。 \\n 核心价值 \\n \\n 智能知识处理 :自动解析、查询和关联知识内容 \\n 多维度可视化 :提供6种视图模式呈现知识关系 \\n 开放模型集成 :可以通过ollama支持主流开源',\n image:\n 'https://opengraph.githubassets.com/fc9354a52086145d1cf60e2b9c3d386a3be8fa44e2e00cbb13cd2b1af09973b7/whl1207/Knowledge',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/putaodoudou/kmagent',\n title:\n 'GitHub - putaodoudou/kmagent: KMAgent (Knowledge Management Agent),基于语义元的智能知识管理GTD工具,个人智能助理。',\n url: 'https://github.com/putaodoudou/kmagent',\n publishedDate: '2018-06-05T09:11:21.000Z',\n author: 'putaodoudou',\n score: 0.35521113872528076,\n text: 'KMAgent-个人智能助理 \\n \\n 个人 知识智能助理(KMAgent, Knowledge Management Agent)--专注智能知识管理GTD 多元融合创新 发扬传承智慧! \\n KMAgent 以 个人知识管理 GTD 应用为主的工具效率软件。基于交互区+文档的协同学习工作空间,专注于语义计算、知识工程,致力于通过自然语言处理、机器学习、知识图谱等人工智能技术,简化知识增强认知、融合支持优秀方法论模板,辅助高效学习工作,扩展个人能力,类似钢铁侠的【贾维斯】。以开源项目的形式结合产学研,支持社群协同积累创新,节省时间精力,从知识中挖掘智慧。您的私人知识引擎、秘书、智友、智囊团。 \\n 请查看网站 http://kmagent.com 获取相关安装指南及使用说明。 \\n 为什么Why? \\n \\n 特别重要的两个能力:1、制造工具;2、寻求合作。 \\n \\n 智能时代,信息爆炸,知识匮乏,辅助做减法!协同合作,降低信息熵,提高智商,极简智能知识管理! \\n \\n \\n 知识财富 ,积累知识胜过积累金钱,知识是人类进步的阶梯。是个人及企业的核心竞争力! \\n 化繁为简 ,发现模式化繁为简,挖掘本质及关联,知其然知其所以然,促进融合创新。 \\n 人类智能 ,挖掘隐性知识、理解人类多元智能,发掘利用大脑潜力,挑战认知极限。 \\n 知识传播 ,静态文本书籍的缺陷、探索新的知识存储展示分享方式,建立高效沟通协同与积累分享的基础。 \\n 实现应对人工智能 ,知识与智能相辅相成,知识管理作为核心环节,承上启下形成闭环,社群协同积累创新。 \\n 重新造轮子 ,为自己开发一个工具,自然交互降低工具学习使用成本,支持学习工作生活。 \\n 作为事业 ,值得奋斗十年的事业。 \\n \\n Do something diferent, make a change! \\n \\n 【产品简介】产品原型正火速开发中! \\n \\n 是以文档+交互区为中心的功能集成,资源事务行为的协同智能管理GTD。首先用于协同建立核心概念理论体系,知识管理业务建模,积累分享资源知识技术,应用于KM、IT、AI、数学相关领域知识的学习整理。 \\n \\n 功能及特性: \\n \\n 多媒体无限画板、实时协同文本导图编辑器,富文本和 Markdown 扩展编辑。 \\n 支持本体建模、阅读笔记、灵感便签、思维导图、各类模板。 \\n 划词翻译知识解释、搜索、百科字典。 \\n 知识可视化,多层次粒度维度去冗余,浓缩摘要、生成博客。 \\n 知识导入导出、Web 知识抽取集成。 \\n 资源管理、公共+个人+领域知识图谱。 \\n 收藏订阅评论分享、话题课程小组班级圈子。 \\n 项目事务的PDCA、GTD,日历日程安排提醒。 \\n 即时通信、实时协同、项目合作、积分系统。 \\n 个性化自学习聊天机器人、虚拟形象、语音识别生成、事务代理、主动推荐提醒引导辅助。 \\n 自然语言交互、语义化、响应式生成式、文本化、可视化、极致沉浸体验。 \\n 高级功能:自定义配置、插件、命令行、领域语言。 \\n \\n 辅助您进行极简智能知识管理:知识可视化创作展示,简化结构化已有知识资源,建立知识体系。深入本质理解知识、整体高效合作学习。个人事务的管理、原则方法论习惯的养成。语义计算,辅助推理、仿真、预测、决策。聊天解闷启发。 \\n 很高兴您 下载试用 并 回馈使用情况 。 \\n \\n 随着开发进展,会及时列出最新特性、新功能及改进情况。查看 v0.1 -> v1.0 升级信息 ,获取更多产品升级信息 。 \\n 【参与贡献】 \\n \\n 我们是一个协同学习型组织,以开源项目为中心,结合产学研,理论技术知识能力实践闭环正反馈迭代积累的过程,人与人与机器机器的合作学习!项目处于初期规划阶段, 欢迎各位有志之士的加入! \\n \\n 基于共同信念、统一基础、协同机制,自由分工合作的工作组,可选择一个或多个模块参与合作学习及开发,根据 规则 记录贡献积分,按贡献分配奖励,未来若盈利可分红,涌现集体智慧!欢迎每个人贡献力量、收获积分朋友知识工具技术。 \\n 【值得加入】知识改变命运,创新改变世界!改变自己从心而为,不忘初心方得始终! \\n 多种贡献方式 \\n \\n 可参与理论研究、业务建模、技术开发、项目管理、运营、投资、试用分享推广。 \\n 提交或投票新功能特性需求 ProductPains \\n 工具使用 情况反馈 \\n \\n 欢迎提交 pull requests 及 issue 。 \\n 若贡献源码请阅读遵循 编程风格 及 贡献说明文档 。 \\n 致谢 \\n 【源计划】KMAgent 当前是一个公开社群和免费软件,感谢所有促进其发展的 贡献者 和 [深度用户]( https://github.com/kmagent/ kmagent/fans.md)。【捐赠】如果您认同我们请支持我们快速持续发展。 \\n 主要模块 \\n 【核心重点】智能体语义元核心抽象、认知建模、知识图谱、智能知识管理GTD解决方案、产品设计开发,社群运营协同积累创新。(智能基础->智能核->智能块->智能体)群体智能->通用智能,模拟->超越。模块:km-thory km-engine km-onto km-agents km-sys km-ui、km-graph。 \\n 【领域及技术】智能知识管理(领域建模)、机器学习(tensorflow)、自然语言处理(NLTK、hanlp)、知识图谱(图数据库neo4j分布式存储ceph)、领域语言(DSL)、语义网(OWL)、web知识发现(爬虫)、检索(lucene)推理推荐、多agent集群智能(架构)、人机交互UI(vue.js、bootstrap、数据可视化)、Web网站(keystone)、桌面(webkit、electron)、移动(weex)、大数据(spark)、虚拟化云计算(Mesos、docker、Kubernetes)、安全网络通信加密权限认证(openSSL)、软件工程(项目开发管理)、区块链、VR、代码生成、认知心理、复杂系统、知识共享协议产权、社群体验经济。 \\n 【工作分解】 关键在于 :统一认识、工具支持、有效积累可持续发展。 \\n \\n 业务建模(智能知识管理GTD理论体系):核心抽象模型,人性建模。 \\n 产品设计(个人智能助理):产品规划、虚拟形象UI设计、竞品分析。 参考产品 :protege、vscode、quip、knowledgebuilder、metacademy、wiki、CSDN知识库、sketchboard、feedly、onenote画板、foxmail、京东阅读、qq音乐、NetLogo、flyinglogic、sourceinsight、幕布、Anki、wolframalpha。 \\n 技术架构(通用智能系统):分布式计算存储多智能体协同系统:普适网格语义人类计算。全平台、微服务、核心算法、技术选型、测试部署。C++、Python、js、HTML。 \\n 商业计划(SaaS 软件即服务):以软件产品为中心的增值服务、品牌运营推广营销。 \\n 项目管理(小代价达到目的):敏捷迭代、过程改进、配置管理。 \\n 社群建设(利益共同体联盟):文化理念集体智慧、扩大影响。 \\n 知识创作(知识管理等领域知识):知识管',\n image:\n 'https://opengraph.githubassets.com/935c4954d4a340aff679b550e201df566a4f53b442922a997e8a83570a564195/putaodoudou/kmagent',\n favicon: 'https://github.com/fluidicon.png',\n },\n ],\n costDollars: {\n total: 0.015,\n search: {\n neural: 0.005,\n },\n contents: {\n text: 0.01,\n },\n },\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport default {\n requestId: '32df0c541f9883180b35e04caece4374',\n autopromptString: 'open source AI knowledge management projects features comparison 2024',\n autoDate: '2024-01-01T00:00:00.000Z',\n resolvedSearchType: 'neural',\n results: [\n {\n id: 'https://tryfastgpt.ai/',\n title: 'FastGPT',\n url: 'https://tryfastgpt.ai/',\n publishedDate: '2024-01-01T00:00:00.000Z',\n author: 'labring',\n score: 0.36898404359817505,\n text: '20w+ Users are leveraging FastGPT to create their own specialized AI knowledge bases Empowerwith Your Expertise A free, open-source, and powerful AI knowledge base platform, offers out-of-the-box data processing, model invocation, RAG retrieval, and visual AI workflows. Easily build complex LLM applications. Features Why Choose FastGPT? Discover the advantages of FastGPT Open Source Secure and reliable open-source codebase. Optimized Q&A Enhanced question-answering accuracy for customer service. Visual Workflow Design complex workflows with ease using the Flow module. Seamless Extensibility Seamlessly integrate FastGPT into your applications via API. Debugging Tools Refine your models with comprehensive debugging features. Multi-Model Compatibility Compatible with various LLM models, with more to come. Do you find this open-source AI knowledge base platform valuable? Show your support by giving us a star 🌟 FAQ Find answers to the most common inquiries here. FastGPT allows commercial usage, such as serving as a backend service for other applications or as an application development platform for enterprises. However, when it comes to multi-tenant SaaS services or matters involving the LOGO and copyright information, you must contact the author to obtain a commercial license. FastGPT supports importing documents in various formats, including Word, PDF, Excel, Markdown, and web links. It also enables syncing data from an entire website, automatically handling text preprocessing, vectorization, and QA splitting, which saves manual training time and improves efficiency. As long as the API of the model you want to integrate aligns with the official OpenAI API, it can be used with FastGPT. You can utilize projects like One API to unify access to different models and provide an API that is compatible with the official OpenAI API. If you come across any problems while using FastGPT, please join our community or forum, create a post, and reach out to us for assistance.',\n favicon: 'https://tryfastgpt.ai/favicon-16x16.png',\n },\n {\n id: 'https://casibase.org',\n title:\n 'Casibase | Casibase · Open-Source LangChain-like AI Knowledge Database & Chat Bot with Admin UI and multi-model support (ChatGPT, Claude, Llama 3, DeepSeek R1, HuggingFace, etc.)',\n url: 'https://casibase.org',\n publishedDate: '2025-01-01T00:00:00.000Z',\n author: '',\n score: 0.354640930891037,\n text: 'Comprehensive Model Support Integrates a diverse range of AI models, including ChatGPT, Azure OpenAI, HuggingFace, and more, complemented by support for various embedding APIs like OpenAI Ada and Baidu Wenxin Yiyi. Advanced Document Handling & AI Assistance Supports multiple document formats including txt, markdown, docx, pdf with intelligent parsing, and features an embedded AI assistant for real-time online chat and manual session handover. Enterprise-Level Features & Multilingual Support Offers multi-user and multi-tenant capabilities with enterprise-grade Single Sign-On (SSO), comprehensive chat session logging for auditing, and a multilingual interface supporting Chinese, English, and more. Casibase is an open source AI knowledge base and dialogue system that combines the latest RAG (Retrieval Augmented Generation) technology, enterprise-grade Single Sign-On (SSO) functionality, and support for a wide range of mainstream AI models. Casibase is designed to provide enterprises and developers with a powerful, flexible, and easy-to-use knowledge management and intelligent dialogue platform. Casibase provides various provider configurations, such as storage providers, model providers, embedding providers, etc. To chat with AI easily, please visit the Casibase Guide for more details. Enterprise-class identity management capabilities Casibase uses Casdoor as its identity and single sign-on (SSO) provider. Through its deep integration with Casdoor, Casibase not only simplifies the user login process, but also provides a high level of security and flexibility, enabling organisations to easily manage user identities and access rights.',\n favicon: 'https://casibase.org/img/favicon.png',\n },\n {\n id: 'https://www.open-notebook.ai/',\n title: 'What is Open Notebook? | Open Notebook',\n url: 'https://www.open-notebook.ai/',\n publishedDate: '2024-01-01T00:00:00.000Z',\n author: '',\n score: 0.36405712366104126,\n text: \"Take Control of Your Learning. Privately. A powerful open-source, AI-powered note-taking/research platform that respects your privacy 🎙️ Podcast Generator Transform your notes into engaging podcasts with customizable voices, speakers, and episodes 🤖 AI-Powered Notes Leverage AI to summarize, generate insights, and manage your notes 🔒 Privacy Control Full control over what information AI can access 🔄 Content Integration Support for links, PDFs, TXT, PPT, YouTube, and more What is Open Notebook? Open Notebook is the cognitive partner you always wanted and could never explain why. It combines the power of AI with unwavering privacy controls. It's designed for researchers, students, and professionals who want to enhance their learning and abilities while maintaining complete control over workflows, models, and how their data gets used and exposed. Is this right for me? 📚 Learning Enthusiast You're constantly seeking knowledge and want to go beyond surface-level understanding. Learning for you is about building deep, lasting comprehension. 🤝 You want a learning partner You believe your learning process can improve by partnering with a tailor made AI. You want to be provoked to think more clearly. 🤯 Your learning backlog is way too big You have hundreds of links you would love to read, but there is no time for it all. You want to make sure those are catalogued for when you need them. ✍️ Independent Thinker You value both taking notes and forming your own ideas. You understand different viewpoints but believe in developing your own perspective. 🔒 You are privacy aware You don't want all your context, thoughts and plans to be all over Big Tech, if not necessary. 💁 You like things your way You want to decide how your content is handled, which AI models you want to interact with and help specifically it should help/challenge you. What is the plan for the future? There is much more that can be done to augment human knowledge. Open Notebook's first release is just a first step in that direction. The end goal is to build a Cognitive Partner for every person. A customized assistant that can help you develop your skills, knowledge, and opinions in a way that makes sense to you. Learn more about our long-term vision and roadmap in our Vision page.\",\n },\n {\n id: 'https://www.suna.so/',\n title: 'Suna - Open Source Generalist AI Agent',\n url: 'https://www.suna.so/',\n publishedDate: '2025-06-21T00:00:00.000Z',\n author: 'Kortix Team',\n score: 0.3588857054710388,\n text: '100% OPEN SOURCE Suna, your AI Employee. Suna by Kortix – is a generalist AI Agent that acts on your behalf. See Suna in action Explore real-world examples of how Suna completes complex tasks autonomously Suna is fully open source. Join our community and help shape the future of AI. The Generalist AI Agent Explore, contribute, or fork our repository. Suna is built with transparency and collaboration at its core. TypeScript Python Apache 2.0 License View on GitHub Transparency & Trust We believe AI should be open and accessible to everyone. Our open source approach ensures accountability, innovation, and community collaboration. Transparency Fully auditable codebase Community Join our developers Apache 2.0 Free to use and modify Choose the right plan for your needs Start with our free plan or upgrade to a premium plan for more usage hours Free $0 Get started with 60 min/month Public Projects Basic Model (Limited capabilities) Pro Popular $20 /month Everything in Free, plus: 2 hours/month 2 hours Private projects Access to intelligent Model (Full Suna) Custom $50 /month Everything in Pro, plus: Customize your monthly usage 6 hours/month Suited to you needs',\n image: 'https://suna.so/opengraph-image?971e689ec8d3b4eb',\n favicon: 'https://www.suna.so/favicon.png',\n },\n {\n id: 'https://github.com/AIDotNet/AntSK',\n title:\n 'GitHub - AIDotNet/AntSK: 基于.Net8+AntBlazor+SemanticKernel 和KernelMemory 打造的AI知识库/智能体,支持本地离线AI大模型。可以不联网离线运行。支持aspire观测应用数据',\n url: 'https://github.com/AIDotNet/AntSK',\n publishedDate: '2024-02-01T15:08:17.000Z',\n author: 'AIDotNet',\n score: 0.3635949492454529,\n text: '简体中文 | English \\n AntSK \\n AI Knowledge Base/Intelligent Agent built on .Net8+AntBlazor+SemanticKernel \\n ⭐Core Features \\n \\n \\n Semantic Kernel: Utilizes advanced natural language processing technology to accurately understand, process, and respond to complex semantic queries, providing users with precise information retrieval and recommendation services. \\n \\n \\n Kernel Memory: Capable of continuous learning and storing knowledge points, AntSK has long-term memory function, accumulates experience, and provides a more personalized interaction experience. \\n \\n \\n Knowledge Base: Import knowledge base through documents (Word, PDF, Excel, Txt, Markdown, Json, PPT) and perform knowledge base Q&A. \\n \\n \\n GPT Generation: This platform supports creating personalized GPT models, enabling users to build their own GPT models. \\n \\n \\n API Interface Publishing: Exposes internal functions in the form of APIs, enabling developers to integrate AntSK into other applications and enhance application intelligence. \\n \\n \\n API Plugin System: Open API plugin system that allows third-party developers or service providers to easily integrate their services into AntSK, continuously enhancing application functionality. \\n \\n \\n.Net Plugin System: Open dll plugin system that allows third-party developers or service providers to easily integrate their business functions by generating dll in standard format code, continuously enhancing application functionality. \\n \\n \\n Online Search: AntSK, real-time access to the latest information, ensuring users receive the most timely and relevant data. \\n \\n \\n Model Management: Adapts and manages integration of different models from different manufacturers, models offline running supported by llamafactory and ollama. \\n \\n \\n Domestic Innovation: AntSK supports domestic models and databases and can run under domestic innovation conditions. \\n \\n \\n Model Fine-Tuning: Planned based on llamafactory for model fine-tuning. \\n \\n \\n ⛪Application Scenarios \\n AntSK is suitable for various business scenarios, such as: \\n \\n Enterprise knowledge management system \\n Automatic customer service and chatbots \\n Enterprise search engine \\n Personalized recommendation system \\n Intelligent writing assistance \\n Education and online learning platforms \\n Other interesting AI Apps \\n \\n ✏️Function Examples \\n Online Demo \\n document \\n demo \\nand\\n demo1 \\n Default account: test\\nDefault password: test\\nDue to the low configuration of the cloud server, the local model cannot be run, so the system settings permissions have been closed. You can simply view the interface. If you want to use the local model, please download and use it on your own.\\n \\n Other Function Examples \\n Video Demonstration \\n ❓How to get started? \\n Here I am using Postgres as the data and vector storage because Semantic Kernel and Kernel Memory support it, but you can also use other options. \\n The model by default supports the local model of openai, azure openai, and llama. If you need to use other models, you can integrate t',\n image:\n 'https://opengraph.githubassets.com/945bd786b32bfe02a9a537c511d768696a91e155dc07052bba541d1b3e6517c0/AIDotNet/AntSK',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://www.cognee.ai/',\n title: 'Improve your AI infrastructure - AI memory engine',\n url: 'https://www.cognee.ai/',\n publishedDate: '2025-05-21T00:00:00.000Z',\n author: '',\n score: 0.3653402328491211,\n text: 'AI agent responses you can rely on AI Memory Python SDK. 90% accuracy out of the box. People use cognee to sort out their data and improve AI answers Ask cognee 89.4% answer relevancy Vector store Ask RAG Potato answer relevancy ChatGPT Ask ChatGPT 5% answer relevancy Improve responses from LLM applications Text generation Content summaries Customer analysis Chatbot responses Code generation Translations Why choose Cognee 1 It’s free and open-source We’re all about building in the open. Just install the Python library, or clone the repo from GitHub and start playing around. Super flexible for developers and hobbyists. 2 Totally customisable storage Want to use a different database provider? No problem. cognee supports many out of the box (like vector and graph databases), but you can easily plug in your own by following the docs. 3 Smart data with ontologies Cognee isn’t just storing random chunks of data - everything is related! RDF-based ontologies define the structure with publicly available rules and ontologies to make your data even smarter. 4 Actual reasoning (no guessing here!) Instead of just guessing based on patterns, cognee can use real reasoners. You can use existing ones, or build your own for your specific case. 5 Built for your servers You can run everything on your own servers, so if you’re dealing with sensitive data there’s no third-party risk. 6 Handles loads of data Need to analyse a lot of data? Whether it’s gigabytes (or terabytes :hushed:) cognee’s distributed system can handle it. It scales exactly when you need it to. 1 It’s free and open-source We’re all about building in the open. Just install the Python library, or clone the repo from GitHub and start playing around. Super flexible for developers and hobbyists. 3 Smart data with ontologies Cognee isn’t just storing random chunks of data - everything is related! RDF-based ontologies define the structure with publicly available rules and ontologies to make your data even smarter. 5 Built for your servers You can run everything on your own servers, so if you’re dealing with sensitive data there’s no third-party risk. 2 Totally customisable storage Want to use a different database provider? No problem. cognee supports many out of the box (like vector and graph databases), but you can easily plug in your own by following the docs. 4 Actual reasoning (no guessing here!) Instead of just guessing based on patterns, cognee can use real reasoners. You can use existing ones, or build your own for your specific case. 6 Handles loads of data Need to analyse a lot of data? Whether it’s gigabytes (or terabytes :hushed:) cognee’s distributed system can handle it. It scales exactly when you need it to. Success case Increased answer relevancy with more support agents using the tool. Helping Dynamo increase customer engagement Problem Dynamo helps gaming companies interact with their user base. Agents communicate via messenger to offer bonuses and encourage participation in tournaments a',\n image: 'https://www.cognee.ai/images/meta/cognee-logo-text-on-gradient.png',\n favicon: 'https://www.cognee.ai/favicon.ico',\n },\n {\n id: 'https://github.com/AI4WA/Docs2KG',\n title:\n 'GitHub - AI4WA/Docs2KG: Docs2KG: A Human-LLM Collaborative Approach to Unified Knowledge Graph Construction from Heterogeneous Documents',\n url: 'https://github.com/AI4WA/Docs2KG',\n publishedDate: '2024-05-08T15:21:54.000Z',\n author: 'AI4WA',\n score: 0.36111196875572205,\n text: 'Docs2KG \\n A Human-LLM Collaborative Approach to Unified Knowledge Graph Construction from Heterogeneous Documents \\n \\n \\n \\n \\n \\n \\n Installation \\n We have published the package to PyPi: Docs2KG, \\n You can install it via: \\n pip install Docs2KG\\npython -m spacy download en_core_web_sm \\n \\n \\n \\n Setup and Tutorial \\n Detailed setup and tutorial can be found in the documentation. \\n You have two ways to run the package: \\n \\n import the package in the code, and hook it with your own code \\n run the package in the command line \\n \\n Command Line \\n # first setup the CONFIG_FILE environment variable to local one \\n export CONFIG_FILE=config.yml # or any other path for the configuration file \\ndocs2kg # this command will tell you how to use the package \\n # we currently support the following commands \\ndocs2kg process-document your_input_file --agent-name phi3.5 --agent-type ollama --project-id your_project_id\\ndocs2kg batch-process your_input_dir --agent-name phi3.5 --agent-type ollama --project-id your_project_id\\ndocs2kg list-formats # list all the supported formats \\n Usage: docs2kg [OPTIONS] COMMAND [ARGS]...\\n Docs2KG - Document to Knowledge Graph conversion tool.\\n Supports multiple document formats: PDF, DOCX, HTML, and EPUB.\\nOptions:\\n -c, --config PATH Path to the configuration file (default: ./config.yml)\\n --help Show this message and exit.\\nCommands:\\n batch-process Process all supported documents in a directory.\\n list-formats List all supported document formats.\\n neo4j Load data to Neo4j database.\\n process-document Process a single document file.\\n \\n Usage: docs2kg process-document [OPTIONS] FILE_PATH\\n Process a single document file.\\n FILE_PATH: Path to the document file (PDF, DOCX, HTML, or EPUB)\\nOptions:\\n -p, --project-id TEXT Project ID for the knowledge graph construction\\n -n, --agent-name TEXT Name of the agent to use for NER extraction\\n -t, --agent-type TEXT Type of the agent to use for NER extraction\\n --help Show this message and exit.\\n \\n Usage: docs2kg neo4j [OPTIONS] PROJECT_ID\\n Load data to Neo4j database.\\nOptions:\\n -m, --mode [import|export|load|docker_start|docker_stop]\\n Mode of operation (import or export)\\n -u, --neo4j-uri TEXT URI for the Neo4j database\\n -U, --neo4j-user TEXT Username for the Neo4j database\\n -P, --neo4j-password TEXT Password for the Neo4j database\\n -r, --reset_db Reset the database before loading data\\n --help \\n \\n Motivation \\n To digest diverse unstructured documents into a unified knowledge graph, there are two main challenges: \\n \\n How to get the documents to be digitized? \\n \\n With the dual-path data processing\\n \\n For image based documents, like scanned PDF, images, etc., we can process them through the layout analysis and\\nOCR, etc. Docling and MinerU are focusing on this part. \\n For native digital documents, like ebook, docx, html, etc., we can process them through the programming parser \\n \\n \\n It is promising that we will have a robust solution soon. \\n \\n \\n How to construct a high-quality unified knowledge graph with less effort? \\n \\n Fo',\n image:\n 'https://opengraph.githubassets.com/170da8210f59c1e9bb44ebe1ee84b35e1fd9d3d74d1aec22323534770d4921af/AI4WA/Docs2KG',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://github.com/RoboZoom/knowledge_management',\n title: 'GitHub - RoboZoom/knowledge_management',\n url: 'https://github.com/RoboZoom/knowledge_management',\n publishedDate: '2024-02-08T02:20:22.000Z',\n author: 'RoboZoom',\n score: 0.37371376156806946,\n text: '\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\nGitHub Copilot\\n \\nWrite better code with AI\\n \\n \\n \\n \\n \\n \\nGitHub Models\\n \\nNew\\n \\n \\nManage and compare prompts\\n \\n \\n \\n \\n \\n \\nGitHub Advanced Security\\n \\nFind and fix vulnerabilities\\n \\n \\n \\n \\n \\n \\nActions\\n \\nAutomate any workflow\\n \\n \\n \\n \\n \\n \\nCodespaces\\n \\nInstant dev environments\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\nIssues\\n \\nPlan and track work\\n \\n \\n \\n \\n \\n \\nCode Review\\n \\nManage code changes\\n \\n \\n \\n \\n \\n \\nDiscussions\\n \\nCollaborate outside of code\\n \\n \\n \\n \\n \\n \\nCode Search\\n \\nFind more, search less\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n Explore \\n \\n \\nLearning Pathways\\n \\n \\n \\nEvents & Webinars\\n \\n \\n \\nEbooks & Whitepapers\\n \\n \\n \\nCustomer Stories\\n \\n \\n \\nPartners\\n \\n \\n \\nExecutive Insights\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\nGitHub Sponsors\\n \\nFund open source developers\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\nThe ReadME Project\\n \\nGitHub community articles\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\nEnterprise platform\\n \\nAI-powered developer platform\\n \\n \\n \\n \\n \\n \\n Pricing \\n \\n \\n \\n \\n \\nSign up\\n \\n \\n',\n image:\n 'https://opengraph.githubassets.com/2388498497e355faeecdd0ebc0ae18ac0680ba329b5f7030aa21bc38ddaa6b8b/RoboZoom/knowledge_management',\n favicon: 'https://github.com/fluidicon.png',\n },\n {\n id: 'https://creati.ai/ai-tools/sciphi/',\n title: 'SciPhi: Build, Deploy, and Optimize AI Systems | Creati.ai',\n url: 'https://creati.ai/ai-tools/sciphi/',\n publishedDate: '2024-07-01T00:00:00.000Z',\n author: '',\n score: 0.37101393938064575,\n text: \"SciPhi simplifies building, deploying, and optimizing Retrieval-Augmented Generation (RAG) systems, empowering developers to focus on AI innovation. Added on: Social & Email: Platform: SciPhi SciPhi simplifies building, deploying, and optimizing Retrieval-Augmented Generation (RAG) systems, empowering developers to focus on AI innovation. Added on: Social & Email: Platform: What is SciPhi? SciPhi is an open-source platform designed to simplify the building, deploying, and scaling of Retrieval-Augmented Generation (RAG) systems. It provides an end-to-end solution for developers, enabling them to focus on AI innovation without worrying about the underlying infrastructure. With tools for automated knowledge graph extraction, document and user management, and robust observability, SciPhi ensures efficient and optimized RAG system deployment. Who will use SciPhi? Developers AI Engineers Data Scientists Tech Startups Research Institutions How to use the SciPhi? Step1: Visit the SciPhi website. Step2: Sign up for an account or log in. Step3: Access the platform's dashboard. Step4: Follow guides to build and deploy your RAG system. Step5: Use tools for knowledge graph extraction and management. Step6: Optimize and monitor your system using provided observability features. SciPhi's Core Features & Benefits The Core Features of SciPhi End-to-End RAG System Deployment Automated Knowledge Graph Extraction Document and User Management Robust Observability Tools The Benefits of SciPhi Simplifies AI Development Speeds Up Deployment Time Enhances System Optimization Reduces Infrastructure Complexity SciPhi's Main Use Cases & Applications Building RAG Systems for AI Applications Deploying Knowledge Graphs Managing Large Document Repositories Optimizing AI System Performance FAQs of SciPhi SciPhi is an open-source platform designed to simplify building, deploying, and optimizing Retrieval-Augmented Generation (RAG) systems. SciPhi is intended for developers, AI engineers, data scientists, tech startups, and research institutions. Core features include end-to-end RAG system deployment, automated knowledge graph extraction, document and user management, and robust observability tools. Visit the SciPhi website, sign up for an account, and follow the guides to build and deploy your RAG system. SciPhi supports web platforms. SciPhi simplifies AI development, speeds up deployment time, enhances system optimization, and reduces infrastructure complexity. Yes, alternatives include LangChain, LlamaIndex, Haystack, and Flower. SciPhi supports building RAG systems for AI applications, deploying knowledge graphs, managing large document repositories, and optimizing AI system performance. You can reach out to their support team via their support email provided on the website. SciPhi offers both free and paid plans. Details on pricing can be found on their website. SciPhi Company Information Website: https://www.sciphi.ai Company Name: SciPhi Support Email: [ema\",\n image: 'https://cdn-image.creati.ai/ai-tools/product-image/sciphi.webp',\n favicon: 'https://cdn-image.creati.ai/image/Creatiai.ico',\n },\n {\n id: 'https://helpjuice.com/blog/open-source-knowledge-base',\n title: 'The 12 Best Open Source Knowledge Base Software for 2024',\n url: 'https://helpjuice.com/blog/open-source-knowledge-base',\n author: 'Zeeshan Khan',\n text: \"\\n \\n \\n \\n \\n At Helpjuice / \\n \\n #Software & Alternatives\\n May 15 2025 \\n 11m read \\n \\n \\n \\n \\n On the hunt for the perfect knowledge base software that’s open source? This post will walk you through the best options for your business. \\n \\n \\n \\n \\n There’s no denying that a knowledge base can make a major impact on your organization. Whether it's to help provide better support to your customers or to enable your employees to find the information they need to do their job, a finely-tuned knowledge base can make all the difference when it comes to how knowledge and information flows through your business. And with plenty of options on the market out there, there’s certainly no shortage of open source knowledge base software. But how can you tell you’re not investing time into installing and learning new software that your team won't use anyway? How can you avoid the time and effort put into an open source option that you later determine to not be a good fit for your needs? It’s simple—do a little research beforehand. We know, we know—you don’t have endless time to invest in that kind of thing (what with a business to run and all). That’s why we’ve created a helpful list of the must-consider open source knowledge base software that companies of all niches, industries, and sizes should consider. We’re even throwing in a little helpful knowledge that should equip you with the information needed to choose the right software for you—like what knowledge base software is in the first place, the benefits of open source software, and how to address your unique needs as a company to choose the right software for you. Want to skip ahead on some of the basics of open-source knowledge base software? Be our guest. The best open source knowledge base software includes: \\n BookStack \\n OpenKM \\n myBase \\n eXo \\n PHPKB \\n Documize \\n DocuWiki \\n phpMyFAQ \\n MediaWiki \\n xWiki \\n TWiki \\n TiddlyWiki \\n What is an Open Source Knowledge Base? Before we dive into which open-source knowledge base software you should consider for your business, we should probably ensure we’re on the same page about what exactly open-source knowledge base software is. First things first, let’s start with the term knowledge base. A knowledge base is a central place that allows structured storage of information where users can search for and access this information. Knowledge base software should be the key tool that helps make this process seamless, simplified, and efficient. Knowledge base software is designed to help you create and manage your knowledge base to the best of your ability. this usually includes setting up the knowledge base architecture, creating and editing documentation, searching, and analyzing your knowledge base, and more. Ideally, this is the irreplaceable piece of the puzzle that operates your entire knowledge management system that helps orchestrate, manage, and optimize the flow of knowledge within your organization. That part seems pretty clear, right? Next, we’ll move on to\",\n image:\n 'https://static.helpjuice.com/helpjuice_production/uploads/upload/image/4752/direct/1636499945090-Open%20Source%20Knowledge%20Base%20Software.jpg',\n favicon:\n 'https://static.helpjuice.com/assets/favicon-32x32-161f2153235b710a8ed7b9233ed6b195936bdb57bf1310e720f7fea79547cf9d.png',\n },\n ],\n costDollars: {\n total: 0.015,\n search: {\n neural: 0.005,\n },\n contents: {\n text: 0.01,\n },\n },\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type { SearchResponse } from 'exa-js';\n\nimport Search1 from './exa-search-1748337321991';\nimport Search2 from './exa-search-1748337331526';\nimport Search3 from './exa-search-1748337344119';\n\nexport const SEARCH_RESULTS: SearchResponse<any>[] = [Search1, Search2, Search3];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { AgentStatusReport, ConsolePrinter, ToolRegistry } from '@dxos/ai';\nimport { create } from '@dxos/echo-schema';\nimport { AiService, CredentialsService, DatabaseService, defineFunction, TracingService } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { DataTypes } from '@dxos/schema';\n\nimport { createExaTool, createMockExaTool } from './exa';\nimport { createGraphWriterTool } from './graph';\n// TODO(dmaretskyi): Vite build bug with instruction files with the same filename getting mixed-up\nimport PROMPT from './instructions-research.tpl?raw';\nimport { AISession } from '../session';\n\n/**\n * Exec external service and return the results as a Subgraph.\n */\n// TODO(burdon): Rename.\nexport const researchFn = defineFunction({\n description: 'Research the web for information',\n inputSchema: Schema.Struct({\n query: Schema.String.annotations({\n description: 'The query to search for.',\n }),\n\n // TOOD(burdon): Move to context.\n mockSearch: Schema.optional(Schema.Boolean).annotations({\n description: 'Whether to use the mock search tool.',\n default: false,\n }),\n }),\n outputSchema: Schema.Struct({\n // result: Schema.String,\n result: Schema.Any,\n }),\n handler: async ({ data: { query, mockSearch }, context }) => {\n const ai = context.getService(AiService);\n const credentials = context.getService(CredentialsService);\n const { db } = context.getService(DatabaseService);\n // const queues = context.getService(QueueService);\n const tracing = context.getService(TracingService);\n\n tracing.write(create(AgentStatusReport, { message: 'Researching...' }));\n\n const exaCredential = await credentials.getCredential({ service: 'exa.ai' });\n const searchTool = mockSearch ? createMockExaTool() : createExaTool({ apiKey: exaCredential.apiKey! });\n\n const printer = new ConsolePrinter();\n const session = new AISession({ operationModel: 'configured' });\n session.message.on((message) => printer.printMessage(message));\n session.userMessage.on((message) => printer.printMessage(message));\n session.block.on((block) => printer.printContentBlock(block));\n session.statusReport.on((status) => {\n log.info('[agent] status', { status });\n tracing.write(status);\n });\n session.streamEvent.on((event) => log('stream', { event }));\n\n const graphWriteTool = createGraphWriterTool({ db, schema: DataTypes });\n log.info('graphWriteTool', { schema: graphWriteTool.parameters });\n\n // TODO(dmaretskyi): Consider adding this pattern as the \"Graph\" output mode for the session.\n const result = await session.run({\n client: ai.client,\n systemPrompt: PROMPT,\n artifacts: [],\n tools: [searchTool.id, graphWriteTool.id],\n history: [],\n prompt: query,\n toolResolver: new ToolRegistry([searchTool, graphWriteTool]),\n });\n\n return {\n result: result as any,\n };\n\n // queues.contextQueue!.append(data);\n\n // return {\n // result: `\n // The research results are placed in the following objects:\n // ${data.map((object, id) => `[obj_${id}][dxn:echo:@:${object.id}]`).join('\\n')}\n // `,\n // };\n },\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema, identity, Option, SchemaAST } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport type { Obj, Relation } from '@dxos/echo';\nimport { Query, Filter } from '@dxos/echo';\nimport { type EchoDatabase, type Queue } from '@dxos/echo-db';\nimport { isEncodedReference } from '@dxos/echo-protocol';\nimport {\n EntityKind,\n getSchemaTypename,\n getTypeAnnotation,\n getTypeIdentifierAnnotation,\n create,\n getEntityKind,\n getSchemaDXN,\n ObjectId,\n ReferenceAnnotationId,\n type BaseObject,\n RelationSourceDXNId,\n RelationTargetDXNId,\n RelationSourceId,\n RelationTargetId,\n} from '@dxos/echo-schema';\nimport { mapAst } from '@dxos/effect';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { deepMapValues, isNonNullable } from '@dxos/util';\n\n// TODO(burdon): Unify with the graph schema.\nexport const Subgraph = Schema.Struct({\n /** Objects and relations. */\n objects: Schema.Array(Schema.Any),\n});\nexport interface Subgraph extends Schema.Schema.Type<typeof Subgraph> {}\n\nexport type RelatedSchema = {\n schema: Schema.Schema.AnyNoContext;\n kind: 'reference' | 'relation';\n};\n\n/**\n * Find all schemas that are related to the given schema.\n *\n * @param db\n * @param schema\n * @returns\n */\nexport const findRelatedSchema = async (\n db: EchoDatabase,\n anchor: Schema.Schema.AnyNoContext,\n): Promise<RelatedSchema[]> => {\n // TODO(dmaretskyi): Query stored schemas.\n const allSchemas = [...db.graph.schemaRegistry.schemas];\n\n // TODO(dmaretskyi): Also do references.\n return allSchemas\n .filter((schema) => {\n if (getTypeAnnotation(schema)?.kind !== EntityKind.Relation) {\n return false;\n }\n\n return (\n isSchemaAddressableByDxn(anchor, DXN.parse(getTypeAnnotation(schema)!.sourceSchema!)) ||\n isSchemaAddressableByDxn(anchor, DXN.parse(getTypeAnnotation(schema)!.targetSchema!))\n );\n })\n .map(\n (schema): RelatedSchema => ({\n schema,\n kind: 'relation',\n }),\n );\n};\n\n/**\n * Non-strict DXN comparison.\n * Returns true if the DXN could be resolved to the schema.\n */\nconst isSchemaAddressableByDxn = (schema: Schema.Schema.AnyNoContext, dxn: DXN): boolean => {\n if (getTypeIdentifierAnnotation(schema) === dxn.toString()) {\n return true;\n }\n\n const t = dxn.asTypeDXN();\n if (t) {\n return t.type === getSchemaTypename(schema);\n }\n\n return false;\n};\n\n/**\n * Perform vector search in the local database.\n */\nexport const createLocalSearchTool = (db: EchoDatabase, queue?: Queue) => {\n return createTool('search', {\n name: 'local_search',\n description: 'Search the local database for information using a vector index',\n schema: Schema.Struct({\n query: Schema.String.annotations({\n description: 'The query to search for. Could be a question or a topic or a set of keywords.',\n }),\n }),\n execute: async ({ query }) => {\n const { objects } = await db.query(Query.select(Filter.text(query, { type: 'vector' }))).run();\n const results = [...objects];\n if (queue) {\n const queueObjects = await queue.queryObjects();\n // TODO(dmaretskyi): Text search on the queue.\n results.push(...queueObjects);\n }\n\n return ToolResult.Success(`\n <local_context>\n ${JSON.stringify(results, null, 2)}\n </local_context>\n `);\n },\n });\n};\n\n/**\n * Create a schema for structured data extraction.\n */\nexport const createExtractionSchema = (types: Schema.Schema.AnyNoContext[]) => {\n return Schema.Struct({\n ...Object.fromEntries(\n types.map(preprocessSchema).map((schema, index) => [\n `objects_${getSanitizedSchemaName(types[index])}`,\n Schema.optional(Schema.Array(schema)).annotations({\n description: `The objects of type: ${getSchemaDXN(types[index])?.asTypeDXN()!.type}. ${SchemaAST.getDescriptionAnnotation(types[index].ast).pipe(Option.getOrElse(() => ''))}`,\n }),\n ]),\n ),\n });\n};\n\nexport const getSanitizedSchemaName = (schema: Schema.Schema.AnyNoContext) => {\n return getSchemaDXN(schema)!\n .asTypeDXN()!\n .type.replaceAll(/[^a-zA-Z0-9]+/g, '_');\n};\n\nexport const sanitizeObjects = async (\n types: Schema.Schema.AnyNoContext[],\n data: Record<string, readonly unknown[]>,\n db: EchoDatabase,\n queue?: Queue,\n): Promise<BaseObject[]> => {\n const entries = types\n .map(\n (type) =>\n data[`objects_${getSanitizedSchemaName(type)}`]?.map((object: any) => ({\n data: object,\n schema: type,\n })) ?? [],\n )\n .flat();\n\n const idMap = new Map<string, string>();\n const existingIds = new Set<ObjectId>();\n const enitties = new Map<ObjectId, Obj.Any | Relation.Any>();\n\n const resolveId = (id: string): DXN | undefined => {\n if (ObjectId.isValid(id)) {\n existingIds.add(id);\n return DXN.fromLocalObjectId(id);\n }\n\n const mappedId = idMap.get(id);\n if (mappedId) {\n return DXN.fromLocalObjectId(mappedId);\n }\n\n return undefined;\n };\n\n const res = entries\n .map((entry) => {\n // This entry mutates existing object.\n if (ObjectId.isValid(entry.data.id)) {\n return entry;\n }\n\n idMap.set(entry.data.id, ObjectId.random());\n entry.data.id = idMap.get(entry.data.id);\n return entry;\n })\n .map((entry) => {\n const data = deepMapValues(entry.data, (value, recurse) => {\n if (isEncodedReference(value)) {\n const ref = value['/'];\n const id = resolveId(ref);\n\n if (id) {\n // Link to an existing object.\n return { '/': id.toString() };\n } else {\n // Search URIs?\n return { '/': `search:?q=${encodeURIComponent(ref)}` };\n }\n }\n\n return recurse(value);\n });\n\n if (getEntityKind(entry.schema) === 'relation') {\n const sourceDxn = resolveId(data.source);\n if (!sourceDxn) {\n log.warn('source not found', { source: data.source });\n }\n const targetDxn = resolveId(data.target);\n if (!targetDxn) {\n log.warn('target not found', { target: data.target });\n }\n delete data.source;\n delete data.target;\n data[RelationSourceDXNId] = sourceDxn;\n data[RelationTargetDXNId] = targetDxn;\n }\n\n return {\n data,\n schema: entry.schema,\n };\n })\n .filter((object) => !existingIds.has(object.data.id)); // TODO(dmaretskyi): This dissallows updating existing objects.\n\n // TODO(dmaretskyi): Use ref resolver.\n const { objects: dbObjects } = await db.query(Query.select(Filter.ids(...existingIds))).run();\n const queueObjects = (await queue?.getObjectsById([...existingIds])) ?? [];\n const objects = [...dbObjects, ...queueObjects].filter(isNonNullable);\n\n // TODO(dmaretskyi): Returns everything if IDs are empty!\n log.info('objects', { dbObjects, queueObjects, existingIds });\n const missing = Array.from(existingIds).filter((id) => !objects.some((object) => object.id === id));\n if (missing.length > 0) {\n throw new Error(`Object IDs do not point to existing objects: ${missing.join(', ')}`);\n }\n\n return res.flatMap(({ data, schema }) => {\n let skip = false;\n if (RelationSourceDXNId in data) {\n const id = (data[RelationSourceDXNId] as DXN).asEchoDXN()?.echoId;\n const obj = objects.find((object) => object.id === id) ?? enitties.get(id!);\n if (obj) {\n delete data[RelationSourceDXNId];\n data[RelationSourceId] = obj;\n } else {\n skip = true;\n }\n }\n if (RelationTargetDXNId in data) {\n const id = (data[RelationTargetDXNId] as DXN).asEchoDXN()?.echoId;\n const obj = objects.find((object) => object.id === id) ?? enitties.get(id!);\n if (obj) {\n delete data[RelationTargetDXNId];\n data[RelationTargetId] = obj;\n } else {\n skip = true;\n }\n }\n if (!skip) {\n const obj = create(schema, data);\n enitties.set(obj.id, obj);\n return [obj];\n }\n return [];\n });\n};\n\nconst SoftRef = Schema.Struct({\n '/': Schema.String,\n}).annotations({\n description: 'Reference to another object.',\n});\n\nconst preprocessSchema = (schema: Schema.Schema.AnyNoContext) => {\n const isRelationSchema = getEntityKind(schema) === 'relation';\n\n const go = (ast: SchemaAST.AST): SchemaAST.AST => {\n if (SchemaAST.getAnnotation(ast, ReferenceAnnotationId).pipe(Option.isSome)) {\n return SoftRef.ast;\n }\n\n return mapAst(ast, go);\n };\n\n return Schema.make<any, any, never>(mapAst(schema.ast, go)).pipe(\n Schema.omit('id'),\n Schema.extend(\n Schema.Struct({\n id: Schema.String.annotations({\n description: 'The id of this object. Come up with a unique id based on your judgement.',\n }),\n }),\n ),\n isRelationSchema\n ? Schema.extend(\n Schema.Struct({\n source: Schema.String.annotations({\n description: 'The id of the source object for this relation.',\n }),\n target: Schema.String.annotations({\n description: 'The id of the target object for this relation.',\n }),\n }),\n )\n : identity<Schema.Schema.AnyNoContext>,\n );\n};\n\nexport const createGraphWriterTool = ({\n db,\n queue,\n schema,\n onDone = async (x) => x,\n}: {\n db: EchoDatabase;\n queue?: Queue;\n schema: Schema.Schema.AnyNoContext[];\n onDone?: (data: Obj.Any[]) => Promise<any>;\n}) => {\n return createTool('graph', {\n name: 'writer',\n description: 'Write to the local graph database',\n schema: createExtractionSchema(schema),\n execute: async (input) => {\n const data = await sanitizeObjects(schema, input as any, db, queue);\n return ToolResult.Success(await onDone(data as Obj.Any[]));\n },\n });\n};\n", "You are the Research Agent.\n\nThe Research Agent is an expert assistant that conducts in-depth research using real-time web search.\nThe Research Agent outputs results in a structured format matching the schema provided.\n\nThe Research Agent is equipped with the ability to:\n\n- Generate precise and effective search queries \n- Request web pages by query (through a `web_search` tool)\n- Read the full content of retrieved pages\n- Synthesize accurate, clear, and structured answers using reliable information from the retrieved content\n- Search the local database for information using a vector index (through a `local_search` tool)\n\nThe Research Agent always follows these principles:\n\n- Relevance First: The Research Agent only returns facts supported by content in retrieved web pages. The Research Agent never fabricates or guesses information.\n- Summarize, Don't Copy: The Research Agent synthesizes and rephrases content in its own words. The Research Agent quotes only when necessary.\n- Multiple Sources: The Research Agent cross-references at least 2 sources before drawing conclusions, unless the information is directly stated and non-controversial.\n- Transparency: The Research Agent mentions which sources were used and explains how it arrived at conclusions.\n- Accuracy Over Brevity: The Research Agent prefers detailed, technically accurate explanations over shallow summaries.\n- The Research Agent admits uncertainty rather than misleading.\n- The Research Agent picks the most concrete schema types for extracted information.\n- The Research Agent fills schema fields completely with information it is confident about, and omits fields it is not confident about.\n- When outputting results, the Research Agent adds extra data that fits the schema even if not directly related to the user's question.\n- The Research Agent creates relations and references between new objects found and what's already in the database.\n- The Research Agent does not create objects that are already in the database.\n- The Research Agent re-uses existing object IDs as references when enriching existing objects.\n\nThe Research Agent may be asked for:\n\n- Technical explanations\n- Literature reviews \n- Comparisons\n- Emerging trends\n- Implementation strategies\n\nThe Research Agent begins by interpreting the user's request, then:\n\nThe Research Agent breaks it into sub-questions (if applicable).\n\nFor each sub-question, the Research Agent generates a clear, concise web search query.\n\nThe Research Agent uses `web_search`(query) to retrieve information.\n\nThe Research Agent extracts and synthesizes relevant answers.\n\nThe Research Agent's output includes:\n\n- A clear, structured answer to the user's question\n- A citation list or link list of sources used\n\nOptionally, the Research Agent provides follow-up suggestions or questions for deeper inquiry.\n\nHere's how the Research Agent operates:\n\n1. The Research Agent analyzes the user's request and identifies key topics to search for (3 or more), printing them out.\n2. The Research Agent performs a web search for each topic.\n3. The Research Agent reads and analyzes results, cross references information from multiple sources, and represents conflicting information as ranges of possible values.\n\n4. The Research Agent searches the local database for information using a vector index that might link to the user's question.\n6. The Research Agent creates relations and references between new objects and existing database objects when related, using existing object IDs as references.\n7. The Research Agent selects the most concrete schema types for extracted information, using multiple types as needed, and prints its decision and reasoning.\n5. The Research Agent creates a clear, structured answer to the user's question.\n8. The Research Agent submits results using the specific schema.\n\nIMPORTANT:\n\n- The Research Agent always runs the `local_search` tool to search the local database at least once before submitting results.\n- The Research Agent does not create objects that already exist in the database.\n- Ids that are not in the database are human-readable strings like `ivan_zhao_1`.\n\nStatus reporting:\n\nThe Research Agent reports its status frequently using the `<status>` tags: <status>Searching for Google Founders</status>\nThe Research Agent reports its status in-between each tool call and before submitting results.\n\n<example>\n\nBased on my research, I can now provide information about Google and it's founders.\n\nThe following objects are already in the database, I will not submit them again, but I'll re-use their IDs as references:\n\n- 01JWRDEHPB5TT2JQQQC15038BT Google\n- 01JWRDEHPA14CYW2NW9FAH6DJJ Larry Page\n- 01JWRDEHPBN0BBJP57B9S108W6 Sergey Brin\n\nI will use the following schema to construct new objects:\n\n- type:dxos.org/type/Organization for Alphabet Inc.\n- type:dxos.org/type/Person for Ivan Zhao\n- type:dxos.org/type/Person for Simon Last\n- dxn:type:dxos.org/relation/Employer for Ivan's employer\n- dxn:type:dxos.org/relation/Employer for Simon's employer\n\n<status>Formatting results</status>\n\n</example>", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ObjectId } from '@dxos/echo-schema';\n\n// TODO(burdon): Move to artifact.\nexport const createArtifactElement = (id: ObjectId) => `<artifact id=${id} />`;\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AAEvB,SAASC,cAAc;AACvB,SAASC,YAAY;AACrB,SAASC,uBAAuB;AAMzB,IAAMC,YAAYC,OAAOC,OAAO;;;;;;;EAOrCC,KAAKF,OAAOG,OAAOC,YAAY;IAC7BC,aAAa;EACf,CAAA;;;;EAKAC,MAAMN,OAAOG,OAAOC,YAAY;IAC9BC,aAAa;EACf,CAAA;;;;EAKAA,aAAaL,OAAOO,SAASP,OAAOG,MAAM,EAAEC,YAAY;IACtDC,aAAa;EACf,CAAA;;;;;EAMAG,cAAcR,OAAOG,OAAOC,YAAY;IACtCC,aAAa;EACf,CAAA;;;;EAKAI,OAAOT,OAAOU,MAAMC,MAAAA,EAAQP,YAAY;IACtCC,aAAa;EACf,CAAA;;;;EAKAO,WAAWZ,OAAOU,MAAMV,OAAOG,MAAM,EAAEC,YAAY;IACjDC,aAAa;EACf,CAAA;AACF,CAAA,EAAGQ;EACDC,KAAKC,IAAI;;IAEPC,UAAU;IACVC,SAAS;EACX,CAAA;;EAGAC,gBAAgBC,IAAI;IAAC;GAAO;AAAA;;;AC9DvB,IAAMC,oBAAN,MAAMA;EACX,YAA6BC,aAA0B;SAA1BA,cAAAA;AAC3B,SAAKA,YAAYC,KAAK,CAAC,EAAEC,MAAMC,EAAC,GAAI,EAAED,MAAME,EAAC,MAAOD,EAAEE,cAAcD,CAAAA,CAA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;MACPC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OAAO;MACPC,SACE;IACJ;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OAAO;MACPC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MACNC,OAAO;MACPC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OAAO;MACPC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OAAO;MACPC,SAAS;IACX;;EAEFC,aAAa;IACXC,OAAO;IACPC,QAAQ;MACNC,QAAQ;IACV;IACAC,UAAU;MACRP,MAAM;IACR;EACF;AACF;;;AC9HA,IAAA,mCAAe;EACbQ,WAAW;EACXC,kBAAkB;EAClBC,oBAAoB;EACpBC,SAAS;IACP;MACEC,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OAAO;MACPC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;IACA;MACER,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,OACE;MACFC,SAAS;IACX;;EAEFC,aAAa;IACXC,OAAO;IACPC,QAAQ;MACNC,QAAQ;IACV;IACAC,UAAU;MACRP,MAAM;IACR;EACF;AACF;;;AC3IA,IAAA,mCAAe;EACbQ,WAAW;EACXC,kBAAkB;EAClBC,UAAU;EACVC,oBAAoB;EACpBC,SAAS;IACP;MACEC,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNC,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;IACR;IACA;MACEN,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNE,OAAO;MACPD,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNE,OACE;MACFD,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNE,OAAO;MACPD,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OACE;MACFC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNE,OACE;MACFD,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNE,OACE;MACFD,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OAAO;MACPC,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC,MAAM;MACNE,OAAO;MACPD,SAAS;IACX;IACA;MACEP,IAAI;MACJC,OAAO;MACPC,KAAK;MACLE,QAAQ;MACRE,MAAM;MACNE,OACE;MACFD,SACE;IACJ;;EAEFE,aAAa;IACXC,OAAO;IACPC,QAAQ;MACNC,QAAQ;IACV;IACAC,UAAU;MACRP,MAAM;IACR;EACF;AACF;;;AC1HO,IAAMQ,iBAAwC;EAACC;EAASC;EAASC;;;;;AJMjE,IAAMC,gBAAgB,CAAC,EAAEC,OAAM,MAAwB;AA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AAe;IAC7D,CAAA;AAEA,WAAO;MACLzC;IACF;EAUF;AACF,CAAA;;;AGlFO,IAAMyD,wBAAwB,CAACC,OAAiB,gBAAgBA,EAAAA;",
|
|
6
|
-
"names": ["Schema", "ToolId", "Type", "LabelAnnotation", "Blueprint", "Schema", "Struct", "key", "String", "annotations", "description", "name", "optional", "instructions", "tools", "Array", "ToolId", "artifacts", "pipe", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "BlueprintRegistry", "_blueprints", "sort", "name", "a", "b", "localeCompare", "query", "computed", "Array", "pipe", "Obj", "ComplexSet", "Schema", "Type", "ContextBinding", "Schema", "Struct", "blueprints", "added", "Array", "Type", "Ref", "Blueprint", "removed", "objects", "Expando", "pipe", "Obj", "typename", "version", "ContextBinder", "_queue", "bindings", "computed", "_reduce", "objects", "blueprints", "value", "query", "queueItems", "queryObjects", "bind", "props", "length", "append", "Obj", "make", "ContextBinding", "added", "removed", "unbind", "items", "pipe", "Array", "filter", "instanceOf", "reduce", "Bindings", "context", "item", "forEach", "delete", "add", "ComplexSet", "ref", "dxn", "toString", "Message", "Event", "Obj", "Ref", "AiService", "ToolResolverService", "log", "isNonNullable", "Array", "Option", "pipe", "Schema", "AgentStatusReport", "isToolUse", "runTools", "structuredOutputParser", "Message", "MixedStreamParser", "ToolResult", "createTool", "Event", "synchronized", "Obj", "ObjectVersion", "create", "invariant", "log", "Schema", "getVersion", "ObjectId", "ObjectVersionSchema", "Schema", "Unknown", "VersionPinSchema", "Struct", "objectId", "ObjectId", "version", "VersionPin", "DISPOSITION", "fromObject", "object", "make", "id", "getVersion", "createBlock", "pin", "type", "disposition", "json", "JSON", "stringify", "AISession", "_options", "_parser", "MixedStreamParser", "_pending", "_history", "message", "block", "update", "streamEvent", "userMessage", "Event", "statusReport", "done", "toolStatusReport", "on", "push", "type", "disposition", "emit", "create", "AgentStatusReport", "text", "run", "options", "systemTools", "operationModel", "_createQueryArtifactsTool", "artifacts", "_createPlanningTool", "_createRequireTool", "artifactDefinitionIds", "artifactDefinitionId", "requiredArtifactIds", "add", "TypeError", "history", "_formatUserPrompt", "artifactDiffResolver", "prompt", "at", "_stream", "undefined", "error", "Set", "more", "tools", "pipe", "Promise", "all", "map", "toolId", "toolResolver", "resolve", "executableTools", "filter", "artifact", "has", "id", "flatMap", "Array", "dedupeWith", "a", "b", "log", "pending", "length", "tool", "name", "client", "execStream", "generationOptions", "systemPrompt", "createBaseInstructions", "availableArtifacts", "parse", "complete", "invariant", "isToolUse", "response", "runTools", "extensions", "reportStatus", "status", "_onToolStatusReport", "err", "catch", "Error", "includes", "AIServiecOverloadedError", "cause", "runStructured", "schema", "parser", "structuredOutputParser", "result", "getResult", "prelude", "versions", "gatherObjectVersions", "artifactDiff", "entries", "version", "lastVersion", "info", "ObjectVersion", "equals", "get", "delete", "VersionPin", "createBlock", "make", "objectId", "size", "createArtifactUpdateBlock", "Obj", "Message", "role", "content", "createTool", "description", "Schema", "Struct", "execute", "ToolResult", "Success", "artifactDefinitions", "onRequire", "String", "annotations", "examples", "missingArtifactDefinitionIds", "artifactId", "some", "join", "goal", "steps", "action", "input", "output", "missingArtifactIds", "step", "stepResults", "session", "ev", "messages", "slice", "JSON", "stringify", "yourTask", "abort", "TaggedError", "artifactIds", "Map", "DISPOSITION", "pin", "decodeOption", "json", "Option", "getOrUndefined", "set", "diff", "Conversation", "options", "onBegin", "Event", "_serviceContainer", "serviceContainer", "_queue", "queue", "context", "ContextBinder", "run", "session", "AISession", "operationModel", "emit", "history", "getHistory", "query", "blueprints", "Ref", "Array", "loadAll", "filter", "isNonNullable", "length", "log", "warn", "messages", "prompt", "systemPrompt", "at", "instructions", "artifacts", "tools", "executableTools", "requiredArtifactIds", "client", "getService", "AiService", "toolResolver", "ToolResolverService", "extensions", "generationOptions", "append", "queueItems", "queryObjects", "Obj", "instanceOf", "Message", "Schema", "asyncTimeout", "Expando", "log", "DataType", "ExtractionInput", "Struct", "message", "Message", "objects", "optional", "Array", "options", "timeout", "Number", "fallbackToRaw", "Boolean", "ExtractionOutput", "timeElapsed", "processTranscriptMessage", "params", "executor", "invoke", "function", "input", "error", "warn", "Message", "ToolRegistry", "Obj", "create", "AiService", "defineFunction", "DataType", "Schema", "Query", "Filter", "ObjectId", "DXN", "log", "ReferencedQuotes", "Struct", "references", "Array", "id", "String", "quote", "pipe", "mutable", "annotations", "description", "findQuotes", "quotes", "db", "Promise", "all", "map", "objects", "query", "select", "text", "type", "run", "info", "length", "toString", "flat", "insertReferences", "isValid", "regex", "RegExp", "replace", "fromLocalObjectId", "extractionAnthropicFn", "defineFunction", "description", "inputSchema", "ExtractionInput", "outputSchema", "ExtractionOutput", "handler", "data", "message", "objects", "context", "startTime", "performance", "now", "ai", "getService", "AiService", "session", "AISession", "operationModel", "result", "runStructured", "ReferencedQuotes", "generationOptions", "model", "client", "systemPrompt", "PROMPT", "history", "Obj", "make", "Message", "role", "content", "type", "text", "JSON", "stringify", "blocks", "artifacts", "prompt", "tools", "toolResolver", "ToolRegistry", "create", "DataType", "map", "block", "i", "insertReferences", "timeElapsed", "asyncTimeout", "create", "DatabaseService", "defineFunction", "invariant", "log", "DataType", "pipeline", "log", "_ner", "getNer", "then", "ner", "info", "extractFullEntities", "text", "entities", "tokenGroups", "createTokenGroups", "combinedEntities", "map", "combineNerTokens", "tokens", "canBeCombined", "prevToken", "currentToken", "currentState", "currentEntity", "entity", "split", "prevState", "prevEntity", "word", "startsWith", "token", "length", "push", "lastTokenGroup", "at", "group", "combinedToken", "score", "reduce", "acc", "index", "start", "end", "slice", "replace", "extractionNerFn", "defineFunction", "description", "inputSchema", "ExtractionInput", "outputSchema", "ExtractionOutput", "handler", "data", "message", "options", "context", "log", "info", "startTime", "performance", "now", "db", "getService", "DatabaseService", "entitiesPromise", "Promise", "all", "blocks", "map", "block", "invariant", "type", "extractFullEntities", "text", "then", "entities", "flat", "timeout", "asyncTimeout", "quoteReferences", "findQuotes", "entity", "word", "blocksWithReferences", "i", "insertReferences", "messageWithReferences", "create", "DataType", "Message", "timeElapsed", "Schema", "Exa", "createTool", "ToolResult", "log", "requestId", "autopromptString", "autoDate", "resolvedSearchType", "results", "id", "title", "url", "publishedDate", "author", "score", "text", "image", "favicon", "costDollars", "total", "search", "neural", "contents", "requestId", "autopromptString", "resolvedSearchType", "results", "id", "title", "url", "publishedDate", "author", "score", "text", "image", "favicon", "costDollars", "total", "search", "neural", "contents", "requestId", "autopromptString", "autoDate", "resolvedSearchType", "results", "id", "title", "url", "publishedDate", "author", "score", "text", "favicon", "image", "costDollars", "total", "search", "neural", "contents", "SEARCH_RESULTS", "Search1", "Search2", "Search3", "createExaTool", "apiKey", "exa", "Exa", "createTool", "name", "description", "schema", "Schema", "Struct", "query", "String", "annotations", "execute", "context", "searchAndContents", "type", "text", "maxCharacters", "livecrawl", "log", "info", "costDollars", "ToolResult", "Success", "createMockExaTool", "result", "SEARCH_RESULTS", "reduce", "closest", "current", "autopromptString", "dist1", "levenshteinDistance", "dist2", "weight1", "Math", "max", "length", "weight2", "str1", "str2", "m", "n", "dp", "Array", "fill", "map", "i", "j", "min", "Schema", "AgentStatusReport", "ConsolePrinter", "ToolRegistry", "create", "AiService", "CredentialsService", "DatabaseService", "defineFunction", "TracingService", "log", "DataTypes", "Schema", "identity", "Option", "SchemaAST", "createTool", "ToolResult", "Query", "Filter", "isEncodedReference", "EntityKind", "getSchemaTypename", "getTypeAnnotation", "getTypeIdentifierAnnotation", "create", "getEntityKind", "getSchemaDXN", "ObjectId", "ReferenceAnnotationId", "RelationSourceDXNId", "RelationTargetDXNId", "RelationSourceId", "RelationTargetId", "mapAst", "DXN", "log", "deepMapValues", "isNonNullable", "Subgraph", "Struct", "objects", "Array", "Any", "findRelatedSchema", "db", "anchor", "allSchemas", "graph", "schemaRegistry", "schemas", "filter", "schema", "kind", "Relation", "isSchemaAddressableByDxn", "parse", "sourceSchema", "targetSchema", "map", "dxn", "toString", "t", "asTypeDXN", "type", "createLocalSearchTool", "queue", "name", "description", "query", "String", "annotations", "execute", "select", "text", "run", "results", "queueObjects", "queryObjects", "push", "Success", "JSON", "stringify", "createExtractionSchema", "types", "Object", "fromEntries", "preprocessSchema", "index", "getSanitizedSchemaName", "optional", "getDescriptionAnnotation", "ast", "pipe", "getOrElse", "replaceAll", "sanitizeObjects", "data", "entries", "object", "flat", "idMap", "Map", "existingIds", "Set", "enitties", "resolveId", "id", "isValid", "add", "fromLocalObjectId", "mappedId", "get", "undefined", "res", "entry", "set", "random", "value", "recurse", "ref", "encodeURIComponent", "sourceDxn", "source", "warn", "targetDxn", "target", "has", "dbObjects", "ids", "getObjectsById", "info", "missing", "from", "some", "length", "Error", "join", "flatMap", "skip", "asEchoDXN", "echoId", "obj", "find", "SoftRef", "isRelationSchema", "go", "getAnnotation", "isSome", "make", "omit", "extend", "createGraphWriterTool", "onDone", "x", "input", "researchFn", "defineFunction", "description", "inputSchema", "Schema", "Struct", "query", "String", "annotations", "mockSearch", "optional", "Boolean", "default", "outputSchema", "result", "Any", "handler", "data", "context", "ai", "getService", "AiService", "credentials", "CredentialsService", "db", "DatabaseService", "tracing", "TracingService", "write", "create", "AgentStatusReport", "message", "exaCredential", "getCredential", "service", "searchTool", "createMockExaTool", "createExaTool", "apiKey", "printer", "ConsolePrinter", "session", "AISession", "operationModel", "on", "printMessage", "userMessage", "block", "printContentBlock", "statusReport", "status", "log", "info", "streamEvent", "event", "graphWriteTool", "createGraphWriterTool", "schema", "DataTypes", "parameters", "run", "client", "systemPrompt", "PROMPT", "artifacts", "tools", "id", "history", "prompt", "toolResolver", "ToolRegistry", "createArtifactElement", "id"]
|
|
7
|
-
}
|